Errors

Errors contain a machine-readable code and a short error message.

JSON
{"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 after cursor that is not a UUID, an Idempotency-Key that is not one UUID, or a key in the URL.
  • A page size outside 1 to 100: Choose a page size from 1 to 100.
  • An unknown or repeated query parameter: Unknown or repeated query parameter.
  • An after cursor that is not a UUID: Use a cursor from the previous page.
  • An Idempotency-Key that is not one UUID: Supply a single UUID in Idempotency-Key.
  • A key in the URL: Send credentials in the Authorization header.
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.
  • Use an active Focus API key.
402 · api_access_unavailable
The developer plan does not include this operation, or its payment is pending. Check Plan and usage in Developer access.
  • The developer subscription does not permit this operation.
403 · insufficient_scope
The key or its application lacks the permission, or the key’s application cannot reach this resource.
  • This key lacks the required permission.
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.
  • API endpoint not found.
404 · document_not_found
The key owner’s library has no document with this ID.
  • Document not found.
405 · method_not_allowed
Use GET, as the Allow header states.
  • Method not allowed.
409 · idempotency_conflict
Your account already used this Idempotency-Key with another key, operation, or parameters. Repeat the original request, or use a new UUID.
  • Use the request identifier for its original operation.
409 · result_changed
The data changed after the original request. Read again with a new UUID.
  • The document information changed. Use a new request identifier.
429 · rate_limit_exceeded
The account rate for this UTC minute is used up. Wait the seconds in Retry-After.
  • The account request rate was reached.
429 · credential_rate_limited
The key’s own rate for this UTC minute is used up. Wait the seconds in Retry-After.
  • The key request rate was reached.
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.
  • Try again after the authentication limit resets.
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.
  • The account request allowance was reached. Check Developer settings.
503 · api_busy
Focus is handling too many API requests. Wait at least Retry-After seconds, then retry with backoff and the same Idempotency-Key.
  • Focus is busy. Retry the same request.
503 · api_unavailable
Focus could not complete the request. Retry the same way.
  • Focus could not complete this request. Try again.

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.