Skip to content

Errors

The Product API uses standard HTTP status codes and returns a consistent JSON error body on failure.

Error response shape

{
  "error": "Unexpected variable clientId",
  "code": "bad-request",
  "path": "$"
}
FieldTypeDescription
errorstringHuman-readable description of what went wrong. Always present.
codestringMachine-readable error code you can branch on. Present on errors from the query itself; absent on pageSize and page validation errors.
pathstringWhere in the request the error was found. Present on errors from the query itself.

An out-of-range pageSize or a negative page on a list or search endpoint is rejected before the query runs, and the body carries only error:

{ "error": "pageSize must be an integer from 1 to 1000" }
{ "error": "page must be an integer of 0 or more" }

Status codes

StatusMeaningTypical cause
400 Bad RequestThe request was malformed or a parameter was invalid.Out-of-range pageSize, negative page, malformed body.
401 UnauthorizedNo valid token was supplied.Missing, malformed, or expired bearer token. See Authentication.
403 ForbiddenThe token is valid but lacks the required role.Key not provisioned with the endpoint's role. See Authentication & authorization.
404 Not FoundThe requested resource does not exist.Unknown id or reference.
429 Too Many RequestsToo many new tokens were issued for one API user.Issuing new tokens in a loop on POST /v1/auth/token or POST /v1/auth/refresh-token, or across many keys of one API user. Wait Retry-After seconds and reuse the token.
500 Internal Server ErrorAn unexpected error occurred.Transient server error. Retry with backoff.

Batch writes: per-record results

Endpoints that write a batch of records (for example POST /api/v1/codes and POST /api/v1/entries) process each record independently and report it in data.records[] with its status and, for a failed record, an error (code, message, optional fieldErrors). The response status summarizes the batch:

StatusMeaning
200 OKEvery record succeeded; meta.success is true.
207 Multi-StatusSome records failed; meta.success is false and data carries the per-record results.
422 Unprocessable EntityEvery record failed; meta.success is false and data carries the per-record errors (for example PERSIST_ERROR, UNRESOLVED_REFERENCE).
400 Bad RequestThe request itself is invalid (for example no records, or more than 100); no record is processed.

Example error bodies

401 Unauthorized on an /api/v1 endpoint: the bearer token or API key is missing, malformed, invalid or expired.

{
  "message": "Authentication required",
  "extensions": { "code": 401, "details": { "reason": "UNAUTHENTICATED" } }
}

403 Forbidden on an /api/v1 endpoint: the token is valid but its key lacks the endpoint's role. requiredRoles lists the roles that would be accepted.

{
  "message": "Access denied. This endpoint requires one of the following roles: TM_ENTRY_C.",
  "extensions": { "code": 403, "details": { "reason": "INSUFFICIENT_ROLE", "requiredRoles": ["TM_ENTRY_C"] } }
}

401 / 403 from POST /v1/auth/token: the token endpoint answers with error, message and code.

{
  "error": "UnauthorizedException",
  "message": "Authentication failed",
  "code": "UNAUTHORIZED"
}

A refused key gets UnauthorizedException / UNAUTHORIZED. A valid key without an active API_ADMIN role gets ForbiddenException / FORBIDDEN with message "Access denied".

429 from POST /v1/auth/token or POST /v1/auth/refresh-token: too many new tokens were issued for the API user this key belongs to in the last 10 minutes; both endpoints and all of the user's keys share one budget. The response has a Retry-After header (seconds) and the same body shape, with error RateLimitExceeded and code TOO_MANY_REQUESTS. A token exchange answered with the token already cached for its key does not count; every new token does (the first exchange with each key, one each time the cached token expires, and every refresh). Requesting a token before each call with one key stays within the budget; issuing new tokens in a loop, or cycling through many keys of one API user, does not. Reuse a token until it answers 401. A 429 without this body and without Retry-After comes from the per-address limit at the network edge: back off and retry later.