# validation-failed

> The request does not match the endpoint's schema. The detail names the field.

`400, 422` · `Validation failed` · `type: https://docs.dlogify.com/errors/validation-failed`

## When it happens

- A required field is missing, has the wrong type or is out of range (for example an event without `message`, an invalid timestamp, or `limit` above 100). The API answers `422`.
- The authentication endpoints (`/v1/auth/*`) answer `400` for the same kind of error.

## How to fix it

Read the `detail`, which names the field and the rule it broke, and compare the request with the operation's page in the [API reference](https://docs.dlogify.com/api.md).

## Example

```http
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
```

```json
{
  "type": "https://docs.dlogify.com/errors/validation-failed",
  "title": "Validation failed",
  "status": 422,
  "detail": "body/events/0 must have required property 'message'",
  "instance": "req_01j…"
}
```

Source: https://docs.dlogify.com/errors/validation-failed
