Skip to main content
The Qoder Cloud Agents API returns errors in a consistent envelope. Each error response carries structured fields suitable for programmatic handling and debugging.

Error envelope

All error responses follow this JSON structure:

Field descriptions

Error types

Error type details

400 — invalid_request_error

The request format or parameters are invalid. Common triggers:
  • Missing required field (for example, name)
  • Field type mismatch (such as a number where a string is expected)
  • Body exceeds the 4 MB limit
  • Malformed JSON

401 — authentication_error

Authentication failed. Common triggers:
  • Missing Authorization header
  • Malformed PAT
  • PAT expired or revoked
  • x-api-key used instead of a bearer token

403 — permission_error

Authenticated but not authorized. Common triggers:
  • The PAT does not have access to the target Agent (different user or organization)
  • The PAT scopes do not cover this operation
  • Attempting to operate on an archived and locked resource

404 — not_found_error

The target resource does not exist. Common triggers:
  • Agent, Session, or Environment ID does not exist
  • The resource is no longer available
  • URL path typo

409 — conflict_error

Resource state conflict prevents the operation. Common triggers:
  • Same idempotency key reused with a different request body
  • Operating on a terminated Session
  • Creating a duplicate uniquely-named resource

500 — api_error

Internal server error. Common triggers:
  • Service temporarily unavailable
  • Internal component failure
  • Database connection timeout
For 500 errors, retry with exponential backoff (for example, 1s → 2s → 4s).

Error handling best practices

  1. Branch on error.type rather than the HTTP status code.
  2. Log request_id and error.message for diagnostics.
  3. Inspect error.param when present to locate the offending field.
  4. Do not retry 4xx errors unless the request was modified.
  5. Retry 5xx errors with exponential backoff (up to 3 attempts).

Next steps

Overview

How Qoder Cloud Agents fits together.