Skip to main content
POST
/
v1
/
sandboxes
/
{id}
/
volumes
Attach a volume to a running sandbox
import requests

url = "https://api.13-215-85-171.sslip.io/v1/sandboxes/{id}/volumes"

payload = {
    "ref": "<string>",
    "mount_path": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "id": "<string>",
  "volume_id": "<string>",
  "sandbox_id": "<string>",
  "mount_path": "<string>",
  "read_only": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "subpath": "<string>",
  "last_error_code": "<string>",
  "last_error_message": "<string>"
}

Authorizations

Authorization
string
header
required

API key passed as Bearer token

Path Parameters

id
string
required

Sandbox ID (e.g. sb_a1b2c3d4)

Body

application/json

Shared-volume mount request. ref accepts either an exact volume name or a volume id and is resolved server-side.

ref
string
required

Canonical mount selector for sandbox create. Accepts either an exact volume name or a volume id and is resolved server-side.

mount_path
string
required

Absolute sandbox mount path for the attached volume. Values are normalized before persistence. / and reserved runtime paths under /workspace/.nullspace are rejected.

subpath
string | null

Optional volume-internal subdirectory. Values are normalized relative to the volume root and may not escape it.

read_only
boolean
default:false

Response

Volume attached

id
string
required
volume_id
string
required
sandbox_id
string
required
mount_path
string
required

Normalized sandbox mount path for the attached volume.

read_only
boolean
required
state
enum<string>
required
Available options:
requested,
mounting,
mounted,
paused,
remounting,
unmounted,
releasing,
released,
failed
created_at
string<date-time>
required
updated_at
string<date-time>
required
subpath
string | null
last_error_code
string | null
last_error_message
string | null