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

# Attach storage to a cluster

> Attach a storage volume to a cluster. Returns 202 immediately with request IDs. Poll /request/info/{request_id} to track progress. WARNING: Attaching storage restarts all cluster nodes.



## OpenAPI

````yaml https://engine.tensorpool.dev/openapi.json post /storage/attach
openapi: 3.1.0
info:
  title: TensorPool API
  description: >
    TensorPool API


    All API endpoints (except `/healthz`) require authentication using your
    TensorPool API key.


    ### For REST Endpoints


    Include your API key in the `Authorization` header as a Bearer token:


    ```bash

    Authorization: Bearer YOUR_TENSORPOOL_KEY

    ```

    ### For WebSocket Endpoints


    Send your API key as the first message in JSON format:


    ```json

    {"TENSORPOOL_KEY": "YOUR_TENSORPOOL_KEY"}

    ```
  version: 0.1.0
servers: []
security: []
tags:
  - name: job
    description: >-
      GPU job execution and management. Run workloads on ephemeral clusters with
      automatic cleanup.
  - name: cluster
    description: >-
      GPU cluster provisioning and lifecycle management. Create persistent
      compute resources.
  - name: storage
    description: >-
      Shared storage volume management. Persistent storage that can be attached
      to eligible clusters.
  - name: object-storage
    description: S3-compatible object storage management.
  - name: ssh
    description: SSH key management for secure cluster access.
  - name: user
    description: >-
      User account management including balance, billing, and organization
      operations.
  - name: requests
    description: Cloud resource provisioning request tracking and status monitoring.
paths:
  /storage/attach:
    post:
      tags:
        - storage
      summary: Attach storage to a cluster
      description: >-
        Attach a storage volume to a cluster. Returns 202 immediately with
        request IDs. Poll /request/info/{request_id} to track progress. WARNING:
        Attaching storage restarts all cluster nodes.
      operationId: storage_attach
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StorageAttachRestRequest'
        required: true
      responses:
        '202':
          description: Storage attachment initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorageAttachRestResponse'
        '400':
          description: Invalid request or cluster not eligible
        '403':
          description: Access denied
        '404':
          description: Storage or cluster not found
        '409':
          description: Cluster already has storage attached or storage not ready
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - HTTPBearer: []
components:
  schemas:
    StorageAttachRestRequest:
      properties:
        storage_id:
          type: string
          title: Storage Id
          description: Storage ID to attach (must start with 's-')
        cluster_ids:
          items:
            type: string
          type: array
          maxItems: 1
          minItems: 1
          title: Cluster Ids
          description: Cluster ID(s) to attach storage to
      type: object
      required:
        - storage_id
        - cluster_ids
      title: StorageAttachRestRequest
      description: Request body for POST /storage/attach.
    StorageAttachRestResponse:
      properties:
        storage_id:
          type: string
          title: Storage Id
          description: TensorPool storage ID
        cluster_ids:
          items:
            type: string
          type: array
          title: Cluster Ids
          description: Attached cluster IDs
        request_ids:
          items:
            type: string
          type: array
          title: Request Ids
          description: Request IDs for tracking
        message:
          type: string
          title: Message
          description: Status message
      type: object
      required:
        - storage_id
        - message
      title: StorageAttachRestResponse
      description: Response for POST /storage/attach.
    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

````