Errors
Errors contain a machine-readable code and a short error message.
{"code":"invalid_api_key","error":"Use an active Focus API key."}Branch on the HTTP status, then on the code. Focus can add codes within v1, so handle an unfamiliar code by its status. Retry only the responses listed under retries. Correct the request or key for the others.
Error codes
- 400 ·
invalid_request - The message names the problem: a page size outside 1 to 100, an unknown or repeated query parameter, an
aftercursor that is not a UUID, anIdempotency-Keythat is not one UUID, or a key in the URL. - 401 ·
invalid_api_key - The key is missing, mistyped, expired, suspended, or revoked, or its application is suspended or retired. A workspace key also stops when its grant ends. After a rotation, the previous secret stops when its overlap ends. Check the key and its application in Developer access.
- The developer plan does not include this operation, or its payment is pending. Check Plan and usage in Developer access.
- 403 ·
insufficient_scope - The key or its application lacks the permission, or the key’s application cannot reach this resource.
- 404 ·
route_not_found - The path is not an API operation. Check for a trailing slash or a document ID that is not a UUID.
- 404 ·
document_not_found - The key owner’s library has no document with this ID.
- 405 ·
method_not_allowed - Use
GET, as theAllowheader states. - 409 ·
idempotency_conflict - Your account already used this
Idempotency-Keywith another key, operation, or parameters. Repeat the original request, or use a new UUID. - 409 ·
result_changed - The data changed after the original request. Read again with a new UUID.
- 429 ·
rate_limit_exceeded - The account rate for this UTC minute is used up. Wait the seconds in
Retry-After. - 429 ·
credential_rate_limited - The key’s own rate for this UTC minute is used up. Wait the seconds in
Retry-After. - 429 ·
authentication_throttled - Too many requests from your network address used invalid keys. Every request from that address waits for
Retry-After, including requests with a valid key. Stop the client sending the invalid key first. - 429 ·
request_limit_reached - The account reached its request allowance for this period. The response has no
Retry-After. Check the period and personal limit under Plan and usage. - 503 ·
api_busy - Focus is handling too many API requests. Wait at least
Retry-Afterseconds, then retry with backoff and the sameIdempotency-Key. - Focus could not complete the request. Retry the same way.
A Focus API key sent outside /api/v1 returns 401 sign_in_required. Other Focus routes require a signed-in browser.
Retries
Retry after a connection failure, a 503, or a 429 that includes Retry-After. Wait at least Retry-After seconds, back off between attempts, and send the original Idempotency-Key each time. Retrying other errors unchanged gets the same answer. See retries and idempotency.
Request IDs
Every response to an operation carries X-Request-Id: the Idempotency-Key when supplied, otherwise a new UUID.
To report a problem, email info@world-wide.org, the contact on the Imprint. Include the response’s X-Request-Id.