Docs

Errors

Codes, body shape and what to do about each.

Every error is built to get you unblocked, not just to name the problem: { code, message, hint?, issues? } — the hint says exactly how to fix it, and issues points at the offending field.

HTTPcodeCommon cause
401unauthenticatedMissing API key, malformed, revoked, or the prefix disagrees with the stored type/mode.
403forbiddenpk_ key on an sk_ endpoint, Origin not allowed, or insufficient role.
401key_expiredThe key passed its expiry date. Create or rotate one.
403secret_key_requiredA pk_ key tried to record a consent with source IMPORT or MIGRATION. Call it from your server with an sk_ key.
403insufficient_scopeThe secret key is restricted to other scopes. See Console → Sites & API keys.
403ip_not_allowedThe secret key has an IP allowlist and this request came from elsewhere.
403origin_not_verifiedLIVE pk_ key, Origin on a domain that is not verified yet.
404not_foundThe subject/resource does not exist (read endpoints do not create subjects).
409idempotency_key_reused_with_different_bodySame Idempotency-Key, different body.
422validation_failedThe body fails the Zod schema — see issues.
429rate_limitedSlow down; respect Retry-After.