Reference
Errors
When the API refuses a request it says why, with a stable code you can switch on. This page lists every code and what to do about it.
The format#
Errors use the standard problem format (RFC 9457) with the media type application/problem+json.
| Field | Meaning |
|---|---|
type | Always about:blank: the status and code say everything. |
title | The HTTP status in words. |
status | The HTTP status code, repeated. |
detail | What went wrong, for a person. It can change wording; do not parse it. |
code | Stable machine-readable reason. Switch on this. |
request_id | The request's id. Quote it when you ask the hotel for help. |
Every code#
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_json | The body is not valid JSON. | Fix the body. Check quoting and trailing commas. |
| 400 | invalid_request | A field is missing, has the wrong type, or is out of bounds. detail names the field. | Fix the field named in detail. |
| 400 | unknown_field | The body has a field the API does not know. Unknown fields are refused, not ignored, so a typo never goes unnoticed. | Remove or rename the field. |
| 400 | invalid_address | An email address is not valid. | Fix the address named in detail. |
| 400 | too_many_recipients | to, cc and bcc together exceed the per-message limit. | Split the message, or ask the hotel to raise the limit. |
| 400 | invalid_schedule | scheduled_at is not an ISO 8601 time between 1 minute and 72 hours from now. | Send a time inside that window, or leave it out to send now. |
| 400 | invalid_idempotency_key | The Idempotency-Key header is not 1 to 128 letters, digits, ., _, : or - (at most 124 on a batch, which adds :<index>). | Fix the key. |
| 401 | invalid_token | No usable token: missing, malformed, unknown, wrong or deleted, or a test token with its test_ removed. All of these answer the same on purpose.Header: WWW-Authenticate: Bearer | Check the header and the token. If it was deleted, ask the hotel for a new one. |
| 401 | token_expired | The token has passed its expiry time. | Ask the hotel to renew it or issue a new token. |
| 403 | token_blocked | The token is blocked by the hotel. | Contact the hotel. Do not retry. |
| 403 | insufficient_scope | The token lacks the permission this endpoint needs (send or read). | Ask the hotel to add the permission. |
| 403 | client_paused | The hotel paused sending for the app this token belongs to. | Contact the hotel. Do not retry. |
| 403 | ip_not_allowed | The token may be used only from the addresses the hotel listed, and this request came from another. | Send from an allowed address, or ask the hotel to add yours. |
| 403 | template_not_allowed | The token may send only the templates the hotel chose, and this is not one of them. | Use a template from GET /v1/templates, or ask the hotel. |
| 403 | templates_only | The token may send templates only: a subject, html or text of its own is refused. | Send template_id and variables instead. |
| 403 | recipient_not_allowed | A recipient is outside the email domains the hotel allows for this app. detail names the domain. | Remove that recipient, or ask the hotel to allow the domain. |
| 403 | sender_not_allowed | The from address is not one this token may use, or the hotel switched that sender off for the API, or the token has no sender. | Use an address from GET /v1/me, or ask the hotel. |
| 404 | not_found | No such endpoint, or no message with that id for this token. | Check the path and the id. |
| 405 | method_not_allowed | The endpoint exists but not with this HTTP method. Header: Allow | Use the method in the Allow header. |
| 409 | not_cancelable | The message cannot be cancelled: it was not scheduled, it already went out or its time has come, it is already cancelled, or a test token sent it. | Nothing to do: GET /v1/messages/{id} shows where it is. |
| 411 | length_required | A file upload (POST /v1/attachments) came without a Content-Length, or with an empty body. | Send the file as the body with its length. |
| 413 | payload_too_large | The request body is over 256 KiB, or an uploaded file is over 4,000,000 bytes. | Send less content, or a smaller file. |
| 415 | unsupported_media_type | Content-Type is not application/json. | Send Content-Type: application/json. |
| 422 | idempotency_key_reuse | This Idempotency-Key was already used with a different body. | Use a new key for a new message. |
| 422 | unknown_template | No published, active template has that template_id. A template is sent only once the hotel publishes it, and an archived one is never sent. | Check the id with GET /v1/templates, or ask the hotel to publish it. |
| 422 | invalid_variables | variables does not fit the template: a required one is missing, one is unknown, or one has the wrong type. detail says which, and the X-Variable header names it.Header: X-Variable | Fix the variable named in detail. GET /v1/templates lists each type. |
| 422 | content_blocked | The content check refused the message: a link to an IP address, a link with a user name or password, a link to a blocked domain, or what looks like a payment card number. detail says which, and the X-Content-Rule header names the rule.Header: X-Content-Rule | Remove what detail names. Never send card numbers by email. |
| 422 | attachment_not_found | A message names an attachment this token did not upload, or one that has expired (files are kept 24 hours). | Upload the file again and use its new id. |
| 422 | attachment_refused | The check at upload (POST /v1/attachments) refused the file: it is a program or script, its contents are not the type its name says, or it carries macros, scripts, embedded files or a password that keeps it from being checked. detail says which. It is not stored. | Send the document without macros, scripts or a password, under its real file type. |
| 422 | attachments_too_large | A message's attachments are over 4,000,000 bytes together. | Send fewer or smaller files. |
| 429 | rate_limited | The token reached its per-minute limit, or sent more than 600 requests in a minute. Header: Retry-After | Wait the seconds in Retry-After, then retry. |
| 429 | daily_cap_reached | The token reached its daily limit (UTC day). Header: Retry-After | Wait until 00:00 UTC, or ask the hotel to raise the limit. |
| 429 | monthly_cap_reached | The token reached its monthly limit (UTC calendar month). Header: Retry-After | Wait until the first day of next month (UTC), or ask the hotel to raise the limit. |
| 429 | api_budget_reached | The API's shared daily allowance of recipients, for all tokens together, is used up. When it is set to zero, sending through the API is paused for the day. Header: Retry-After | Wait until 00:00 UTC. Do not retry in a loop. |
| 500 | internal | An unexpected fault on our side. It is reported to the hotel automatically. | Retry later with the same Idempotency-Key; quote request_id if it persists. |
| 503 | api_disabled | The hotel has switched the API off for everyone. Header: Retry-After: 60 | Retry later. |
| 503 | unavailable | The service is missing part of its configuration. | Retry later; quote request_id. |
| 503 | attachments_unavailable | Attachments are not switched on yet, or the file store cannot be reached right now. Header: Retry-After | Retry after the seconds in Retry-After. Messages without attachments are not affected. |
A request refused with 400, 401, 403, 404, 405, 413, 415, 422 or 429 changes nothing and uses no limit.
Reasons a message fails later#
These are not HTTP errors: the message was accepted, then could not be sent. They appear in the error field of GET /v1/messages/{id} with status failed or dead.
error text | Meaning | What to do |
|---|---|---|
| This sender is no longer allowed for the API. | The hotel withdrew the sender after the message was accepted. | Use a sender from GET /v1/me and send a new message. |
| All recipients are on the suppression list. | Everyone unsubscribed, bounced or complained before. | Do not send to them again. Remove the addresses from your list. |
| Every To recipient is on the suppression list. | Only Cc or Bcc addresses were left, and a message needs a To recipient. | Send to a different To address if appropriate. |
| A refusal from the mail system | For example an address the mail system will not accept. The text is passed on, cut to 200 characters. | Read it; fix the cause; send a new message. |
Other text with status dead | Every retry over about seven hours failed. | Ask the hotel: it can re-send the message from its dashboard. |
Retry or not#
| Answer | Retry with the same key? |
|---|---|
| Network error or timeout | Yes, with back-off |
429 rate_limited | Yes, after Retry-After |
429 daily_cap_reached, api_budget_reached | After 00:00 UTC, from your own queue |
| 500, 503 | Yes, with back-off or after Retry-After |
| Any other 400 to 422 | No: fix the request, the token or the id |
Last reviewed 2026-10-01.