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

# Errors

> Understand and handle LocalAds API errors.

LocalAds returns errors as
[RFC 9457 problem details](https://www.rfc-editor.org/rfc/rfc9457) with the
`application/problem+json` content type.

```json theme={null}
{
  "type": "https://docs.makelocalads.com/errors/product-not-found",
  "title": "Product not found",
  "status": 404,
  "detail": "The product does not exist.",
  "code": "product_not_found",
  "request_id": "63f24a02-d278-4e7a-9da7-73c9ae649e32"
}
```

Use `code` for program logic and `request_id` when contacting support. Do not
write integrations that depend on the human-readable `detail`.

## Status codes

| Status | Meaning                                                 | What to do                                            |
| ------ | ------------------------------------------------------- | ----------------------------------------------------- |
| `400`  | The request is malformed or contains unsupported fields | Correct the request before retrying                   |
| `401`  | The API key is missing or invalid                       | Check the bearer header or replace the key            |
| `403`  | The key lacks the required permission                   | Use a key with the required permission                |
| `404`  | The resource does not exist in the key's organization   | Check the resource ID                                 |
| `422`  | A product rule or plan limit blocked the request        | Resolve the condition before retrying                 |
| `429`  | The API key exceeded its rate limit                     | Wait for `Retry-After`, then retry                    |
| `500`  | LocalAds could not complete the request                 | Retry with backoff and contact support if it persists |

## Retry safely

Retry `429` and transient `500` responses with exponential backoff. Do not
automatically retry `400`, `401`, `403`, `404`, or `422` responses without
changing the request or configuration.
