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

# Errors

> Understand standard YALG error responses and common HTTP statuses.

YALG uses HTTP status codes and JSON error bodies for API failures.

## Error shape

```json theme={null}
{
  "statusCode": 400,
  "message": "Bad request",
  "error": "Bad Request"
}
```

The `message` field can be a string or an array of validation messages.

## Common statuses

| Status | Meaning                                                                        |
| ------ | ------------------------------------------------------------------------------ |
| `400`  | Invalid request body, invalid file, invalid state transition, or invalid query |
| `401`  | Missing, malformed, revoked, or invalid API key                                |
| `403`  | The key owner does not have the required feature access                        |
| `404`  | Resource not found or not owned by the key owner                               |
| `410`  | Referenced file is no longer available on disk                                 |
| `429`  | Rate limit or monthly quota exceeded                                           |
| `5xx`  | Unexpected YALG service error                                                  |

## Validation errors

Validation errors normally return `400 Bad Request`. Fix the payload before retrying.

```json theme={null}
{
  "statusCode": 400,
  "message": ["title must be a string", "content should not be empty"],
  "error": "Bad Request"
}
```

## Ownership errors

For security, cross-owner resource access usually returns a not-found response. Treat `404` as either missing or inaccessible.
