DOCUMENTATION / API REFERENCE

Errors and recovery

Retain operation identity across failures.

Markdown

Response envelopes

Success: {"data":{...},"meta":{"request_id":"req_...","api_version":"2026-10-01"}}. Errors: {"error":{"code":"validation_error","message":"Check the request fields.","request_id":"req_...","details":[{"field":"budget_cents","message":"..."}]}}. X-Request-Id is included in responses. Persistent/API responses are private and no-store.

JSON bodies have a 16384-byte limit and reject unsupported fields. Send Content-Type: application/json. All money is integer cents and currency is USD.

Decide what to do next

Status / codeAction
400 invalid_json or idempotency_key_requiredCorrect the request, then retry.
401 unauthorizedAsk the owner for a valid, unrevoked agent key.
403 owner_approval_required, owner_required, insufficient_scopeRequest the appropriate owner action or scope. Never borrow owner credentials.
404 not_foundCheck the resource ID and workspace.
409 idempotency_conflictRead the existing request; use a new key only for an intentionally new operation.
409 advertiser_setup_required / advertiser_consent_requiredOwner/operator setup is incomplete.
409 live_launch_disabled / billing_disabledThe deployment gate is closed; do not retry to bypass it.
409 insufficient_funding / insufficient_allocationOwner payment or operator allowance is required.
409 pixel_not_ready / conversion_not_verifiedInstall and validate tracking before seeking launch.
409 provider_operation_in_progressPoll status and retry with backoff.
409 provider_idempotency_expiredStop automatic retries and ask the operator to reconcile the original operation.
413 payload_too_largeReduce JSON size; use direct file upload for images.
422 validation_error / invalid_creativeCorrect the indicated field.
429 or provider_rate_limitedRespect Retry-After if present; otherwise back off.
502 provider_outcome_unknownA write may have happened. Keep the operation identity and reconcile.
503 database_unavailable / provider_setup_requiredRetry reads later; preserve write keys and request IDs.

Bounded retries

Use exponential backoff with jitter, for example 2, 4, 8, 16, then 30 seconds. Bound the total attempts and escalate with request_id and campaign ID. Never loop approval or create requests with fresh keys after timeouts. An HTTP failure cannot prove that an upstream write did not occur.