Koo Docs
View as Markdown

Volumes

List the persistent volumes in an environment

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes
Rolesreadereditoradminowner
Parameters
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · VolumeDto[]
cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes \  -H "Authorization: Bearer kc_your_api_token"
Response
json
[  {    "id": "acct_01example0000000000000000x",    "environmentId": "env_01example0000000000000000x",    "serviceId": "svc_01example0000000000000000x",    "name": "my-app",    "mountPath": "example",    "sizeGb": 0,    "status": {      "state": "ready",      "location": "example",      "currentSizeGb": 1,      "usedBytes": 1,      "commands": [        {          "id": "acct_01example0000000000000000x",          "kind": "expand",          "status": "running",          "startedAt": "2026-01-01T00:00:00.000Z",          "completedAt": "2026-01-01T00:00:00.000Z",          "error": "example",          "detail": "example"        }      ]    },    "createdAt": "2026-01-01T00:00:00.000Z",    "updatedAt": "2026-01-01T00:00:00.000Z"  }]

Get a persistent volume

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}
Rolesreadereditoradminowner
Parameters
volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · VolumeDto
idstringread-only
environmentIdstringread-only

The environment this volume belongs to.

serviceIdstring | nullread-only

The service mounting this volume; null when detached (an orphan).

namestringread-only

Volume name, unique within the environment.

mountPathstringread-only

Path the volume is mounted at when attached.

sizeGbintegerread-only

Current volume size in GB.

statusobjectread-only

Read-only: live disk state (provisioning/ready, actual size, usage).

createdAtstring <date-time>read-only
updatedAtstring <date-time>read-only
cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "id": "acct_01example0000000000000000x",  "environmentId": "env_01example0000000000000000x",  "serviceId": "svc_01example0000000000000000x",  "name": "my-app",  "mountPath": "example",  "sizeGb": 0,  "status": {    "state": "ready",    "location": "example",    "currentSizeGb": 1,    "usedBytes": 1,    "commands": [      {        "id": "acct_01example0000000000000000x",        "kind": "expand",        "status": "running",        "startedAt": "2026-01-01T00:00:00.000Z",        "completedAt": "2026-01-01T00:00:00.000Z",        "error": "example",        "detail": "example"      }    ]  },  "createdAt": "2026-01-01T00:00:00.000Z",  "updatedAt": "2026-01-01T00:00:00.000Z"}

Destroy a detached (orphan) volume

DELETE/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}
Rolesreadereditoradminowner

Deletes a DETACHED volume and its data permanently. 409 if still attached (detach from its service first); 412 without confirmDataLoss.

Parameters
volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
confirmDataLossbooleanrequired

Must be true to proceed: deleting a detached volume destroys its data permanently.

Returns
204
cURL
DELETE /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId \  -X DELETE \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{      "confirmDataLoss": true    }'

Get a volume’s live state

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/status
Rolesreadereditoradminowner

The disk’s live lifecycle, actual size/usage, the location it is provisioned in, and which day-2 commands (expand/snapshot/restore) are currently in flight. The console gates the volume actions on this.

Parameters
volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · VolumeStatusDto
state"ready" | "provisioning" | "repairing" | "unknown"read-only

Live state of the attached disk: `ready` (bound + in use), `provisioning` (being created/attached), `repairing`, or `unknown`.

locationstringread-only

The location the volume is actually provisioned in (when provisioned).

currentSizeGbnumberread-only

Actual provisioned capacity in GiB, as the storage layer reports it live.

usedBytesnumberread-only

Bytes currently used on the disk.

commandsobject[]read-only

Recent day-2 commands (newest first), persisted by Koo — live AND terminal state, so the console shows an in-progress or just-completed/failed operation even after a page reload.

cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/status
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId/status \  -H "Authorization: Bearer kc_your_api_token"
Response
json
{  "state": "ready",  "location": "example",  "currentSizeGb": 1,  "usedBytes": 1,  "commands": [    {      "id": "acct_01example0000000000000000x",      "kind": "expand",      "status": "running",      "startedAt": "2026-01-01T00:00:00.000Z",      "completedAt": "2026-01-01T00:00:00.000Z",      "error": "example",      "detail": "example"    }  ]}

Grow a persistent volume

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/expand
Rolesreadereditoradminowner

Grow-only — a shrink is rejected (422). The mounting service’s spec is kept in sync.

Parameters
volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
sizeGbintegerrequired

New volume size in GB. Must be larger than the current size — volumes only grow.

Returns
200 · VolumeDto
idstringread-only
environmentIdstringread-only

The environment this volume belongs to.

serviceIdstring | nullread-only

The service mounting this volume; null when detached (an orphan).

namestringread-only

Volume name, unique within the environment.

mountPathstringread-only

Path the volume is mounted at when attached.

sizeGbintegerread-only

Current volume size in GB.

statusobjectread-only

Read-only: live disk state (provisioning/ready, actual size, usage).

createdAtstring <date-time>read-only
updatedAtstring <date-time>read-only
cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/expand
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId/expand \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{      "sizeGb": 0    }'
Response
json
{  "id": "acct_01example0000000000000000x",  "environmentId": "env_01example0000000000000000x",  "serviceId": "svc_01example0000000000000000x",  "name": "my-app",  "mountPath": "example",  "sizeGb": 0,  "status": {    "state": "ready",    "location": "example",    "currentSizeGb": 1,    "usedBytes": 1,    "commands": [      {        "id": "acct_01example0000000000000000x",        "kind": "expand",        "status": "running",        "startedAt": "2026-01-01T00:00:00.000Z",        "completedAt": "2026-01-01T00:00:00.000Z",        "error": "example",        "detail": "example"      }    ]  },  "createdAt": "2026-01-01T00:00:00.000Z",  "updatedAt": "2026-01-01T00:00:00.000Z"}

List a volume’s snapshots (live storage state)

GET/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots
Rolesreadereditoradminowner
Parameters
volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
200 · VolumeSnapshotDto[]
cURL
GET /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId/snapshots \  -H "Authorization: Bearer kc_your_api_token"
Response
json
[  {    "name": "my-app",    "id": "acct_01example0000000000000000x",    "createdAt": "2026-01-01T00:00:00.000Z",    "sizeGb": 1,    "status": "creating"  }]

Take a manual snapshot of a volume

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots
Rolesreadereditoradminowner

A timestamped name is generated when omitted.

Parameters
volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
namestring

Optional name for the snapshot. A timestamped name is generated when omitted.

Returns
200 · VolumeSnapshotDto
namestringread-only

Snapshot name — use it to restore or delete the snapshot.

idstringread-only

Read-only snapshot identifier assigned by Koo’s storage layer.

createdAtstring <date-time>read-only

When the snapshot was taken.

sizeGbnumberread-only

Snapshot size in GB.

status"creating" | "ready" | "deleting"read-only

Durable lifecycle (creating/ready/deleting); absent for a snapshot found only in live storage state (no Koo record).

cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId/snapshots \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{}'
Response
json
{  "name": "my-app",  "id": "acct_01example0000000000000000x",  "createdAt": "2026-01-01T00:00:00.000Z",  "sizeGb": 1,  "status": "creating"}

Restore a volume in place from a snapshot

POST/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots/{name}/restore
Rolesreadereditoradminowner

Destructive — overwrites the volume’s current data with the snapshot’s. 412 without confirmDataLoss.

Parameters
namestringpathrequired

Snapshot name to restore.

volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Request body
confirmDataLossbooleanrequired

Must be true to proceed: restoring overwrites the volume’s current data with the snapshot’s.

Returns
204
cURL
POST /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots/{name}/restore
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId/snapshots/:name/restore \  -X POST \  -H "Authorization: Bearer kc_your_api_token" \  -H "Content-Type: application/json" \  -d '{      "confirmDataLoss": true    }'

Delete a volume snapshot

DELETE/accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots/{name}
Rolesreadereditoradminowner
Parameters
namestringpathrequired

Snapshot name to delete.

volumeIdstringpathrequired
environmentIdstringpathrequired
projectIdstringpathrequired
accountIdstringpathrequired
Returns
204
cURL
DELETE /accounts/{accountId}/projects/{projectId}/environments/{environmentId}/volumes/{volumeId}/snapshots/{name}
bash
curl https://api.koo.io/accounts/:accountId/projects/:projectId/environments/:environmentId/volumes/:volumeId/snapshots/:name \  -X DELETE \  -H "Authorization: Bearer kc_your_api_token"