Skip to documentation content
CookieBeam

Errors and rate limits

Error codes, HTTP statuses, request ids, rate-limit tiers, body limits and retry guidance for the CookieBeam REST API.

Last updated:

Error envelope

Errors use the same envelope as successful responses. The data object carries a human-readable error message, a machine-readable code, an optional details value, and the requestId of the call:

{
 "data": {
 "error": "API key is missing required scope(s): banners:write",
 "code": "missing_scope",
 "requestId": "9b2e5f0c-8d7a-4e0b-9c1d-2f3a4b5c6d7e"
 },
 "version": "v1"
}

Match on code; the wording of error may change. Some endpoints add their own fields next to code: a consent state conflict returns current, a form consent quota refusal returns resetAt, and an unsupported version returns supportedVersions.

Validation errors

A request that fails validation returns HTTP 400 invalid_request. On most endpoints details.issues lists each problem with the path of the field:

{
 "data": {
 "error": "Invalid request data",
 "code": "invalid_request",
 "details": {
 "issues": [
 { "path": "subject.value", "message": "Invalid input: expected string, received undefined", "code": "invalid_type" }
 ]
 },
 "requestId": "9b2e5f0c-8d7a-4e0b-9c1d-2f3a4b5c6d7e"
 },
 "version": "v1"
}

A few older endpoints keep the shape their first clients parse: POST /api/v1/consent/log returns details as an array of { "field", "message" }, and POST /api/v1/banners returns the list of validation issues itself as details, each with a message and usually a path. On the banner design endpoints, paths start with params. or body. to say where the field was. Path and query parameters elsewhere are prefixed with params. or query..

Request ids

Every /api/v1 response carries an X-Request-Id header, and every error repeats it as data.requestId. Send your own X-Request-Id (a UUID) to correlate a call with your logs; any other value is ignored and a new id is generated. Quote the id when you contact support.

Machine-readable description

The OpenAPI 3.1 document at /api/v1/openapi.json is generated from the same contracts the endpoints validate against. It lists every operation with its scopes, request and response schemas, and the error codes each status can carry.

Error codes

HTTP statusCodeMeaning
400invalid_requestThe body, query or path failed validation, the JSON is malformed, or a pagination cursor is invalid
400unsupported_versionThe requested API version is not supported; supportedVersions lists the ones that are
401invalid_keyThe API key is malformed, unknown, or has the wrong environment prefix
401revoked_keyThe API key has been revoked, or its team was deleted
401expired_keyThe API key has expired
401unauthorizedThe endpoint requires an API key and none was sent
401invalid_token/api/mcp only: a sign-in (OAuth) access token was sent but is invalid, expired or revoked. The response carries WWW-Authenticate: Bearer with error="invalid_token" and the resource_metadata URL, so the assistant can ask you to sign in again
403plan_requiredThe team's plan does not include the feature, or a plan limit was reached. On banner design endpoints details.feature names the feature
403feature_unavailableThe account does not include the capability (for example publishing the cookie policy). Nothing was changed
403plan_limitA limit of the account stops the call and nothing was changed: the scan quota for the period is used up (details.resetsAt says when it resets), the account's billing does not allow the change, the account cannot add another site, or adding the site would change the subscription (MCP create_banner; add the site from the dashboard instead)
403missing_scopeThe key lacks a required scope; the message names it
403test_key_read_onlyA test key was used for a write, publish, erase or admin operation
403test_key_production_forbiddenA test key was used for a banner design operation that test keys may not run
403key_owner_inactiveBanner design endpoints: the member who created the key is no longer an active member of the team
403insufficient_permissionThe member who created the key (banner design endpoints), or the signed-in user (dashboard sessions), lacks the permission the operation needs. details names the required and held levels
403key_restrictedA key restricted to specific banners was used to create a banner, to record a form consent proof without one of its banners, or to erase form consent proofs. Also returned, with details.environment: "production", when a call that changes what runs in production (publishing, deleting a banner, turning it on or off, creating one through MCP, publishing the cookie policy) uses a key whose environment allow-list leaves production out
403publishable_key_not_allowedA publishable cb_pub_ key was sent to an operation that needs a secret key
403origin_not_allowedThe request's Origin is not one of the publishable key's allowed origins
403two_factor_requiredDashboard sessions only: the team requires two-factor authentication and the session has not completed it
403email_verification_requiredDashboard sessions only: the signed-in user has not verified their e-mail address
404not_foundThe resource does not exist, belongs to another team, is inactive, or is outside the key's banner restriction
405method_not_allowedThe path exists but not for this HTTP method
409version_conflictA consent state write carried a stale baseVersion; the response includes current
409conflictThe write conflicts with the current state. On a versioned write, details.currentEtag is the version to re-read and retry with. On a publish, details.reason is lock_busy or pointer_changed: this call did not publish, but another publish of the banner may have, so preview again before retrying. Starting a scan while one runs for the banner returns details.scanId
409confirmation_staleThe publish confirmation no longer matches the draft, the live version or the account's features, or this publish already went through. Nothing was published; preview again and use the new confirmation
409resource_lockedThe resource is locked by another feature, for example a theme used by an active A/B test. details says by what
409idempotency_in_progressA request with the same Idempotency-Key is still running; retry after Retry-After seconds
413payload_too_largeThe request body is larger than the endpoint accepts (see Body limits)
413invalid_requestThe body exceeded 20,000 bytes on a cross-device consent subject endpoint
422idempotency_key_reusedThe Idempotency-Key was already used with a different request
428precondition_requiredA versioned write was sent without If-Match
429rate_limitedA rate limit was exhausted; see below
429quota_exceededThe plan's monthly form consent quota is used up; resetAt says when it resets. Nothing was stored
500internal_errorUnexpected server error. The message is masked; quote requestId
503identity_unavailableSubject identity hashing is temporarily unavailable; retry later
503session_unavailableDashboard sessions only: session verification is temporarily unavailable
503service_unavailableA dependency is temporarily unavailable, or a short-lived lock is held (for example another scan for the team is being started). Retry after Retry-After seconds when it is sent

Rate limits for API keys

API-key requests are limited per key over a fixed 15-minute window. The limit depends on the team's plan:

PlanRequests per 15 minutes
Free50
Starter200
Professional500
Business2,000
Enterprise5,000

A plan the server cannot map to a tier falls back to the Free limit.

Responses that pass key authentication and reach the rate limiter carry these headers:

  • X-RateLimit-Limit — the key's limit for the window.
  • X-RateLimit-Remaining — requests left in the current window.
  • X-RateLimit-Reset — when the window resets, as a Unix timestamp in milliseconds.
  • RateLimit — the same state as an IETF structured field: "default";r=<remaining>;t=<seconds until reset>.
  • RateLimit-Policy — the quota and window: "default";q=<limit>;w=<window seconds>.

This includes HTTP 429 rejections. It does not include requests rejected before rate limiting runs — entitlement, scope, and test-key failures (and malformed, revoked, or expired keys) return without these headers — and some server-error paths also skip them. Treat the headers as present on rate-limiter outcomes, not as a universal invariant.

When the limit is exhausted the API returns HTTP 429:

{
 "data": {
 "error": "Rate limit exceeded",
 "code": "rate_limited",
 "requestId": "9b2e5f0c-8d7a-4e0b-9c1d-2f3a4b5c6d7e"
 },
 "version": "v1"
}

The response includes a Retry-After header with the number of seconds to wait before the next request.

Extra limits on banner design operations

The banner design endpoints count against the per-key limit above, and two kinds of operation have a second limit of their own:

  • Writes (theme and design changes, logo uploads, preset and proposal applies): 120 per minute per key.
  • Operations that fetch from the internet or run a style match (logo import from a URL, site capture, style match and refine): 20 per hour per banner.
  • Publishing (publishing a banner, and creating a banner through MCP, which publishes its first version): 10 per 15 minutes per key, counted together.
  • Starting a scan: 5 per 15 minutes per key.

Past either limit the call returns HTTP 429 rate_limited with Retry-After and details.retryAfter / details.limit.

Other rate limits

These limits apply independently of the per-key tiers:

  • Requests to the banner endpoints that arrive without an API key (dashboard sessions and other browser traffic) are limited to 100 requests per 15 minutes per client IP.
  • Publishable keys: 600 requests per minute per key, and 30 requests per minute per key from one client IP.
  • POST /api/consent/log (the unversioned banner ingestion route) is limited to 1,000 requests per minute per client IP.
  • GET /api/v1/mobile/config is limited per client IP, like the CDN script routes.
  • Failed authentication attempts are limited to 10 per minute per client IP; beyond that, further attempts return HTTP 429 with rate_limited and a Retry-After header.

Changes

November 2026:

  • New codes: plan_limit (403), confirmation_stale (409), feature_unavailable (403) and, on /api/mcp, invalid_token (401).
  • conflict (409) on a publish now carries details.reason (lock_busy or pointer_changed), and key_restricted (403) is also returned with details.environment for calls that change what runs in production.
  • Plan-related refusal messages on the banner endpoints under /api/v1/banners/{bannerId}/ (design, publish, scanning, settings and policy) were reworded so they read well inside an AI assistant: they say what the account doesn't include and point to the dashboard, without naming plans or prices. The codes and details are unchanged; match on code, not on the message.
  • Publishing and starting a scan have their own per-key limits (see Extra limits).

Body limits

EndpointLargest body
Most endpoints64 KB
POST /api/v1/consent/log64,000 characters
Cross-device consent subject endpoints20,000 bytes (413 invalid_request)
POST /api/v1/banners/{bannerId}/design/logo/upload512 KB
POST /api/mcp4 MiB, at most 4 JSON-RPC messages per batch

Retry guidance

  • On HTTP 429, wait at least the number of seconds in Retry-After before retrying. Do not retry in a tight loop — repeated bursts just consume the next window.
  • On HTTP 5xx, retry with exponential backoff.
  • Reads (GET, and the POST lookups that keep identifiers out of URLs) are safe to retry as-is.
  • For writes, send an Idempotency-Key where the endpoint accepts one, and reuse it on the retry.
  • For consent state writes, retry a 409 version_conflict by re-reading the subject, merging against the returned current snapshot, and writing again with the new version as baseVersion.
  • For banner design writes, retry a 409 conflict by reading the resource again, re-applying your change, and sending the new ETag as If-Match.

AltStyle によって変換されたページ (->オリジナル) /