Concepts
Actions
Long-running operations and how to follow them.
Creating a server, attaching a volume, powering off: many operations take seconds to minutes. The API does not keep
the connection open until they are done. It starts the operation and answers right away (201) with an action:
{
"action": {
"id": 4211,
"command": "create_server",
"status": "running",
"progress": 0,
"started": "2026-10-09T08:00:00Z",
"finished": null,
"resources": [{ "id": 42, "type": "server" }],
"error": null
}
}Poll GET /actions/{id} until status is no longer running (or listen to real-time events instead):
| Status | Meaning |
|---|---|
running | Still in progress; progress goes from 0 to 100 |
success | Done |
error | Failed; error.code and error.message say why. Changes are rolled back where possible |
while :; do
status=$(curl -s -H "Authorization: Bearer $ODX_TOKEN" \
https://api.odinex.cloud/v1/actions/4211 | jq -r .action.status)
[ "$status" = running ] || break
sleep 2
done
echo "$status"The odx CLI and the Terraform provider wait for actions automatically (odx … --no-wait returns at once).
resourceslists the resources the action works on.GET /actionslists the project's actions, newest first, filtered bystatusor byresource_typeandresource_id.- While an action runs on a resource, other changes to that resource fail with
409 resource_busy. Wait for the action to finish, then retry. - The resource returned next to the action (for example
serverfromPOST /servers) already exists in the API, with a status such asinitializing, before the action has finished.