TrustColdDevelopers
Reference›Errors

Errors

HTTP mapping. A failed webhook delivery is not a 500 on the trip itself.

Run this from your browser — add your free test keys.

Key points

  • 401 / 403 — Key missing, wrong, or not a client key.
  • 409 — Idempotency conflict, or the trip can no longer be changed or cancelled.
  • 422 — Validation. Place the error on the field (from_address, vehicle_type, …).
  • 429 — Rate limited. Wait for Retry-After, then retry.
  • Body — JSON with message. Validation errors add errors{field: [..]}.

Errors are JSON. Every error has a message. Validation errors (422) also list each field under errors. Messages follow Accept-Language (Arabic by default): send Accept-Language: en for English text. Use the status code, not the message text, in your code.

StatusMeaningWhat to do
200 / 201Success / trip createdRead data
304Status unchanged (If-None-Match)Wait X-Poll-After-Ms, then poll again
400Update had no fieldsSend at least one field
401Key missing, wrong, revoked or expired (key: 3 years, login token: 7 days)Check the header. Ask TrustCold for a new key, or call POST /login again
403The token is not bound to a client, or the account is inactiveUse a client key. Contact TrustCold
404Trip does not exist for this clientCheck the numeric id. Another client's trip is always 404
409Idempotency conflict, or the trip can no longer be changed / cancelledUse a new key for a new booking. Re-read the trip
422Validation failedShow errors.<field> next to that field
429Rate limitedWait for Retry-After seconds. Do not retry in a tight loop
5xxServer errorRetry with the same Idempotency-Key. A failed webhook is never a 5xx on the trip

Examples

Missing, wrong or expired key

{
  "message": "Unauthenticated."
}

Validation failed

{
  "message": "The trip date field is required.",
  "errors": {
    "trip_date": ["The trip date field is required."]
  }
}

Conflict

{
  "message": "This trip can no longer be changed."
}

Rate limited (see the Retry-After header)

{
  "message": "Too Many Attempts."
}

On this page