> The index of all pages is at https://docs.afffast.com/llms.txt.

# Error codes

Each error of the API has a code. Find the code here to see its cause and its fix.

Each error response has the same form. The field `error.code` is stable. Use it in your code. The field `error.doc_url` links to the page of the code. The field `error.request_id` identifies the request. Send it to support. See [Errors](https://docs.afffast.com/docs/errors.md) for the form of the envelope.

| Code                                                                       | Status | Type                    | Meaning                                                                                   |
| -------------------------------------------------------------------------- | ------ | ----------------------- | ----------------------------------------------------------------------------------------- |
| [`api_version_unsupported`](https://docs.afffast.com/errors/api-version-unsupported.md)               | 400    | `invalid_request_error` | The API version is not known.                                                             |
| [`connection_credentials_invalid`](https://docs.afffast.com/errors/connection-credentials-invalid.md) | 422    | `invalid_request_error` | The credentials do not match the network.                                                 |
| [`connection_disabled`](https://docs.afffast.com/errors/connection-disabled.md)                       | 409    | `invalid_request_error` | The connection is disabled. Only an operator can enable it.                               |
| [`connection_not_importable`](https://docs.afffast.com/errors/connection-not-importable.md)           | 409    | `invalid_request_error` | The connection does not take file imports.                                                |
| [`connection_not_syncable`](https://docs.afffast.com/errors/connection-not-syncable.md)               | 409    | `invalid_request_error` | The connection cannot run this sync now.                                                  |
| [`expand_invalid`](https://docs.afffast.com/errors/expand-invalid.md)                                 | 422    | `invalid_request_error` | The expand parameter is not valid.                                                        |
| [`import_file_too_large`](https://docs.afffast.com/errors/import-file-too-large.md)                   | 422    | `invalid_request_error` | The file is too large.                                                                    |
| [`import_invalid`](https://docs.afffast.com/errors/import-invalid.md)                                 | 422    | `invalid_request_error` | The file has errors. The API imported no row. Fix the rows in `details`.                  |
| [`link_destination_not_allowed`](https://docs.afffast.com/errors/link-destination-not-allowed.md)     | 422    | `invalid_request_error` | The destination is not on a domain that the program allows.                               |
| [`network_unavailable`](https://docs.afffast.com/errors/network-unavailable.md)                       | 422    | `invalid_request_error` | The network is not available in this mode.                                                |
| [`parameter_invalid`](https://docs.afffast.com/errors/parameter-invalid.md)                           | 422    | `invalid_request_error` | A parameter is not valid.                                                                 |
| [`program_deeplinks_unsupported`](https://docs.afffast.com/errors/program-deeplinks-unsupported.md)   | 422    | `invalid_request_error` | The program has no deeplink template, so it cannot make links.                            |
| [`request_body_invalid`](https://docs.afffast.com/errors/request-body-invalid.md)                     | 400    | `invalid_request_error` | The request body is not valid JSON.                                                       |
| [`request_invalid`](https://docs.afffast.com/errors/request-invalid.md)                               | 400    | `invalid_request_error` | The request is not valid.                                                                 |
| [`resource_already_exists`](https://docs.afffast.com/errors/resource-already-exists.md)               | 409    | `invalid_request_error` | A resource with this name already exists.                                                 |
| [`resource_not_found`](https://docs.afffast.com/errors/resource-not-found.md)                         | 404    | `invalid_request_error` | The resource does not exist.                                                              |
| [`route_not_found`](https://docs.afffast.com/errors/route-not-found.md)                               | 404    | `invalid_request_error` | The URL does not exist.                                                                   |
| [`api_key_in_query`](https://docs.afffast.com/errors/api-key-in-query.md)                             | 400    | `authentication_error`  | The request has an API key in the query string. Send the key in the Authorization header. |
| [`api_key_invalid`](https://docs.afffast.com/errors/api-key-invalid.md)                               | 401    | `authentication_error`  | The API key is not valid.                                                                 |
| [`authentication_required`](https://docs.afffast.com/errors/authentication-required.md)               | 401    | `authentication_error`  | The request has no valid credentials.                                                     |
| [`permission_denied`](https://docs.afffast.com/errors/permission-denied.md)                           | 403    | `permission_error`      | The API key cannot use this resource.                                                     |
| [`scope_insufficient`](https://docs.afffast.com/errors/scope-insufficient.md)                         | 403    | `permission_error`      | The API key does not have the scope for this request.                                     |
| [`test_mode_only`](https://docs.afffast.com/errors/test-mode-only.md)                                 | 403    | `permission_error`      | This resource works only in test mode. Use a test key (sk*test*...).                      |
| [`rate_limit_exceeded`](https://docs.afffast.com/errors/rate-limit-exceeded.md)                       | 429    | `rate_limit_error`      | Too many requests. Wait and try again.                                                    |
| [`idempotency_key_invalid`](https://docs.afffast.com/errors/idempotency-key-invalid.md)               | 400    | `idempotency_error`     | The Idempotency-Key header is not valid. Use 1 to 256 printable characters.               |
| [`idempotency_key_reused`](https://docs.afffast.com/errors/idempotency-key-reused.md)                 | 409    | `idempotency_error`     | This Idempotency-Key was used with a different request.                                   |
| [`idempotent_request_in_progress`](https://docs.afffast.com/errors/idempotent-request-in-progress.md) | 409    | `idempotency_error`     | A request with this Idempotency-Key is still in progress.                                 |
| [`internal_error`](https://docs.afffast.com/errors/internal-error.md)                                 | 500    | `api_error`             | An error occurred on our side. Try again later.                                           |
| [`plan_limit_reached`](https://docs.afffast.com/errors/plan-limit-reached.md)                         | 403    | `permission_error`      | The plan of the workspace has reached its limit. Upgrade the plan to go on.               |
