Guides

Message status

A message is always in exactly one of five states. This page explains each, the fields that come with them, and how to follow a message without wasting requests.

GET/v1/messages/{id}needs the read permission

The five states#

StatusFinalMeaning
queuednoAccepted and waiting for the delivery worker.
retryingnoThe last attempt to hand it over failed for a temporary reason; another attempt is scheduled.
sentyesThe mail system accepted the message for delivery.
failedyesRefused for a reason that retrying cannot fix. error says why.
deadyesEvery scheduled retry failed. The hotel can send it again from its dashboard.

A message moves forward only: queued, then possibly retrying (more than once), then one of sent, failed or dead. If the hotel re-sends a dead or failed message from its dashboard, it starts again at queued.

The fields#

Response 200
{
  "id": "msg_01k6qzexample0000000000000",
  "status": "sent",
  "from": "booking@madagascarhotelags.com",
  "to": ["guest@example.com"],
  "cc_count": 0,
  "bcc_count": 1,
  "subject": "Your stay is confirmed",
  "scheduled_at": null,
  "created_at": "2026-10-01T15:04:05.000Z",
  "sent_at": "2026-10-01T15:04:06.412Z",
  "attempt": 1,
  "error": null,
  "delivery": null,
  "delivery_at": null,
  "suppressed": 0
}
FieldMeaning
toThe To addresses as accepted. Cc and Bcc addresses are not repeated; only their counts are.
sent_atWhen the mail system accepted it. null until then.
attemptHow many hand-offs were tried.
errorWhy it failed, for failed and dead only, up to 200 characters. Not a stable code: show it to a person, do not parse it.
deliveryThe verdict after sending: delivered, deferred, bounced, blocked, complained or unsubscribed. null until one arrives, which is not a failure. GET /v1/messages/{id}/events lists every step.
suppressedHow many recipients were skipped because they are on the suppression list.

You can only read messages sent with the same token. Any other id answers 404 not_found, exactly as if it did not exist.

Polling#

  • Check no more often than once every 10 seconds per message.
  • Stop at a final state.
  • Most messages are sent within a few seconds, so one check after 10 to 30 seconds is usually enough.
  • If you get 429, wait the seconds in Retry-After before any further request.

To react to bounces and complaints without polling, ask the hotel for a webhook. To react to failures, check messages in a periodic job (GET /v1/messages?status=failed) and alert on failed and dead. The recipes include one.

Last reviewed 2026-10-01.