code to branch programmatically and the errors object to surface field-level problems to users.
The error envelope
When a request fails, the body is a singleerror object:
parameter_missing
HTTP 400. A required field is absent. Check param for which one.
param.
parameter_unknown
HTTP 400. The body is wrapped in a resource key; param names it — see Conventions.
authentication_required
HTTP 401. The token is missing, malformed, or revoked.
Authorization: Bearer YOUR_API_TOKEN. Confirm the token wasn’t deleted in Settings → Developer, and that you didn’t leak a trailing newline into the env var.
account_forbidden
HTTP 403. The credential is valid, but the person behind it is not an admin of the account it acts on. Members of an account, such as customers who bought from it, cannot use its API. An API key also gets this once its creator is removed from the account or loses the admin role.
Fix: authenticate as an admin of the account. For an API key, have a current admin create a new one.
insufficient_scope
HTTP 403. The OAuth token’s scope does not allow the request. A read_only token can only make GET requests, and no OAuth token can create API keys.
Fix: send the user through authorization again and request the read_write scope. Create API keys in Settings → Developer.
plan_required
HTTP 402. The request was valid, but the account’s plan doesn’t include what it asks for — for example, turning off a site’s referral badge below the Business plan, or creating a site past the plan’s site limit. param names the field when one field is responsible. Nothing in the request is applied.
resource_missing
HTTP 404. The resource doesn’t exist for your account.
prod_…/cus_…/etc., not a raw database id) and that it belongs to your account.
validation_failed
HTTP 422. The request was well-formed but the data is invalid. Field errors are listed in errors.
422 is publishing a product with no price variant (status: "active" on a product with zero prices). See creation order.
Fix: map each key in errors to a form field and show the message inline.
rate_limit_exceeded
HTTP 429. You’ve exceeded the rate limit (600 requests per 60-second window, per credential).
X-RateLimit-Reset header to time your retry. The @crevio/sdk retries with exponential backoff automatically. See Rate limits for the headers and recommended backoff strategy.
resource_busy
HTTP 409, type api_error. Another request was changing the same resource at the same moment, and this one was rolled back so the two could not corrupt each other. It happens when many calls write to one resource in parallel, such as attaching several files to the same experience at once.
Retry-After header’s delay. Nothing from the failed attempt was saved. To avoid it, send writes to one resource one after another, or batch them into a single call (for example, one file_ids array instead of one call per file).
Server errors
HTTP500, type api_error. An unexpected server error. There is no code and no doc_url — nothing about the request is yours to fix.
x-request-id header from the response.
Handling errors in the SDK
The SDK throws typed errors with astatusCode you can branch on:
Next steps
Conventions
Most errors trace back to a broken convention.
Quickstart
A clean, error-free first integration.
API reference
Per-endpoint required params and constraints.
Usage & billing
Check credits before calls fail for balance reasons.

