Skip to content

Get an operation

GET/v1/operations/{operation_id}

Returns one operation. Poll this after any asynchronous action until status is succeeded or failed. started_at and finished_at appear once the operation has started and finished.

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Path parameters

operation_idstringRequired

The operation's uid, as returned in operation_id by the action that queued it.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The operation.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
uidstringRequired

Unique identifier of the operation.

resource_typestringRequired

Kind of resource the operation acts on, for example vm, vm_app, vm_snapshot, k8s_cluster, volume, database or deployment.

resource_uidstringRequired

UID of the resource. For a new VM or snapshot, this is the UID of the resource being created.

resource_namestringRequired

Name of the resource when the operation was queued.

actionstringRequired

What the operation does. For VMs: create, start, stop, reboot, resize, delete, set_app_port, expose and unexpose (custom domains and apps). For snapshots: create, restore and delete. Other resources (k8s_cluster, volume, database, deployment, buckets) use create and delete plus their own actions, for example attach_volume, detach_volume, resize or firewall.apply.

statusstringRequired

Progress of the operation. succeeded and failed are final.

One ofqueuedrunningsucceededfailed

started_atstring (date-time)

When work began. Omitted while queued.

finished_atstring (date-time)

When the operation finished. Omitted until it does.

created_atstring (date-time)Required

When the operation was queued.

events_urlstringRequired

Path of the server-sent events stream with the operation's progress.

Errors

StatusMeaning
400The request was malformed or failed validation.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404The resource does not exist or you cannot access it.

Errors use the standard error format.