# Errors and rate limits
Source: https://nordvec.com/sk/docs/guides/errors-and-rate-limits#the-error-envelope

## The error envelope [#the-error-envelope]

Every non-2xx response is one JSON object:

```json
{
  "defined": false,
  "code": "TOO_MANY_REQUESTS",
  "message": "Too many requests",
  "data": { "reason": "rate_limit.exceeded", "retryAfterMs": 12000 }
}
```

* `code` is the HTTP-level error, for example `UNAUTHORIZED`, `FORBIDDEN`,
  `NOT_FOUND`, `BAD_REQUEST` or `TOO_MANY_REQUESTS`.
* `data.reason`, when present, is a finer machine-readable reason such as
  `auth.key_not_found` or `rate_limit.exceeded`. Branch on it rather than on
  `message`, which is for people and may change.
* `defined` is `true` when the operation lists that error in the
  [API reference](/docs/api), and `false` for errors any request can meet
  (authentication, rate limits, an unknown route).
* A validation failure answers `BAD_REQUEST` with the problems in
  `data.formErrors` and `data.fieldErrors`.

Every response also carries an `X-Request-ID`. Quote it when you contact
support, and we can find that exact request.