Skip to main content
llms.txt

API authentication, responses and errors

Use API key headers, understand scopes and response envelopes, and handle validation, authorization and rate-limit errors.

Send the key in a header

Use one of these headers for authenticated requests:

X-API-Key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY

Send exactly one credential header. Private job, space and connection routes reject URL credentials, even alongside a valid header. Store keys on the server.

Permissions and key types

ScopeUse
readRead resources covered by the API.
writeRead and write resources; includes read access.
jobs:readRead job listings.
jobs:draft, jobs:publish, jobs:edit, jobs:lifecycleSave drafts, publish or repost, edit, or unpublish respectively. Older jobs:write grants retain supported job actions.
spaces:readRead space endpoints.
cities:readRead city lookups; broad read also covers this.
events:readRead event endpoints.

cwk_rstr_ keys are read-only; cwk_live_ keys allow the configured write permissions. A prefix is not a permission grant by itself. The key’s configured scopes and space restrictions still apply. A job-write scope alone does not grant every read scope; choose the permissions needed for both setup and writing.

Response format

Success responses contain success, status and data. The shape of data depends on the endpoint: jobs use data.jobs, while cities and spaces return arrays.

{
  "success": false,
  "status": 422,
  "error": {
    "code": "validation_error",
    "message": "Validation failed",
    "details": ["Job title is required"]
  }
}

error.details is not always an array. For rate limits and permission errors it can be an object. Check its type before iterating. Handle network errors and non-JSON responses as well as API errors.

Fix common errors

HTTP statusAction
400Check JSON syntax and the request format.
401Check the key, expiry, revoked status and any IP restrictions.
403Check the required scope and whether the job belongs to the key’s space.
404Check the endpoint or resource identifier. Removed v1 paths can return this status; use API v2.
405Use the endpoint’s supported HTTP method.
409Inspect the error code. For job_exists, read the existing job. For a stale revision, read again before confirming a change.
410api_version_retired: migrate the request to API v2. Retrying the same v1 request or rotating its key will not restore access. See v1 retirement and migration.
422Correct the fields listed in error.details.
429Wait for error.details.retry_after_seconds, then retry with backoff and jitter.
500Retry cautiously; include context in a support report without sharing secrets.

Job write operations are rate-limited per key. The reference gives a fallback of 120 writes per minute, but a key’s configured limit takes precedence. Use the returned limit and retry delay rather than assuming a quota.

Reuse the same Idempotency-Key and body for an exact retry. Ordinary cached receipts last up to 24 hours and can be unavailable. Check the owned job after an uncertain result before retrying. See Jobs API.