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

# Errors

> Stripe-style error envelopes returned by the API.

Every failed request returns:

```json theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "unsupported_document",
    "message": "file: Only PDF, JPG, and PNG documents are supported."
  }
}
```

| HTTP | `type`                       | When                                                                              |
| ---- | ---------------------------- | --------------------------------------------------------------------------------- |
| 400  | `invalid_request_error`      | Bad input (missing file/url, unsupported type, SSRF-blocked URL, bad `limit`)     |
| 401  | `authentication_error`       | Missing or invalid API key                                                        |
| 402  | `insufficient_credits_error` | Workspace has no remaining credits                                                |
| 403  | `permission_error`           | Key's role lacks the [permission](/authentication#permissions) the endpoint needs |
| 404  | `not_found_error`            | Unknown id, or another workspace's id                                             |
| 429  | `rate_limit_error`           | Throttle exceeded                                                                 |

`error.code` is the machine-readable cause (`unsupported_document`, `insufficient_credits`, …).
Branch on `type` and `code`; show `message` to a human rather than parsing it.

A request for an id that belongs to another workspace returns `404`, not `403`. Confirming that
an id exists is itself a leak.

## Rate limits

| Scope                | Default            |
| -------------------- | ------------------ |
| Submitting documents | 60/minute per key  |
| All other endpoints  | 500/minute per key |
