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

# Restore a volume version

> Returns a deleted version to service, provided its recovery deadline has not passed. The tags the version carried when it was deleted are not restored with it, so re-tag it if anything depended on those. Address the version by digest: a deleted version has no tags left to name it by.



## OpenAPI

````yaml post /v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}/restore
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}/restore:
    parameters:
      - $ref: '#/components/parameters/volume_namespace'
      - $ref: '#/components/parameters/volume_name'
      - $ref: '#/components/parameters/volume_version'
    post:
      summary: Restores a deleted version of a volume
      description: >-
        Returns a deleted version to service, provided its recovery deadline has
        not passed. The tags the version carried when it was deleted are not
        restored with it, so re-tag it if anything depended on those. Address
        the version by digest: a deleted version has no tags left to name it by.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestoreVolumeVersionRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestoreVolumeVersionResponseV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request POST \

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

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


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


            response = requests.request(
                "POST",
                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:
    RestoreVolumeVersionRequestV1:
      properties:
        expected_sequence:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: >-
            Revision the volume is expected to be at. When set, the restore
            fails with a conflict if the volume has changed since. Take the
            value from volume_sequence.
          title: Expected Sequence
      title: RestoreVolumeVersionRequestV1
      type: object
    RestoreVolumeVersionResponseV1:
      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 restored version, as
            `bdn:<namespace>/<volume>@<digest>`.
          title: Version Ref
          type: string
        digest:
          description: Content digest of the restored version, as `b3:<hex>`.
          title: Digest
          type: string
        lifecycle:
          description: Lifecycle state of the version after the restore.
          title: Lifecycle
          type: string
        volume_sequence:
          description: Revision of the volume after the restore.
          title: Volume Sequence
          type: integer
      required:
        - namespace
        - volume
        - version_ref
        - digest
        - lifecycle
        - volume_sequence
      title: RestoreVolumeVersionResponseV1
      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.

````