# Errors

Fonte: https://lunahia.com.br/en/docs/reference/errors

| HTTP status | Description |
| --- | --- |
| `400` | The body, query or identifier does not match the contract. Each item of campos gives the field and the reason, and the value you sent never comes back. Repeating the same request repeats the refusal. |
| `401` | The key is missing, malformed, nonexistent, expired or revoked. The body is always the same, without saying which. |
| `403` | The key lacks the scope the route requires. On a route that opens a number connection, also when the account cannot connect yet (connection_not_released). On the routes that write or send, also when the account is suspended: trial_expired (the free trial ended) or account_blocked (Helsen blocked the account). Suspension does not touch receiving: what arrives is still delivered to your webhook. A test key (mode test) only uses POST /v1/messages and POST /v1/test-mode/inbound-messages; on every other route it receives test_key_not_allowed. |
| `404` | The resource does not exist, or is not yours. The two answers are identical, byte for byte. |
| `409` | The request is well formed, but the resource state does not allow it. The error field says which case it is. |
| `410` | The connect link expired or was already used. The error field says which of the two. |
| `413` | The file is over the size ceiling, which is the same for every customer. |
| `415` | The body came with a content-type the route does not read. Send application/json, or multipart/form-data on the file routes. |
| `422` | The request is well formed and Luna passed it on, and Meta refused it. The meta field carries what happened, what to do and its original error. Repeating the same request repeats the refusal. |
| `429` | Too many requests, or a full queue. Wait the time in the Retry-After header and repeat. For POST /v1/messages, repeat with the same Idempotency-Key. |
| `503` | The platform cannot serve right now. Repeat after a few moments, with the same Idempotency-Key when there is one. |

| Error code (error) | HTTP status | When it happens |
| --- | --- | --- |
| `invalid_request` | 400 | Field refused, with the reason |
| `invalid_reset_token` | 400 | Invalid reset link |
| `unauthorized` | 401 | Key refused |
| `account_blocked` | 403 | Account blocked by Helsen |
| `connection_not_released` | 403 | Account not yet released to connect |
| `forbidden` | 403 | Insufficient scope |
| `test_key_not_allowed` | 403 | Test key on a route outside test mode |
| `trial_expired` | 403 | Free trial ended |
| `not_found` | 404 | Does not exist, or is not yours |
| `account_at_capacity` | 409 | The account that requested the link reached its maximum of numbers |
| `already_requeued` | 409 | Item already requeued |
| `idempotency_key_reused` | 409 | Idempotency-Key used with another body |
| `link_not_open` | 409 | Link that is not open |
| `media_not_ready` | 409 | Media not fetched yet |
| `message_not_cancelable` | 409 | Message that already left the queue |
| `no_webhook_endpoint` | 409 | No active webhook endpoint |
| `not_available_in_coexistence` | 409 | Unavailable in coexistence |
| `number_capacity_reached` | 409 | The account is already at its number capacity |
| `number_disconnected` | 409 | Number disconnected from Luna |
| `pin_not_applicable` | 409 | The number does not ask for a PIN |
| `reconnect_not_applicable` | 409 | The authorization does not allow reconnection |
| `register_budget_reserved` | 409 | Registration attempts reserved |
| `template_content_unknown` | 409 | Luna does not know the template content |
| `template_not_approved` | 409 | Template that is not approved yet |
| `webhook_endpoint_limit` | 409 | Endpoint limit |
| `window_closed` | 409 | Service window closed |
| `link_expired` | 410 | Link expired |
| `link_used` | 410 | Link already used |
| `file_too_large` | 413 | File over the ceiling |
| `unsupported_media_type` | 415 | Content type not read |
| `meta_rejected` | 422 | Meta refused the operation |
| `management_busy` | 429 | Account management busy |
| `number_rate_limited` | 429 | Number pace |
| `queue_full` | 429 | Send queue full |
| `rate_limited` | 429 | Request limit |
| `unavailable` | 503 | Unavailable |
