When an error comes back: what it means, what to do
Every error arrives in the same format and carries a stable code. See what the code means, whether to repeat the request and how to resend the same request safely. Where the error body appears on each endpoint is described on the REST API page and delivery retries on the webhooks page. The overview is on the developers page.
- Format
- application/problem+json
- Fields
- type, title, status, detail, instance, code and traceId. Validation errors also carry a per-field errors object.
- What to read
- Build your logic on the stable code field, not on the detail text, which can be translated.
- Never included
- Internal traces, query text, credentials and the existence of another account's resource.
Send the same request twice
A second send with the same key and body returns the same response as the first. If you change the body and keep the key, you get a conflict response. The responses are examples on this page; no network request is made.
Idempotency-Key
sample-key-0001POST /api/v1/ticketsContent-Type: application/jsonIdempotency-Key: sample-key-0001 { "subject": "Late order", "description": "Synthetic test record.", "priority": "high", "departmentId": "33333333-3333-4333-8333-333333333333"}No request has been sent yet.
Sends
No sends yet.
A sample key and a sample record. No request is sent.
| Send | Result |
|---|---|
| First send | 201 Created. The record is made. |
| Same key, same body | The same response as the first. No second record. |
| Same key, different body | 409 idempotency_conflict. |
Error table
Each row is one code value. See the last column for client behavior.
| Status | Code | Meaning | Repeat it? |
|---|---|---|---|
| 400 | invalid_request | The request could not be validated. | No. Fix the field. |
| 401 | authentication_required | The caller could not be authenticated. | Once, after renewing the credential. |
| 403 | permission_denied | No permission for this operation. | No. Review the permission. |
| 403 | policy_denied | An account policy does not allow the operation. | No. Review the policy. |
| 404 | resource_not_found | The resource was not found. The existence of another account's resource is not disclosed. | No. |
| 409 | invalid_state | The resource is not in a state that allows this operation. | Read the current state first. |
| 409 | idempotency_conflict | The same Idempotency-Key was sent with a different body. | No. Use a key only with the same body. |
| 409 | operation_in_progress | The first request with the same key is still running. | Yes. Wait for Retry-After, with the same key. |
| 412 | version_conflict | The resource changed after the version sent in If-Match. | Reload, merge, then send. |
| 422 | business_validation_failed | The request is well formed but breaks a business rule. | No. Show the business rule message. |
| 428 | precondition_required | The change request is missing its ETag condition. | Yes, with If-Match. |
| 429 | rate_limited | The request rate was exceeded. | Yes. With Retry-After and jitter. |
| 429 | concurrency_limit | The number of concurrent jobs was exceeded. | Yes. With Retry-After and jitter. |
| 502 / 503 | dependency_unavailable | A component the operation needs is not responding right now. | Only for safe calls. |
| 504 | dependency_timeout | The required component did not answer in time. | A side effect is possible: query the operation first. |
Safe retry rules
After a timeout you cannot know whether the request was processed. The key makes that uncertainty safe.
- A key is required
- POST requests that create a business effect require an Idempotency-Key.
- Scope
- A key applies together with the account, the identity, the operation and the key value. A key is not a secret.
- After a timeout
- Resend with the same key and the same body; one effect is made.
- Retention
- The record is kept for at least 24 hours. Operations with an external effect are also protected by a permanent key and do not rely on the 24-hour record.
- A 202 response
- Query the operation. An operation with the result unknown is no reason to start new work.
- A rejected request
- A request rejected for a schema or identity error does not have to create an idempotency record.
- Read requests
- On 429 and a temporary 502 or 503 they can be repeated with a bounded exponential wait and jitter.
Rate limits and waiting
When a 429 arrives, the client acts on the response, not on a number.
- Retry-After
- Wait for the stated time. Add jitter on top so clients do not all return at once.
- Two codes
- rate_limited says the request rate was exceeded; concurrency_limit says the number of concurrent jobs was.
- What a limit covers
- A limit applies per account, credential, resource family, cost and number of concurrent jobs. There is no single global limit.
- The SDKs
- The three SDKs respect the Retry-After time. Details are on the SDK page.