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

# Errors

> One error envelope, its codes, and the reasons on the partner routes.

Every error uses one envelope:

```json theme={null}
{
  "error": {
    "code": "conflict",
    "message": "Request conflicts with an earlier operation.",
    "correlation_id": "0af7651916cd43dd8448eb211c80319c",
    "reason": "stale_totals"
  }
}
```

* `code` is stable and machine readable.
* `message` is a stable, safe English sentence. It never carries the underlying error text.
* `correlation_id` is 32 hexadecimal characters. Quote it when you contact us.
* `reason` is optional and comes from a closed list for the operation.

## Codes

`invalid_request`, `request_too_large`, `unauthenticated`, `not_found`, `conflict`, `unprocessable`, `operation_disabled`, `rate_limited`, `forbidden`, `dependency_unavailable`, `internal`, `deadline_exceeded`, `method_not_allowed`.

## Reasons on the partner routes

| Status | Code | Reason | Meaning |
| - | - | - | - |
| 400 | `invalid_request` | none | A malformed body: an unknown or repeated member, a value of the wrong type or out of range, or on flight totals an `as_of` that is not RFC 3339 or is more than 5 minutes ahead of the server's clock. |
| 400 | `invalid_request` | `invalid_grant` | The code does not open a grant for this partner, verifier and redirect URI. Restart the consent. |
| 403 | `forbidden` | `scope_missing` | The grant or the token lacks the scope this route serves. |
| 404 | `not_found` | none | The grant or certificate is revoked, unknown, malformed or another partner's. |
| 409 | `conflict` | `stale_totals` | The `as_of` of a flight totals push is older than the grant's last accepted push. Nothing was applied. |
| 409 | `conflict` | `webhook_not_configured` | No webhook URL, one that is not https, or no secret on record. Ask MyPilotIndex to set them. |
| 422 | `unprocessable` | `hours_rule` | The totals, merged with the pilot's record, would break his hours rules. Nothing was applied. |
| 429 | `rate_limited` | `rate_limited` | The partner's daily allowance is used up. |
| 429 | `rate_limited` | `push_throttled` | The grant's last accepted flight totals push was less than 15 minutes ago. |

Other statuses you can meet: `401` for a missing or invalid token, `405` for a method the path does not take, `413` for a body over the route's limit, and `500`, `503` and `504` for failures on our side. Retry `429` after the time in `Retry-After`, and `500`, `503` and `504` with a growing delay. Do not retry `400`, `401`, `403`, `404`, `405`, `409`, `413` or `422` unchanged: fix the request, or for `409 stale_totals` send the logbook's current state.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.