Docs

Errors

Every error has an HTTP status, a stable code to branch on, and a message to show.

JSON
{
  "error": "Validation failed",
  "code": "bad_request",
  "details": ["urlPattern: Enter a URL pattern", "steps.2.title: Required"]
}
FieldMeaning
errorA readable message. It can change; don't parse it.
codeA stable code to branch on.
detailsOptional. One line per problem, for validation errors.

Some errors add fields, like retryAfter on 429 or usage on segment_in_use.

Common codes

StatusCodeWhat happened
400bad_requestThe request is malformed or didn't validate: invalid JSON, a bad id, a missing or wrong field. For validation errors, details says what to fix.
400validation_failedThe same, from a few endpoints that validate later. details says what to fix.
401unauthorizedNo key, or the key is invalid or revoked.
402plan_limitYour plan's limit is reached: the number of live items of a type, or AI features outside the Pro plan. The response has a message and an upgrade_url.
403forbiddenThe key's owner doesn't have the permission this needs.
403self_approvalYou can't approve your own review request.
404not_foundIt doesn't exist, or it's in another workspace.
409conflictIt clashes with the current state, for example a duplicate.
409approval_requiredThe workspace requires review before publishing to production. Send a review request with POST /{type}/{id}/publish-requests.
409segment_name_taken, segment_in_useA segment name is used, or the segment is still targeted by content.
413payload_too_largeThe body is too big.
415unsupported_media_typeSend the body as application/json.
429rate_limitedToo many requests. Wait for Retry-After seconds. See Rate limits.
500internalSomething went wrong on our side. Retry later.
503unavailable (and similar)A service this needs isn't available right now.

Handling them

  • Branch on code, not on error.
  • Retry 429 after Retry-After, and 500/503 with backoff. Don't retry other 4xx: fix the request.
  • PATCH requests send the whole list when you change steps, items or questions: read the item first, then send every entry back (keeping their ids).

On this page