Save the returned operation ID before doing more work. Direct actions, saved timeline runs, abort requests, and API event effects use durable operation admission: the server records the operation before execution. Group and script creation, reads, updates, and deletion (CRUD) do not.
Read operation state
| Method and path | Query | Response |
|---|---|---|
GET /operations |
offset integer at least 0 (default 0); limit 1 through 500 (default 100) |
{operations,total,offset,limit} |
GET /operations/{id} |
None | {operation} |
GET /runs |
No pagination | {items} of shared API script-run and managed-trigger operations |
GET /runs/{id} |
None | One shared API timeline or managed operation, without an outer envelope |
IDs in both /runs/{id} and /operations/{id} are durable operation IDs. operation.result.runId is the internal runner correlation ID, not a valid replacement in these paths. URL-encode IDs.
Operations and run ownership are shared across all API clients, including retained legacy API history. Public ownerId values identify shared API ownership; legacy owner namespaces remain in storage, not as a per-client access boundary. Coordinate clients before aborting shared work.
Lists contain retained full records only; total is not a lifetime operation count. A known operation whose details were compacted returns 410 operation_expired, including through /runs/{id} and its abort route. An unknown ID still returns 404 operation_not_found.
An operation includes id, ownerId, kind, state, createdAt, updatedAt, and, when available, result and error. The API omits its internal idempotency key/hash from returned records.
| State | Meaning |
|---|---|
accepted |
Admission was durably recorded |
running |
The action or asynchronous timeline is in progress |
succeeded |
The executor returned successfully; this is not proof of every physical effect |
partially_succeeded |
Some targeted setting dispatches were accepted and others failed |
failed |
The admitted action failed; inspect error and any outcomes |
cancelled |
Timeline or managed execution reported cancellation; not physical recall |
interrupted |
Camera Server restarted with unfinished work; execution may have occurred |
The last five states are terminal. A stored terminal operation cannot be restarted by replaying its key.
Exact idempotency rules
Send Idempotency-Key on every write, including direct warmup, trigger, managed trigger (either path), advanced warmup-trigger, autofocus, setting, timeline-run, and abort requests. A key is 1 through 128 visible ASCII characters, without spaces or control characters. Resource CRUD does not use the action replay ledger even when the header is sent.
The ledger matches a shared API key, then compares operation kind and a canonical JSON-body hash. JSON object-key order does not change the hash. Array order and payload values do. Reusing a key for a different kind or payload gives 409 idempotency_conflict.
Use separate keys for /warmup and /trigger, even when both bodies are {}. Their fixed phases are part of the admitted payload, so reusing one key between them returns 409 idempotency_conflict, not a replay.
For the same kind and payload, a retry sent while the original admission is still in progress waits for that admission callback, then returns the existing operation with replayed:true. It never re-dispatches the physical action. For asynchronous timelines, that callback finishes after run acceptance, not after the whole timeline finishes.
Managed admission can return while capture work is pending. The operation stays running until actual dispatch/repeat completion or movie end, or until its configured Script runner completes. It does not finish merely because a timer was scheduled, and it does not wait for files readiness. /trigger-managed and its working /captures/managed alias use the same managed-trigger kind and empty body.
The comparison is kind/body based, not a general HTTP URL cache. Use a unique key for each distinct intended action, including runs of different timeline IDs and different saved revisions. Keep the original body and key in your client alongside its operation ID.
Legacy owner IDs stay in stored records and retry receipts. One matching legacy key can replay its retained original operation; if its full result has expired, it returns 410 idempotency_expired. Multiple records for that key give 409 idempotency_ambiguous, and a sole record with a different kind/body gives 409 idempotency_conflict. These failures never redispatch the action. Do not change the key to sidestep expired or ambiguous history.
Some checks happen before admission, including network access, API entitlement, document revision, and explicit warmup configuration checks. A later HTTP retry can fail one of those checks before it reaches an already-recorded key. Reconcile the original operation instead of forcing a new admission.
Retry decisions
- If a response includes
{operation,replayed}, inspect its state even when HTTP is200. A failed operation is not a transport retry request. - If the response is lost and access, entitlement, configuration, and revision remain valid, resend the identical request with the original key.
- If you know the operation ID, read it first. On a revision conflict, inspect the changed document and the original operation.
- On
429 rate_limited, honorRetry-After. Do not create a new key. - On
403access or entitlement denial, stop new execution and involve the operator. Do not bypass the network, browser, Host, or license checks. - On
interrupted, partial success, or uncertain physical results, reconcile what happened before authorizing any new action. A new key represents new work. - On
410 idempotency_expiredor410 operation_expired, stop retrying that action. Its effects may already have occurred. Reconcile camera, dataset, or other resource state and your application's saved result. A replacement key is a new physical action, not a recovery shortcut.
Automatic history compaction
The server retains the latest 10000 completed operation records, ordered by their last update, plus every accepted/running operation. In-flight admission callbacks stay protected until they settle. Completed states include success, partial success, failure, cancellation, and interruption.
Old completed details are automatically discarded as new operations complete; reaching 10000 does not stop new admissions.
Before removing full details, the server durably writes a compact retry receipt containing the operation ID, historical owner, operation kind, original key, and request fingerprint. Receipts contain no result payload and have no automatic expiry. An expired matching retry returns 410 idempotency_expired without execution; a changed kind/body still conflicts. Protection survives normal restarts and compaction interrupted between writes.
Existing histories migrate automatically. Unfinished work becomes interrupted on restart before compaction and is never replayed automatically. /capabilities reports this policy under operationRetention.
Store results you need for long-term reporting in your application. There is no public archive/delete endpoint or extra operator setting. Full-detail storage is limited by completed-record count, not by bytes, and compact receipts continue consuming disk space as distinct operations accumulate.
Do not delete or partially restore the API state files to recover capacity: that can destroy retry protection. Keep full operation state and retry receipts together in backups.
Correlate dispatch, run, and capture results
Direct actions use the operation ID as their request ID and return it in action results. Timeline operations return runId; the timeline uses an explicit document/step request ID when supplied, otherwise timeline-<runId>. Event-triggered timeline operations include event/timeline IDs.
Setting results include per-camera outcomes and requested/applied/failed counts. Trigger and autofocus do not promise equivalent outcome arrays. A capture request ID can appear in exposure and processing events, but not every catalogued event includes it.
Use operationId, runId, requestId, eventScriptId, and dataset names only where the response actually supplies them. Do not assume every event has every correlation field.
Safe in-flight completion
API entitlement and public action policy are rechecked before future effects, but a command already sent to a node may finish after cancellation or license loss. There is no cross-camera rollback. Warmup-trigger has explicit aborted-phase cleanup for its pinned prepared cameras; that cleanup records its own failures separately.
POST /runs/{id}/abort also covers shared API managed operations, with a new idempotency key. Any permitted API client can request an abort. Cancellation is best effort for already dispatched or scheduled commands. Inspect the original operation; an abort admission does not promise physical recall or file readiness.
Restart marks unfinished durable operations interrupted with server_restarted. Camera Server never automatically repeats an uncertain physical action after restart.