On this page

API

validation_failed

HTTP 422. Validation failed

What it means

The body is valid JSON but some fields are not valid.

What to do

errors names every problem at once, each with a JSON pointer into your body. Fix them all and resend. Request bodies are strict: an unknown field is an error, so a typo in a field name ends up here.

Retrying

Do not retry the same request. Change it first.

Extra members

  • errors: One entry per problem: pointer (for example #/items/0/version), code and message.

Example

json
{
  "type": "https://reuseforge.com/docs/api/errors/validation_failed",
  "title": "Validation failed",
  "status": 422,
  "detail": "The request body is invalid. See `errors` for each field.",
  "instance": "/api/v1/items/acme/invoice-extractor",
  "code": "validation_failed",
  "request_id": "req_c4v8n2m6x1z3",
  "errors": [
    {
      "pointer": "#/rail",
      "code": "enum",
      "message": "rail must be one of simulated, base-usdc, base-usdt, btc."
    }
  ]
}

Every error is application/problem+json (RFC 9457). Branch on code, show detail to people and quote request_id when you ask for help. See the error catalogue.