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

# Errors

> How Manka reports failures and what each status code means.

All Manka error responses share a single JSON shape:

```json theme={null}
{
  "message": "Human-readable error description"
}
```

The HTTP status code is the primary signal — the `message` field is a hint for humans and may change between releases.

## Status codes

| Status | Category       | Typical cause                                                                 |
| ------ | -------------- | ----------------------------------------------------------------------------- |
| `400`  | Bad request    | Missing required field, unreadable PDF, or password required and not supplied |
| `401`  | Unauthorized   | Missing or invalid API token                                                  |
| `402`  | Payment needed | Account has no remaining analysis credits                                     |
| `404`  | Not found      | Task ID is unknown or has expired (24 h TTL)                                  |
| `500`  | Server error   | Internal error processing the request                                         |
| `503`  | Unavailable    | Underlying datastore is unreachable                                           |

## Handling errors

<AccordionGroup>
  <Accordion title="401 — Unauthorized" icon="lock">
    Verify the `Authorization` header is present and the token has not been revoked or rotated. Generate a fresh token from [Developer Tools](https://www.manka.tz/dashboard/api-keys).
  </Accordion>

  <Accordion title="402 — Insufficient credits" icon="coins">
    Each call to `/analysis`, `/transactions`, or `/analysis-combined` deducts one credit. Check your balance on the Manka dashboard or contact [support](mailto:hello@manka.tz) to top up.
  </Accordion>

  <Accordion title="400 — Password protected PDF" icon="file-invoice-dollar">
    Re-submit with the `password` field set. For `/analysis-combined`, pass a JSON array via `passwords` positionally matching the `files`.
  </Accordion>

  <Accordion title="404 — Task not found" icon="hourglass-end">
    Task records expire 24 hours after creation. Re-submit the statement if you still need a result.
  </Accordion>
</AccordionGroup>

## Example

```json 401 Unauthorized theme={null}
{ "message": "Invalid API token" }
```

```json 402 Payment Required theme={null}
{ "message": "Insufficient analysis credits" }
```
