> ## Documentation Index
> Fetch the complete documentation index at: https://docs.federalaccess.cl/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> The API's error format and what each code means.

Every API response is JSON, and every error uses the same format:

```json theme={null}
{
  "error": {
    "code": "forbidden",
    "message": "Forbidden. Installation is inactive.",
    "request_id": "7f3c1d2e-4b5a-4c6d-8e9f-0a1b2c3d4e5f"
  }
}
```

| Field | Description |
| - | - |
| `code` | Stable code your system can act on. Use this field in your logic. |
| `message` | Human-readable message. It can change; don't use it in your logic. |
| `request_id` | The request's identifier. Include it when you contact support. |
| `details` | Extra information. Only present on some errors. |

## Codes

| Status | `code` | When | What to do |
| - | - | - | - |
| `400` | `bad_request` | The request body isn't valid JSON | Fix the body |
| `401` | `unauthorized` | The key is missing, malformed, unknown, or revoked | Check the key. See [Authentication](https://docs.federalaccess.cl/en/guides/authentication.md) |
| `403` | `forbidden` | The key lacks the required scope, or the installation is inactive | Check the [scopes](https://docs.federalaccess.cl/en/guides/scopes.md) or the installation's status |
| `404` | `not_found` | The path doesn't exist | Check the URL |
| `404` | `record_not_found` | The requested record doesn't exist in the installation | Check the id |
| `422` | `validation_error`, `business_rule_violation`, and others | The data sent is invalid or breaks a rule | Read `message` and fix the data |
| `429` | `too_many_requests` | The rate limit was exceeded | Wait the `Retry-After` seconds. See [Rate limits and 429](https://docs.federalaccess.cl/en/guides/rate-limits.md) |
| `500` | `internal_error` | Unexpected error on our side | Retry later. If it persists, contact support with the `request_id` |

> [!NOTE]
>
> A URL with a malformed query string is rejected before it reaches the API. That `400` response doesn't use the format above.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.