Docs
API Reference

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.

Terminal
curl https://api.silos.sh/v1/projects/proj_abc123/operations \
  -H "Authorization: Bearer $SILOS_API_KEY"
Response
{
  "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.

Terminal
curl https://api.silos.sh/v1/operations/op_abc123 \
  -H "Authorization: Bearer $SILOS_API_KEY"
Response
{
  "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:

StatusMeaning
runningThe operation is in progress.
finishedThe operation completed successfully.
failedThe 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

Terminal
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.

On this page