Skip to main content

Errors

Every error has the same shape:
Branch on error.code, not on the message. Messages may be reworded at any time. Each endpoint page lists the errors it can return.

Request IDs

Responses include an X-Request-Id header, and every error includes the same ID as request_id. Log it, and include it when you contact support so we can find your request. You can also send your own X-Request-Id to connect Watchdog’s logs with yours.

Rate limits

Each API key can make 120 requests per minute to the current API and 500 requests per minute to the new API. Above that, the API answers 429 Too Many Requests with a Retry-After header. Wait that many seconds before you try again.

When to retry

  • 400, 401, 403, 404, 409: fix the request first. Retrying the same request gives the same answer.
  • 429: wait for Retry-After, then retry.
  • 5xx and network errors: retry with increasing waits between attempts, and give up after a few tries.
If an upload times out, it may still have worked. In the current API, uploading the same file again answers 409 with the ID of the invoice that already exists, so you can safely try again and use that ID.