> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a volume version

> Deletes the version the address names, along with every tag pointing at it. Addressing the version by tag deletes the version the tag points at, not the tag. The data is not erased: the version stays restorable until the recovery deadline in the response passes. Deleting a version that is already deleted is a conflict, not a repeat success.



## OpenAPI

````yaml delete /v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}:
    parameters:
      - $ref: '#/components/parameters/volume_namespace'
      - $ref: '#/components/parameters/volume_name'
      - $ref: '#/components/parameters/volume_version'
    delete:
      summary: Deletes one version of a volume
      description: >-
        Deletes the version the address names, along with every tag pointing at
        it. Addressing the version by tag deletes the version the tag points at,
        not the tag. The data is not erased: the version stays restorable until
        the recovery deadline in the response passes. Deleting a version that is
        already deleted is a conflict, not a repeat success.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteVolumeVersionRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteVolumeVersionResponseV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request DELETE \

            --url
            https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}
            \

            --header "Authorization: Bearer $BASETEN_API_KEY" \

            --data '{
              "expected_sequence": null
            }'
        - lang: python
          source: >-
            import requests

            import os

            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")

            url =
            "https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}"


            headers = {"Authorization": f"Bearer {API_KEY}"}


            response = requests.request(
                "DELETE",
                url,
                headers=headers,
                json={'expected_sequence': None}
            )


            print(response.text)
components:
  parameters:
    volume_namespace:
      schema:
        type: string
      name: volume_namespace
      in: path
      required: true
    volume_name:
      schema:
        type: string
      name: volume_name
      in: path
      required: true
    volume_version:
      schema:
        type: string
      name: volume_version
      in: path
      required: true
  schemas:
    DeleteVolumeVersionRequestV1:
      properties:
        expected_sequence:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: >-
            Revision the volume is expected to be at. When set, the delete fails
            with a conflict if the volume has changed since, so a read followed
            by a delete cannot act on a version a tag has since been moved off.
            Take the value from volume_sequence.
          title: Expected Sequence
      title: DeleteVolumeVersionRequestV1
      type: object
    DeleteVolumeVersionResponseV1:
      properties:
        namespace:
          description: Namespace the volume belongs to, in lowercase.
          title: Namespace
          type: string
        volume:
          description: Name of the volume, in lowercase.
          title: Volume
          type: string
        version_ref:
          description: >-
            Full address of the deleted version, as
            `bdn:<namespace>/<volume>@<digest>`.
          title: Version Ref
          type: string
        digest:
          description: Content digest of the deleted version, as `b3:<hex>`.
          title: Digest
          type: string
        lifecycle:
          description: Lifecycle state of the version after the delete.
          title: Lifecycle
          type: string
        delete_after:
          description: >-
            When the version stops being restorable, in ISO 8601 format. Until
            then it can be returned to service.
          format: date-time
          title: Delete After
          type: string
        volume_sequence:
          description: Revision of the volume after the delete.
          title: Volume Sequence
          type: integer
      required:
        - namespace
        - volume
        - version_ref
        - digest
        - lifecycle
        - delete_after
        - volume_sequence
      title: DeleteVolumeVersionResponseV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````