Aller au contenu principal
Version: Plateforme actuelle

Errors and Rate Limits

Most /api/v1 endpoints use a common JSON envelope.

Success envelope​

{
"success": true,
"data": {},
"meta": {
"timestamp": "2026-07-11T20:00:00.000Z",
"request_id": "R8k2example"
}
}

Error envelope​

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": {
"session_id": ["Session ID is required"]
}
},
"meta": {
"timestamp": "2026-07-11T20:00:00.000Z",
"request_id": "R8k2example"
}
}

Standard codes​

HTTPCodeMeaningAction
400VALIDATION_ERROR, BAD_REQUESTJSON, query, or domain validation failed.Fix the request; do not retry unchanged.
401UNAUTHORIZEDCredential missing, invalid, expired, or not permitted for the public subject.Refresh the ID token, runtime token, or secret key.
403FORBIDDENAuthenticated actor lacks ownership, role, or action permission.Request access; do not retry unchanged.
404NOT_FOUNDResource does not exist in the authenticated scope.Check the ID and workspace.
409CONFLICTResource or lifecycle state conflicts with the requested operation.Refresh state and decide whether to retry.
429RATE_LIMIT_EXCEEDEDKey or merchant request budget is exhausted.Wait until reset, then retry with jitter.
500INTERNAL_ERRORServer or dependency failure.Retry idempotent requests with exponential backoff; escalate with request_id.
503SERVICE_UNAVAILABLEA dependency is temporarily unavailable.Retry with exponential backoff.

Rate-limit headers​

Rate-limited API-key endpoints can return:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 742
X-RateLimit-Reset: 1783803600

The key record stores an hourly request limit. A newly created secret key currently defaults to 1,000 requests per hour; plan, deployment, or key configuration can differ, so treat the response headers as authoritative.

Browser traffic that uses runtime tokens has a separate limit of 100 events per minute for each visitor IP address and site. It can be lowered temporarily during an incident.

For event batches, one request is rate-checked and the remaining allowance must also accommodate the number of events in that batch.

Retry policy​

  • Retry network failures, 429, and 5xx only.
  • Respect X-RateLimit-Reset for 429.
  • Use exponential backoff with jitter and a maximum attempt count.
  • Reuse a stable client_event_id for event retries.
  • Do not automatically retry non-idempotent management writes unless the endpoint documents an idempotency contract.

Partial success​

POST /events/batch can return 207 with top-level success: true. Inspect data.failed and every data.results[] item. The browser SDK requeues failed event items.

Diagnostics to preserve​

When escalating, include the path, method, UTC timestamp, HTTP status, response request_id, safe key prefix, and redacted error body. Never include the full API key or bearer token.