---
title: Error handling
description: Interpret authentication, validation, quota and availability errors.
---

Check HTTP status before using response data. Error shapes differ between authentication, controllers and request validation.

```json
{
  "success": false,
  "message": "Invalid or expired API key"
}
```

```json
{
  "success": false,
  "error": "Mountain not found"
}
```

These are representative verified messages, not a single universal schema. The API's global error handler maps validation/runtime errors to `success: false`, `error` (the error name) and `message` (details). Do not require Fastify's default `statusCode` or `code` fields in the body. Global version metadata can be appended. Code against HTTP status; do not parse English error text to determine program behavior.

| HTTP status | Typical meaning                                           | Client action                                 |
| ----------- | --------------------------------------------------------- | --------------------------------------------- |
| 400         | Invalid/missing validated query or path values            | Correct the request                           |
| 401         | Missing, invalid, expired or revoked credentials          | Check key/header and credential status        |
| 403         | Origin/IP restriction or authorization failure            | Correct restrictions; do not keep retrying    |
| 404         | Missing resource or unavailable optional route            | Check path/identifier and availability        |
| 429         | Monthly account quota or status endpoint per-IP allowance | Inspect response and Retry-After when present |
| 500         | Resource read failed                                      | Bounded retry; report persistent errors       |
| 503         | Verification, quota or data service unavailable           | Bounded backoff with jitter                   |

Not every endpoint emits every status. Empty filtered lists and missing media associations usually return 200 with an empty array. Missing individual resources return 404 where documented.

The monthly quota 429 does not supply a Retry-After header. Repeated retries will not restore the allowance; check the panel or wait for the next UTC calendar month. The anonymous status routes do supply Retry-After for per-IP throttling.

XML feed failures use XML `<error>` bodies. A conditional 304 has no body. Avoid exposing keys or complete authenticated request headers in application error logs.
