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

# Update Volume Endpoint

> Grow a volume and/or make it public or private.

A new size applies to sandboxes created afterwards (no live resize);
visibility is reversible. A foreign volume is not found.



## OpenAPI

````yaml https://api.primeintellect.ai/api/v1/sandbox/openapi.json patch /api/v1/sandbox/volumes/{ref}
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/sandbox/volumes/{ref}:
    patch:
      tags:
        - Sandbox Volumes
      summary: Update Volume Endpoint
      description: |-
        Grow a volume and/or make it public or private.

        A new size applies to sandboxes created afterwards (no live resize);
        visibility is reversible. A foreign volume is not found.
      operationId: update_volume_endpoint_api_v1_sandbox_volumes__ref__patch
      parameters:
        - name: ref
          in: path
          required: true
          schema:
            type: string
            pattern: >-
              ^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?(/[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?)?$
            title: Ref
        - name: team_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Resolve a bare name in this team's scope
            title: Team Id
          description: Resolve a bare name in this team's scope
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVolumeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VolumeResponse'
        '401':
          description: Authorization failed
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateVolumeRequest:
      properties:
        size_gb:
          anyOf:
            - type: integer
              maximum: 10240
              minimum: 100
            - type: 'null'
          title: Size Gb
          description: >-
            New volume size in whole GiB. Grow-only: must exceed the volume's
            current size and its head checkpoint's size.
        visibility:
          anyOf:
            - type: string
              enum:
                - PRIVATE
                - PUBLIC
            - type: 'null'
          title: Visibility
          description: >-
            PUBLIC lets any tenant mount, sync, and read the volume by its
            <namespace>/<name> ref; PRIVATE stops new mounts and syncs and
            leaves running attachments reading their pinned head.
      type: object
      title: UpdateVolumeRequest
      description: |-
        PATCH body: grow the size, change the visibility, or both.

        Repeating the current visibility is a no-op; growing is grow-only.
    VolumeResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        namespace:
          type: string
          title: Namespace
        visibility:
          type: string
          title: Visibility
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        head_checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Head Checkpoint Id
        created_at:
          type: string
          format: date-time
          title: Created At
        occupied_bytes:
          type: integer
          title: Occupied Bytes
          default: 0
        size_gb:
          type: integer
          title: Size Gb
          default: 100
        account_storage_used_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Account Storage Used Bytes
        account_storage_limit_gb:
          anyOf:
            - type: integer
            - type: 'null'
          title: Account Storage Limit Gb
      type: object
      required:
        - id
        - name
        - namespace
        - visibility
        - created_at
      title: VolumeResponse
      description: >-
        One volume the caller owns, scoped to its single owner (exactly one of

        user/team).


        namespace is the owner's display namespace: its user or team slug, else
        the

        id form (user id or ``team-<teamId>``). The id form is also used when
        the

        slug equals an existing user id or does not parse as a volume namespace

        segment, so a displayed ref always parses and always names the owner
        that

        shows it. ``namespace/name`` is the ref to share.

        occupied_bytes is the current published version's non-hole uncompressed

        size (the head checkpoint's occupiedBytes). The GET response fills the

        account fields with the caller's volume-storage usage (bytes) and wallet

        limit (whole GiB); list items leave them null and the page-level

        VolumeListResponse carries them instead. occupied_bytes defaults to 0

        legitimately: create_volume returns a bare Volume row (nothing published

        yet, no head to join), and list/get/update rows carry the joined head

        bytes.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````