Errors
The problem format of every error answer, its codes and the status codes.
Every error answer has the same form: Content-Type: application/problem+json (RFC 9457) with these fields:
| Field | Meaning |
|---|---|
type | Always about:blank. |
title | The HTTP status text, for example Not Found. |
status | The HTTP status. |
detail | What went wrong, in English. |
instance | The request path. |
code | A stable code to branch on, for example VALIDATION_ERROR, BAD_REQUEST, API_KEY_REQUIRED, INVALID_API_KEY, API_KEY_IP_NOT_ALLOWED, API_KEY_PERMISSION_DENIED, API_KEY_SCOPE_OUTSIDE_CONTRACT, NOT_FOUND, ROUTE_NOT_FOUND, MOVED_PERMANENTLY, RATE_LIMITED, CREDIT_LIMIT_EXCEEDED, BILLING_UNAVAILABLE, INTERNAL_ERROR. Branch on code, never on detail. |
errors | For VALIDATION_ERROR: one entry per problem, { "path", "message", "code" }, where path starts with the request part (query.limit). |
requestId | The id of this request; the same value is in the X-Request-Id header. |
retryAfterSeconds | On a 429 with Retry-After: the same number of seconds. |
An error body has no other fields.
A validation error, for GET /events?limit=500:
{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Request validation failed",
"instance": "/api/v1/events",
"code": "VALIDATION_ERROR",
"errors": [
{ "path": "query.limit", "message": "Number must be less than or equal to 100", "code": "too_big" }
],
"requestId": "0c6a3c1d-8f2b-4d51-a7e9-2b5f6d4c3e10"
}A record that does not exist or lies outside your scope:
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "Not found",
"instance": "/api/v1/events/0b6c2f0e-5a7e-4d3b-9a51-2f0c1d7e4a10",
"code": "NOT_FOUND",
"requestId": "9a1e7b44-2c0d-4f63-8e15-7d3b6a2c9f01"
}| Status | When |
|---|---|
301 | The record was merged (Stable ids and merged records); code: "MOVED_PERMANENTLY", free of charge. |
304 | Not modified (Caching with ETag). |
400 | A malformed or unknown parameter (VALIDATION_ERROR) or a combination that is not allowed, such as sort=ranking with a cursor (BAD_REQUEST). |
401 | No key or a key that does not start with sk_org_ (API_KEY_REQUIRED), or a key that is unknown, disabled, expired or without active contract (INVALID_API_KEY). |
403 | Key used from an IP address it does not allow (API_KEY_IP_NOT_ALLOWED) or for an endpoint it does not permit (API_KEY_PERMISSION_DENIED); or a key whose own limits lie outside the contract (API_KEY_SCOPE_OUTSIDE_CONTRACT, Scope: what a key may read). |
404 | Record not found or outside your scope (NOT_FOUND); or a path that does not exist (ROUTE_NOT_FOUND). |
429 | Rate limit (RATE_LIMITED) or monthly credits (CREDIT_LIMIT_EXCEEDED) exceeded (Credits). |
500 | An error on our side (INTERNAL_ERROR). The body does not explain it; quote the requestId when you contact us. |
503 | Usage counting briefly unavailable (BILLING_UNAVAILABLE); retry after Retry-After. |
Request ids. Every answer, successful or not, carries X-Request-Id. You can send your own X-Request-Id (letters, digits, -, _, =, up to 128 characters); the API then uses yours, which makes your logs and ours line up. Quote it when you report a problem.