Operations
Track asynchronous work — provisioning, restores, and other long-running tasks — through operations.
Some API actions are asynchronous: provisioning a database, restoring a branch to a point in time, and similar long-running work. These return an operation that you can poll until it completes.
The API is stabilizing. The paths below reflect the current interface; field-level details may still change before general availability.
List operations
GET /v1/projects/{project_id}/operations
List the operations for a project, newest first.
curl https://api.silos.sh/v1/projects/proj_abc123/operations \
-H "Authorization: Bearer $SILOS_API_KEY"{
"operations": [
{
"id": "op_abc123",
"project_id": "proj_abc123",
"action": "create_database",
"status": "finished",
"created_at": "2026-06-01T12:00:00Z"
}
]
}Get an operation
GET /v1/operations/{id}
Fetch a single operation to check its status.
curl https://api.silos.sh/v1/operations/op_abc123 \
-H "Authorization: Bearer $SILOS_API_KEY"{
"operation": {
"id": "op_abc123",
"project_id": "proj_abc123",
"action": "restore_branch",
"status": "running",
"created_at": "2026-06-01T12:00:00Z"
}
}Statuses
An operation's status moves through a small set of states:
| Status | Meaning |
|---|---|
running | The operation is in progress. |
finished | The operation completed successfully. |
failed | The operation did not complete. |
Polling pattern
When an action returns an operation, poll it until it leaves running:
Start the action
A call such as restoring a branch returns an operation ID.
Poll the operation
curl https://api.silos.sh/v1/operations/op_abc123 \
-H "Authorization: Bearer $SILOS_API_KEY"Repeat with a short backoff until status is finished or failed.
Proceed
Once finished, the resource is ready. On failed, inspect the operation and retry
as appropriate.
Most actions complete quickly. Polling with a short interval (and a sensible timeout) is the simplest way to wait for asynchronous work.