Skip to main content
POST
/
volumes
Create persistent volume
curl --request POST \
  --url https://api.blaxel.ai/v0/volumes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "metadata": {
    "name": "my-resource",
    "displayName": "My Resource",
    "labels": {}
  },
  "spec": {
    "region": "us-pdx-1",
    "size": 1024,
    "template": "mytemplate:latest"
  },
  "status": "<string>",
  "terminatedAt": "<string>"
}
'
{
  "metadata": {
    "name": "my-resource",
    "createdAt": "<string>",
    "updatedAt": "<string>",
    "createdBy": "<string>",
    "updatedBy": "<string>",
    "displayName": "My Resource",
    "labels": {},
    "plan": "<string>",
    "url": "<string>",
    "workspace": "<string>"
  },
  "spec": {
    "infrastructureId": "<string>",
    "region": "us-pdx-1",
    "size": 1024,
    "template": "mytemplate:latest"
  },
  "events": [
    {
      "canaryRevision": "<string>",
      "message": "Deployment successful",
      "revision": "rev-abc123",
      "status": "DEPLOYED",
      "time": "2025-01-15T10:30:00Z",
      "type": "deployment"
    }
  ],
  "state": {
    "attachedTo": "sandbox:my-sandbox"
  },
  "status": "<string>",
  "terminatedAt": "<string>"
}

Authorizations

Authorization
string
header
required

OAuth2 authentication with JWT tokens

Body

application/json

Persistent storage volume that can be attached to sandboxes for durable file storage across sessions. Volumes survive sandbox deletion and can be reattached to new sandboxes.

metadata
object
required

Common metadata fields shared by all Blaxel resources including name, labels, timestamps, and ownership information

spec
object
required

Immutable volume configuration set at creation time (size and region cannot be changed after creation)

status
string

Volume status computed from events

terminatedAt
string

Timestamp when the volume was marked for termination

Response

successful operation

Persistent storage volume that can be attached to sandboxes for durable file storage across sessions. Volumes survive sandbox deletion and can be reattached to new sandboxes.

metadata
object
required

Common metadata fields shared by all Blaxel resources including name, labels, timestamps, and ownership information

spec
object
required

Immutable volume configuration set at creation time (size and region cannot be changed after creation)

events
object[]

Events happening on a resource deployed on Blaxel

state
object

Current runtime state of the volume including attachment status

status
string

Volume status computed from events

terminatedAt
string

Timestamp when the volume was marked for termination