REST API

Errors

All errors return a consistent JSON envelope and an appropriate HTTP status. Use code for branching, message for humans.

Envelope

json
{
  "error": {
    "code": "string_error_code",
    "message": "Human-readable description."
  }
}

Common codes

StatusCodeMeaning
400invalid_requestValidation failed. Body or params are malformed.
400invalid_sourceA URL passed as content source is unreachable or invalid.
401missing_api_keyNo API key provided.
401invalid_api_keyAPI key format invalid, not found, or revoked.
403insufficient_scopeKey is valid but doesn't carry the required scope.
404not_foundResource doesn't exist (or you don't have access to it).
413payload_too_largeRequest body exceeded the limit (~128 KB).
415unsupported_media_typeContent-Type wasn't application/json.
429rate_limitedHit the per-minute or per-day cap. Honor Retry-After.
500internal_errorServer failure. Retry idempotently or contact support.
502generation_failedContent generation failed downstream. Retryable.
502publish_failedPublishing to the CDN failed. Retryable.
502delete_failedRemoving content from the CDN failed. Retryable.

Idempotency

GET and DELETE are idempotent. POST and PATCH are not — retry only for 5xx and 429, never for 4xx (other than 429).

Validation messages

For 400 invalid_request, the message field will name the offending field, e.g.:

json
{ "error": { "code": "invalid_request", "message": "title must be 120 characters or fewer." } }

Don't pattern-match on message — it may be revised. Branch on code.