Attach a volume to a running sandbox

The volume appears in the sandbox as a disk of its own.

POST/v1/sandboxes/{sandbox_id}/volumes

Not available yet Volumes are not served by the API yet. Their calls answer from a stand-in.

The volume appears in the sandbox as a disk of its own. A volume is attached to one sandbox at a time: one attached elsewhere is conflict, and so is a sandbox that is not running. With locked, the volume is made ready but the sandbox cannot see it until unlock (Pod CI attaches a warm folder at create and unlocks it once the job is known). With throwaway, its writes stay on the sandbox's server and are gone when it is detached; it cannot be published. A volume can also be attached at create (CreateSandboxRequest.volumes). The volume and sandbox must belong to the same project and test or live mode.

A key with the sandboxes:write scope.

Request

curl -X POST "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/volumes" \
  -H "Authorization: Bearer $POD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"volume":"vol_3ahrz6dmv29gqy5ckt18fpx4b"}'

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes
Idempotency-KeyheaderstringNoMakes a repeat of this call safe for 24 hours.

Body

FieldTypeRequiredWhat it is
volumestringYesA block volume.
lockedbooleanNoMake the volume ready but hidden from the sandbox until unlock. Default false.
throwawaybooleanNoKeep the sandbox's writes on its server only; they are gone at detach. Default false.

Answer

200. The volume, attached.

200
{
  "volume": "vol_3ahrz6dmv29gqy5ckt18fpx4b",
  "sandbox": "sbx_3ahrz6dmv29gqy5ckt18fpx4b",
  "locked": false,
  "throwaway": false,
  "attached_at": "2026-11-23T12:00:00.000Z"
}
FieldTypeAlwaysWhat it is
volumestringYesA block volume.
sandboxstringYes
lockedbooleanYes
throwawaybooleanYes
attached_atstringYesRFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z.

Errors

The refusals this call is known for: invalid, not_found, conflict. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.

In the SDKs

ClientCall
TypeScriptpod.volumes.attach(sandbox, volume, { locked })
Pythonpod.volumes.attach(sandbox, volume, locked=…)