- Where
- Your own system; Console, Developers (request log)
- Who can do it
- Developers
- Plans
- REST API is included in Growth, Scale and Enterprise
In detail
Branch on error.code, never on the wording of error.message, which can be improved at any time. Some errors carry more: validation_failed lists each wrong field in error.fields as field, code and message, insufficient_scope names required_scope, and invalid_parameter names the param.
| Status | Code | Meaning and what to do |
|---|---|---|
| 400 | invalid_json | The body is not a JSON object. Fix the request. |
| 400 | invalid_parameter | A query parameter is outside its range. error.param names it. |
| 400 | invalid_cursor | The cursor was not issued by the API or is over 15 minutes old. Start the listing again. |
| 400 | invalid_idempotency_key | Idempotency-Key must be 1 to 120 printable characters with no spaces. |
| 401 | missing_key | No Authorization: Bearer header was sent. |
| 401 | invalid_key | The key is wrong or has been revoked. |
| 402 | plan_feature, plan_limit | The plan does not include this, or a plan limit has been reached. error.plan says which plan. |
| 403 | insufficient_scope | The key's scope is too low. error.required_scope names the one needed. |
| 403 | forbidden | A sender-bound key asked for another sender's data or something company-wide. |
| 403 | workspace_suspended | The workspace is suspended, so its keys are refused. |
| 404 | not_found, unknown_endpoint | Nothing has that id, or the path is not an endpoint. |
| 409 | not_cancellable | The parcel is already out for delivery or finished. |
| 409 | request_in_progress | The first request with this Idempotency-Key is still running. Retry shortly. |
| 413 | payload_too_large | The body is over 64 KB. |
| 422 | validation_failed | One or more fields are wrong. See error.fields. |
| 422 | idempotency_key_reused | The Idempotency-Key was used before with a different body. Use a new key. |
| 429 | rate_limited | Too many requests. Wait the seconds in Retry-After. |
| 429 | too_many_attempts | Over 30 requests a minute with keys that are not valid from one address. |
| 500 | server_error | Something failed on our side. Retry with back-off. |
Address refusals
When a booking's address is the problem, error.fields has an entry for address with one of three codes: address_not_found (the address could not be placed; correct it or send coordinates), address_lookup_unavailable (the lookup did not answer; retry shortly or send coordinates) and outside_coverage (your coverage refuses bookings there).
Rate limits
- Per key: 120 requests in any rolling 60 seconds.
- Keyless calls (the index and public tracking): 60 a minute from one address.
- Answers carry
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset(when the oldest request in the window drops out, in Unix seconds). - A 429 carries
Retry-Afterin seconds. Wait at least that long before the next request.
If you need more, spread work over time, use webhooks instead of polling, and use a separate key per system: each key has its own allowance.