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

# Errors

> The error envelope and a catalogue of every code the Partner API returns.

Every error returns a consistent JSON envelope with a stable machine-readable
`code` you can branch on:

```json theme={null}
{
  "error": {
    "code": "scope_not_consented",
    "message": "scope 'crew:documents:read' is not consented for this crew member",
    "scope": "crew:documents:read"
  }
}
```

Some codes add fields (`scope`, `retry_after_seconds`). Branch on `code`, not on
`message`. Every response also carries an `X-Request-Id` header — include it when
contacting support.

## Catalogue

| Code                                                     | HTTP | Meaning                                                     |
| -------------------------------------------------------- | ---- | ----------------------------------------------------------- |
| [`invalid_api_key`](/errors/invalid_api_key)             | 401  | Missing, malformed, or unknown API key.                     |
| [`invalid_signature`](/errors/invalid_signature)         | 401  | Bad/missing HMAC signature, stale timestamp, or replay.     |
| [`api_not_enabled`](/errors/api_not_enabled)             | 403  | Your plan does not include API access.                      |
| [`scope_not_granted`](/errors/scope_not_granted)         | 403  | Your plan does not grant the required scope.                |
| [`scope_not_consented`](/errors/scope_not_consented)     | 403  | The crew member hasn't consented to that scope for you.     |
| [`not_found`](/errors/not_found)                         | 404  | The vessel/crew isn't attributed to you (or doesn't exist). |
| [`partner_rate_limited`](/errors/partner_rate_limited)   | 429  | You exceeded your rate-limit budget.                        |
| [`partner_mode_mismatch`](/errors/partner_mode_mismatch) | 403  | A test-mode key was used against a live environment.        |

Malformed request bodies (failing schema validation) return FastAPI's standard
`422` response rather than this envelope.
