surface

Errors, retries and version conflicts.

Read structured API errors, recover uncertain requests with stable idempotency keys, reconcile version conflicts, and avoid duplicating side effects or spend.

Written for
Developers implementing robust API error and retry handling.
You need
Any plan for REST API access
Interactive API reference Explore endpoints, request schemas and responses. Opens in a new tab

Treat a failed response as evidence about one request, not proof that no work happened. Keep the operation identity, request body, version, logical retry key, and any returned run or task ID.

Choose recovery from the actual error

Distinguish correcting a request, reconciling state and waiting.

For a stale project version, reread and reconcile the document. For a mutation in progress, replay the same keyed write or wait and reread its version; there is no REST operation lookup. Preserve local work and request identity for unresolved or unavailable outcomes. Where automaticRetryAllowed is false, the error is not permission to resubmit automatically. The rest of this guide also covers validation and other failures.

Read the structured error

Public errors use {error:{code,message,details,requestId?}}. Branch on the code and operation state; do not scrape human-readable message text. Public request validation normally uses HTTP 400 VALIDATION_ERROR; upload-integrity completion can use its documented 422 response.

Status Investigate
401 Missing, expired, revoked or invalid credential
403 Scope, capability, origin or resource authority
404 Missing or unavailable/not-owned resource
409 Stale version, conflicting key/body, or request still in progress
413 Request or upload size
429 Rate limit; honor Retry-After when present
503 Unavailable prerequisite such as shared limiting or execution service

A 403 FORBIDDEN with details.capability: "public_rest_api" means the account has REST access disabled. See Plans. For rate limits, use Retry-After, or error.details.retryAfterSeconds in browser code where CORS does not expose that header.

Storage and transfer operations can have additional documented codes. An authorization refusal is not fixed by submitting the same paid work under a new key.

Retry the same logical operation

On routes supporting idempotency, use the same authenticated API-key identity, route, key, and unchanged request body for the same logical retry. Keep a key generated once, rather than generating one inside every repeated curl call. Different content is a different logical operation and conflicts with reuse of the old key.

Completed-key retention is bounded, currently seven days. Protected unresolved project-effect claims do not expire into permission to repeat the write. Waiting for expiry, canceling, or minting a new key is not recovery authority. Other idempotency behavior is route-specific. If a run submission's response and ID were lost, resend its exact body with the same key and authenticated API key. A completed replay returns the original 202 and run ID for seven days; IDEMPOTENCY_REQUEST_IN_PROGRESS means wait and resend. Without the key, REST has no run list or search to recover the ID. Always send a key. Once the ID is known, read the run before deciding what to do.

Recover a guarded project save

Read the exact code as well as the HTTP status:

Code Next action
PROJECT_VERSION_CONFLICT (409) Read the current document, compare changes and reconcile.
PROJECT_MUTATION_IN_PROGRESS (409) Preserve local work. Replay the unchanged keyed write, or wait and reread the document version before reconciling. There is no operation-lookup endpoint.
PROJECT_MUTATION_UNRESOLVED (409) Preserve work; inspect the original outcome or deliberately save a separate copy.
PROJECT_SAVE_UNAVAILABLE or PROJECT_STATE_UNAVAILABLE (503) Preserve local work and inspect the guarded state; do not automatically resubmit.

The latter three cases carry details.automaticRetryAllowed:false. They are different from an ordinary stale version. Do not repeatedly reload, discard local edits, or submit the same uncertain write under new keys to get past them.

Reconcile a version conflict

Fetch the current document, inspect intervening changes, and rebuild the intended update against that state. Do not attach a current expectedVersion to an old full replacement body. A response failure can occur after persistence; inspect the resource before assuming all earlier writes rolled back.

Keep side effects and accounting visible

Cancellation is a separate request and does not promise a refund or reversal of external effects. Back off according to response guidance when retrying temporary failures. Keep real credentials and private payloads out of logs; retain sanitized request IDs and error details for support.

See Runs, Files, and Projects for operation-specific recovery.

Common API codes

Code Action
VALIDATION_ERROR Correct the reported field issues; do not retry unchanged.
ORIGIN_NOT_ALLOWED Use the correct key type and exact registered origin. Server keys reject browser Origin headers.
IDEMPOTENCY_KEY_CONFLICT That key already identifies different content. Reconcile the first operation before a genuinely new submission.
IDEMPOTENCY_REQUEST_IN_PROGRESS Wait, then resend the same request and key.
IDEMPOTENCY_RESULT_UNAVAILABLE Preserve the key and response details; do not create a duplicate to bypass unavailable replay state.
RUN_ALREADY_TERMINAL Cancellation arrived after completion; read the final run.
PROJECT_VERSION_CONFLICT Read and reconcile the document before another guarded write.
INSUFFICIENT_SCOPE Compare details.required and granted; use the intended scoped key.
FORBIDDEN, CAPABILITY_REQUIRED Check the named plan capability and role.
RATE_LIMITED Honor retryAfterSeconds; limit requests across keys sharing one IP.
RATE_LIMIT_UNAVAILABLE Shared limiting is unavailable; wait rather than bypassing it.
BILLING_DISABLED Billing/execution is unavailable; preserve the intended operation.
RUN_NOT_FOUND Verify the retained ID and owner; REST does not search for lost IDs.
RUN_DISPATCH_FAILED Read details.runId: an accepted run was marked failed during dispatch. Inspect it before another submission.
RUN_NOT_SAVED_PROJECT, RUN_NOT_SUCCEEDED, RUN_HAS_NO_OUTPUTS The run cannot apply outputs to a project in its current form/state.
PROJECT_CHANGED_SINCE_RUN Reconcile the current project before applying older outputs.
PERSIST_INPUT_OVERRIDES_UNSUPPORTED Keep overrides transient or edit the graph document separately.
INVALID_CURSOR Restart observation using the correct run and owner.
NODE_TYPE_NOT_FOUND Rediscover the current node type and its availability.
UPLOAD_* Inspect the specific code: expired/aborted sessions use 410; size/checksum/ETag mismatches use 422.

Idempotency covers run submission, apply-to-project, file creation/upload reservation, owner template runs, project creation, graph document PUT/PATCH, and storyboard/timeline PUT. It does not cover run cancellation, metadata PATCH or project DELETE. Upload completion is repeatable by upload ID. Keys are scoped to the authenticated API key; rotating a key does not recover its predecessor's replay. Completed replay retention is seven days; pending reservations have a ten-minute timeout, which does not authorize repeating uncertain project effects under new keys.

Last reviewed against Kaitoi on 26 October 2026. View this page as Markdown

Type at least two characters.