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

# Update a volume

> Updates a volume's settings, including its expiration time.



## OpenAPI

````yaml patch /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'
    patch:
      summary: Updates a volume
      description: >-
        Updates a volume's settings, such as its expiration time. Only the
        settings in the request change.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchVolumeRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchVolumeResponseV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request PATCH \

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

            --header "Authorization: Bearer $BASETEN_API_KEY" \

            --data '{
              "expires_at": "2030-01-01T00:00:00Z",
              "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(
                "PATCH",
                url,
                headers=headers,
                json={'expires_at': '2030-01-01T00:00:00Z', '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:
    PatchVolumeRequestV1:
      additionalProperties: false
      properties:
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: >-
            Time at which the volume expires, in ISO 8601 format, with a UTC
            offset. It must be in the future and at most ten years ahead. Set it
            to null to clear the expiration time. A body that sets no field is
            rejected. When the volume expires, all live versions are deleted,
            all tags are removed, and the volume disappears from listings.
            Clearing the expiration time afterward does not restore deleted
            versions. Each deleted version can be restored until its
            delete_after time. Setting or clearing the expiration time requires
            the same permission as deleting the volume.
          examples:
            - '2030-01-01T00:00:00Z'
          title: Expires At
          x-null-distinct: true
        expected_sequence:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          default: null
          description: >-
            Revision the volume is expected to be at. When set, the update fails
            with a conflict if the volume has changed since. Take the value from
            a volume's sequence, or from volume_sequence.
          title: Expected Sequence
      title: PatchVolumeRequestV1
      type: object
    PatchVolumeResponseV1:
      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
        expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Volume expiration time in ISO 8601 format. Null when no expiration
            time is set.
          title: Expires At
        volume_sequence:
          description: Revision of the volume after the update.
          title: Volume Sequence
          type: integer
      required:
        - namespace
        - volume
        - expires_at
        - volume_sequence
      title: PatchVolumeResponseV1
      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.

````