> ## 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

> Deletes every live version of the volume, after which the volume stops appearing in listings. The data is not erased: each version stays restorable until its recovery deadline passes, and the versions sub-resource still reports them when you pass include_tombstoned. Deleting a volume that has no live versions left succeeds and reports zero versions deleted.



## OpenAPI

````yaml delete /v1/volumes/{volume_namespace}/{volume_name}
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}:
    parameters:
      - $ref: '#/components/parameters/volume_namespace'
      - $ref: '#/components/parameters/volume_name'
    delete:
      summary: Deletes a volume
      description: >-
        Deletes every live version of the volume, after which the volume stops
        appearing in listings. The data is not erased: each version stays
        restorable until its recovery deadline passes, and the versions
        sub-resource still reports them when you pass include_tombstoned.
        Deleting a volume that has no live versions left succeeds and reports
        zero versions deleted.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteVolumeRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteVolumeResponseV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request DELETE \

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

            --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}"


            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
  schemas:
    DeleteVolumeRequestV1:
      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 it cannot act on
            a volume someone else has pushed to. Take the value from a volume's
            sequence, or from volume_sequence.
          title: Expected Sequence
      title: DeleteVolumeRequestV1
      type: object
    DeleteVolumeResponseV1:
      properties:
        namespace:
          description: Namespace the volume belongs to, in lowercase.
          title: Namespace
          type: string
        name:
          description: Name of the volume, in lowercase.
          title: Name
          type: string
        versions_deleted:
          description: >-
            Number of versions this request deleted. Zero when the volume had no
            live versions left, which is not an error.
          title: Versions Deleted
          type: integer
        volume_sequence:
          description: Revision of the volume after the delete.
          title: Volume Sequence
          type: integer
      required:
        - namespace
        - name
        - versions_deleted
        - volume_sequence
      title: DeleteVolumeResponseV1
      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.

````