TOVRReference

Errors

The TOVR REST API error catalog. The error envelope, the six error types, every error code with its HTTP status and type, what to do about each, and retry rules. Every error's doc_url links to an entry on this page.

Every /api/v1 error answers with a non-2xx status and the same JSON envelope. Each error's doc_url links to its entry on this page. The one exception is the token endpoint, which answers OAuth-style string errors (see Authentication).

Response format

{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_failed",
    "message": "The request did not match the expected shape.",
    "details": [
      { "path": "stops.0.type", "code": "invalid_value", "message": "Invalid option: expected one of \"UNKNOWN\"|\"PICKUP\"|\"DELIVERY\"|\"WAYPOINT\"" }
    ],
    "request_id": "req_8a41c2d9e0f34b6c9d7e5f1a2b3c4d5e",
    "doc_url": "https://tovr.eu/docs/tovr/reference/errors#validation_failed"
  }
}
FieldAlways presentDescription
typeyesThe coarse bucket. It never gains a member without an API version bump.
codeyesThe specific cause, from the closed list below. Branch on this.
messageyesA human-readable explanation, in English in every locale. Do not parse it.
paramsometimesThe field or header at fault, when one can be named.
detailssometimesMachine-shaped specifics. For validation_failed, one entry per issue with path, code and message.
request_idyesThe same value as the X-Request-Id header. Quote it in a support request.
doc_urlyesA link to this page, at the entry for code.

A client that switches on code needs a fallback per type, because codes can be added.

Types

typeMeaning
authentication_errorThe credentials are missing or not valid.
permission_errorThe caller is authenticated but not allowed to do this.
invalid_request_errorThe request cannot be served as sent.
conflict_errorThe request conflicts with data that already exists.
rate_limit_errorThe caller sent too many requests.
api_errorA fault on TOVR's side or in a service TOVR depends on.

All codes

codeStatustypeRetry?
missing_credentials401authentication_errorAfter sending a token
invalid_token401authentication_errorWith a new token, unless the client application is deactivated or expired
expired_token401authentication_errorWith a new token
insufficient_scope403permission_errorNo
forbidden403permission_errorNo (reserved)
quota_exceeded402permission_errorNext calendar month
validation_failed422 (400 for Idempotency-Key)invalid_request_errorNo
unknown_parameter422invalid_request_errorNo (reserved)
invalid_id422invalid_request_errorNo
invalid_cursor422invalid_request_errorFrom the first page
contact_required422invalid_request_errorNo
org_not_reachable422invalid_request_errorNo
insufficient_market_data422invalid_request_errorLater
cursor_expired410invalid_request_errorAfter a resync
not_found404invalid_request_errorNo
rate_limited429rate_limit_errorAfter Retry-After
duplicate_external_id409conflict_errorNo
external_id_owned_by_another_org409conflict_errorNo
idempotency_key_reuse409conflict_errorWith a new key
internal_error500api_errorNo
service_unavailable503api_errorWith backoff

Authentication errors

A 401 carries type authentication_error, one of the three codes below, and the header WWW-Authenticate: Bearer error="invalid_token". It carries no rate-limit headers.

missing_credentials

401. The request has no Authorization header, the header does not start with Bearer , or the token is empty. Send the access token with every request.

invalid_token

401. The signature is wrong, the token is unknown or revoked, or its client application is missing, deactivated or expired. Get a new token. When the client application is deactivated or expired, the token endpoint refuses a new token too. Settings → Developer cannot reactivate it, so create a new client application there.

expired_token

401. The token is genuine and older than its 3,600 s lifetime. Get a new token and retry.

Permission errors

insufficient_scope

403. The token does not have the scope this endpoint needs, or a webhook subscription names an event type whose read scope the token lacks. The scope catalog lists the scope for each endpoint. Scopes cannot be added to an existing client application: create one with the scope, then get a token from it. This refusal does not count against the rate limit.

forbidden

403. Reserved. No endpoint returns it today: an object that belongs to another organization answers 404 not_found.

quota_exceeded

402, type permission_error. The client application has used its organization's monthly request quota, or the monthly streaming minutes on GET /events/stream. Waiting inside the month does not help. No Retry-After is sent. See Rate limiting and quota.

Invalid request errors

validation_failed

422. The body, query or path parameters do not match the expected shape, or a value breaks a rule the schema cannot express (an id in a create body, an empty PATCH, a refused status transition, a UN number that is not one). A body that is not valid JSON is reported here too. details lists each schema issue with its path; param names the field for the other cases. A query parameter the endpoint does not accept is reported here too. An Idempotency-Key header longer than 255 characters answers 400 with param: "Idempotency-Key". Fix the request. Do not retry it unchanged.

unknown_parameter

422. Reserved. No endpoint returns it today: an unknown query parameter is a validation_failed.

invalid_id

422, param: "endpoint_id". A webhook endpoint path carries an id that is not whe_<uuid>. Send the id TOVR returned, with its prefix. On the other endpoints a malformed path id is validation_failed.

invalid_cursor

422, param: "cursor" (or "after" on the change feed). The cursor was not issued by this API, or it was issued for a different sort. Send next_cursor from the previous page unchanged, or start again without a cursor.

contact_required

422, param: "contacts". POST /shipments needs at least one contact with a name and an email or phone. Add the contact to the body.

org_not_reachable

422, param: "visibility". A shipment created with visibility public or platform needs the organization's profile to state a contact email and a phone number. The message names what is missing. Complete Settings → General, or create the shipment with visibility: "private".

insufficient_market_data

422. The request was valid, but there is not enough market data to price that lane. details.estimate carries the estimate with zero prices and quality_status: "INSUFFICIENT_DATA". Try a different lane, or try again later.

cursor_expired

410, param: "after". The cursor points before the 30-day retention window of the change feed, so events after it are gone. Read current state again from the list endpoints, then resume from the next_cursor of a new GET /events. See Change feed.

not_found

404. The object does not exist, or it is not visible to this organization. The two cases answer the same on purpose.

rate_limited

429, type rate_limit_error. The client application sent more requests in this minute than its plan allows. Wait the number of seconds in Retry-After, then retry. See Rate limiting and quota.

Conflict errors

duplicate_external_id

409, param: "external_id". Your organization already has a shipment with this platform and external_id. POST only creates: change the existing shipment with PATCH.

external_id_owned_by_another_org

409, param: "external_id". Another organization already has a shipment with this platform and external_id. Choose an external_id unique to your own system.

idempotency_key_reuse

409, param: "Idempotency-Key". The key was already used for a different request (another method, path or body). Use one key per operation, and reuse it only to retry that same request. See Idempotency.

API errors

internal_error

500. A fault on TOVR's side. Retrying the same request does not help. Contact support and quote the request_id. The one exception is POST /estimate and POST /estimate/batch: when the pricing service fails or times out they answer 500, and a retry with backoff can succeed. See APEX errors.

service_unavailable

503. A service TOVR depends on is not available. Today that is the pricing service: not configured for the environment on POST /estimate and POST /estimate/batch, and not configured or not answering on GET /market/overview. The request was valid. Retry with exponential backoff.

Retry strategy

ResponseAction
429 rate_limitedWait Retry-After seconds, then retry.
503 service_unavailableRetry after 1 s, 2 s and 4 s, then stop.
401 expired_tokenGet a new token, then retry once.
401 invalid_token, missing_credentialsFix the credentials. Retry once with a new token.
402 quota_exceededStop until the next calendar month or a plan upgrade.
500 internal_errorDo not retry. Contact support with the request_id.
Any other 4xxDo not retry. Fix the request.

Send an Idempotency-Key on every POST and PATCH you might retry, so a retry never creates the same object twice.

On this page