Limits, errors and idempotency
How the API answers errors, how many calls it accepts and how to avoid repeated actions.
The full rules and current numbers are in the API documentation, under General rules. In short:
Errors
Every failure answers in JSON with error (a stable code, for your system) and message (text for people). Validation errors also include errors, per field.
| Code | What it usually is |
|---|---|
invalid_token (401) |
Invalid, expired or revoked key. |
insufficient_scope (403) |
The key lacks the route’s permission. |
forbidden_role (403) |
The person’s role doesn't allow the action. |
app_disabled (403) |
The route’s app isn't turned on in the company. |
plan_required (403) |
The company’s plan doesn't include the API. |
workspace_blocked (403) |
The company has no access at the moment. |
validation_failed (422) |
Some field is wrong. |
rate_limited (429) |
Too many calls: wait. |
Limits
There is a per-minute call limit per credential and specific caps for transactional email, mailbox sending and new Newsletter contacts. Responses carry X-RateLimit-Limit and X-RateLimit-Remaining. At the limit, the response is 429 with Retry-After, in seconds.
Idempotency
On writes, send the Idempotency-Key header with a unique value per operation. Repeating the call with the same key returns the first response instead of repeating the action. The same key on a different request returns 422, and a request still in progress returns 409. Errors aren't stored, so you can try again.
Pagination and versions
- Long lists use a cursor: pass
limitand, for the next page, the previous response’snext_cursorincursor. - The version is part of the address (
/api/v1). New fields may appear without notice; breaking changes only come in a new version. - Send
X-Correlation-Idto find the call later.
Did not find the answer?
Log in to the panel and talk to support, or write to suporte@amati.digital.