Get started

How it works

A small service with a clear division of work: one part answers your requests quickly, another delivers the mail patiently. Knowing which is which explains almost every behaviour you will see.

The parts#

  1. Your server

    Holds the token and calls the API over HTTPS.

  2. The API

    Runs on Cloudflare's network. Checks the request, stores the message, answers 202.

  3. The delivery worker

    Takes queued messages, applies the hotel's sender and suppression rules, and hands them to the mail system.

  4. The mail system

    An established email delivery provider that sends from the hotel's verified domain.

The API never talks to the mail system itself, and it holds no credentials for it. That separation is why a request is answered in milliseconds even when the mail system is slow, and why a problem with delivery never makes the API refuse new messages: they wait in the queue and are retried.

What kind of API this is#

It is a REST API: resources with addresses, standard HTTP methods and status codes, JSON bodies, and no session state between requests. Each point below names the standard it follows, so your HTTP library will already know what to do.

AspectWhat the API doesStandard
TransportHTTPS only, TLS 1.2 or 1.3. Plain HTTP is redirected, and browsers are told to use HTTPS for 180 days (HSTS).RFC 9110, RFC 6797
StyleResource-oriented: POST /v1/messages creates a message, GET /v1/messages/{id} reads it. Stateless: every request carries its token.REST, Richardson level 2 (no hypermedia links beyond Location)
FormatRequest and response bodies are JSON in UTF-8. Times are ISO 8601 in UTC (2026-10-01T15:04:05.000Z).RFC 8259, RFC 3339
AuthenticationAuthorization: Bearer <token> on every request. A refusal carries WWW-Authenticate: Bearer.RFC 6750
Accepting work202 Accepted with a Location header that points to the message, because sending happens after the answer.RFC 9110, 202
Errorsapplication/problem+json with type, title, status, detail, plus a stable code and a request_id.RFC 9457
Back-offRetry-After in seconds on every limit refusal and on temporary unavailability.RFC 9110, Retry-After
Safe retriesIdempotency-Key request header.IETF draft (not yet an RFC)
DescriptionAn OpenAPI 3.1 document of every endpoint at /openapi.json.OpenAPI 3.1
VersioningThe major version is in the path (/v1). Additions never break v1; anything breaking would come as /v2.

It is not GraphQL, SOAP or an SMTP relay, and it does not use cookies.

Sending is asynchronous#

202 Accepted means the API has stored your message and queued it. It does not yet mean the email has left. In normal operation the message reaches sent within a few seconds; when the mail system is unavailable the delivery worker retries 5 times over about seven hours (after 30 seconds, 2 minutes, 10 minutes, 1 hour, 6 hours) before it gives up with dead.

So: respond to your own user as soon as you have the 202, keep the message id with your record, and check the status later if you need to.

What the hotel controls#

Every token is issued by the hotel and carries its own permissions, senders and limits. On top of that the hotel can, at any time and with effect on the very next request:

  • switch the whole API off (503 api_disabled);
  • set the shared daily allowance of recipients for all tokens (429 api_budget_reached);
  • approve or withdraw sender addresses (403 sender_not_allowed);
  • block, rotate, renew or delete any token.

What it does not do#

Knowing the edges saves time:

  • No attachments. Link to files instead; the body is limited to 256 KiB.
  • No marketing lists or campaigns. It is for transactional messages, one message to up to 10 recipients by default. See Acceptable use.
  • No receiving. Replies go to the sender or reply_to address, not to the API.
  • No browser use from your own site. There are no CORS headers, on purpose: a token in a web page is a token anyone can copy. The one exception is this site's Send a test email page, where you type the token yourself and it is never saved.

Last reviewed 2026-10-01.