Errors

Every error is actionable.

All 4xx/5xx responses use one envelope. There are no bare 403s.

json
{
  "error": "forbidden",
  "message": "This API key is missing the 'analysis_tab' permission.",
  "userMessage": "This API key is not scoped for 'analysis_tab', which this endpoint requires.",
  "suggestedAction": "Ask an org owner/admin to add 'analysis_tab' to the key's scope…",
  "isRetryable": false,
  "request_id": "req_8f2a1c9d4e5b6a7c8d9e0f12"
}

The fields

FieldUse it for
errorA stable, machine-readable code to branch on.
userMessageText safe to show an end user.
suggestedActionWhat to do to fix it.
isRetryableWhether retrying the same request may succeed.
request_idQuote this in a support request (also in the request-id header).

Common cases

StatuserrorWhen
400bad_request / missing_idempotency_keyMalformed body, or a write with no Idempotency-Key.
401unauthorized / key_revokedNo valid key, or the key was revoked (states when).
403forbidden / project_scope_forbiddenThe key lacks the permission, or isn't scoped to the project.
404not_foundThe resource isn't visible to this key's org.
409idempotency_in_progressA same-key request is still being processed.
413body_too_largeInline file too large — use the large-file flow.
422idempotency_conflictSame Idempotency-Key, different body.
429rate_limitedToo many requests — respect Retry-After.