Operation API

Operation API

Read execution state, poll outcomes, inspect child operations, and cancel work.

The Operation API reports execution progress for accepted infrastructure changes. Operations are organization-scoped and filtered by the caller's resource access.

Read an operation

GET/organizations/{organization_id}/operations/{operation_id}
Scope
operations:read
Auth
Bearer API key

Returns the current execution record. Reading does not restart work or extend its lifetime.

200Operation state

The response distinguishes execution state from its phase:

JSON
{
  "data": {
    "id": "op_create01",
    "type": "droplet.create",
    "state": "running",
    "phase": "starting_guest",
    "resource_ids": ["drp_web01", "vol_root01"],
    "child_operation_ids": [],
    "cancelable": true,
    "created_at": "2025-12-16T10:00:00Z",
    "started_at": "2025-12-16T10:00:01Z",
    "finished_at": null,
    "error": null
  },
  "request_id": "req_poll01"
}

The operation fields describe progress, ownership, cancellation, and failure:

FieldTypeBehavior
stateStringqueued, running, reconciling, canceling, succeeded, failed, or canceled
phaseString or nullFeature-specific active stage; clients must tolerate new values
resource_idsString arrayResources affected or created by the operation
child_operation_idsString arrayExecution children for plans and bulk actions
cancelableBooleanWhether the active phase permits cancellation
finished_atTimestamp or nullSet after a terminal result
errorObject or nullCode, message, details, and retryability after failure
progressObject or omittedPhase-specific counters; not a completion-time guarantee

A 404 can mean an unknown ID, expired retained history, or an operation outside the account's visible scope. It must not be treated as success.

List operations

GET/organizations/{organization_id}/operations
Scope
operations:read
Auth
Bearer API key

Lists operations visible to the caller using the selected filters.

Supports project_id, resource_id, state, and type filters plus standard pagination. It requires operations:read and returns only permitted records.

Use resource_id to find the operation holding a lock after a client loses its original response. Use the original idempotency key when retrying the mutation rather than guessing whether a missing response means no work occurred.

Polling

After 202, read the returned operation until it reaches succeeded, failed, or canceled. Respect a response's Retry-After and increase delay during long operations. A client-side deadline stops waiting; it does not cancel the operation.

A successful parent result must still be interpreted according to its type. Maintenance results include skipped targets and child outcomes. Inspect resource health and application readiness after the infrastructure result.

Cancel

POST/organizations/{organization_id}/operations/{operation_id}/cancel
Scope
operations:cancel
Auth
Bearer API key
Repeat calls
Repeated requests preserve the original cancellation intent.

Requests cancellation of a cancelable operation.

Send an empty JSON object. The operation must report cancelable=true. The response is 202 with the operation summary in canceling or its observed terminal state if work finished during the request.

A non-cancelable phase returns 409 cancellation_unavailable. A cancellation request does not reverse committed changes. Poll until a terminal result and inspect completed steps and retained resources.

Error recovery

A failure's retryable value identifies whether repeating the intended operation can be appropriate after the reported condition clears. It is not permission to start an unlimited retry loop. Reconcile current resource state first.

Use Operations for locks and partial changes, API conventions for request retries, and Webhooks for asynchronous completion notifications.