Aller au contenu principal

Errors and limits

Errors use the same envelope, with a stable machine-readable error.code and, for validation failures, one entry per field in error.details. Show people your own message; log the metadata.correlationId — WRAPA support can trace a request with it.

A validation error
HTTP/1.1 400 Bad Request
{
  "success": false,
  "data": null,
  "message": "One or more fields are invalid.",
  "error": {
    "code": "VALIDATION_ERROR",
    "details": [{ "field": "incidentDate", "message": "Must not be in the future." }]
  },
  "metadata": { "correlationId": "018f7c69-77a2-7d0a-9f19-5855e6f2a999" }
}

Status codes

  • 400 invalid input · 401 missing or revoked key · 403 the key lacks the scope, or the organisation doesn’t match · 404 not found (or not yours)
  • 409 the record changed state (for example, cover already ended) · 422 a business rule refused it
  • 429 too many requests — wait for the Retry-After seconds · 5xx retry with backoff (and the same Idempotency-Key)

Idempotency

Send Idempotency-Key: <uuid> on creates. Repeating a request with the same key returns the first result instead of doing the work again; use a new key only for a genuinely new request.

API reference