error
code, and usually a summary sentence written to be relayed as-is. Read the HTTP status code to
understand the category of failure, then branch on error for the exact cause.
Error response format
HTTP status codes
Error codes
Authentication errors
All401 responses return a JSON body with error set to either authentication_required (when
no token was sent at all) or invalid_key (when a token was sent but is not valid).
invalid_key. This is intentional:
distinguishing between these states in the response would allow an attacker to enumerate whether a
given key exists in the system. If you receive invalid_key, verify that you are sending the
correct key and that it has not been revoked in the console.
A revoked key can be accepted for up to a minute: see Rotating keys.
Rate limits
How many calls your organization can make depends on its plan:
Every call made with
an API key counts, whatever the endpoint; the OpenAPI document does not. All keys of one
organization share its allowance. A key you created for one of your customers can make as many
calls as your organization, and counts against your organization’s allowance too. Minutes and days are counted on the clock in UTC: a new minute
starts on the minute, a new day at 00:00 UTC.
Over either limit, the API answers
429 with error: "rate_limited", a summary you can relay,
and a Retry-After header with the number of seconds until the limit resets.
Retry-After seconds before the next call; retrying sooner is refused again. If
your usage needs a higher allowance, contact us and we will raise it for your organization.
Every response to a call made with a valid key carries three headers so you can slow down before
you reach the limit. That includes errors: a 400, 402, 404, 422, 502 or 503 counts as a call and
carries them, so retrying failed calls uses up your allowance too. A 401 (the key was not
accepted) and a 413 (the request body was too large) are not counted and carry none.
Polling a BOM with
GET /v1/bom/{id} counts too: at one poll every 5 seconds, one BOM uses 12
calls a minute.
Handling errors in code
Check the HTTP status code first, then read theerror field for the specific cause. summary is
written to be shown to a user or relayed by an agent as-is. The examples below demonstrate a
pattern you can adapt to your integration.