Send the hotel’s email from your own code.
One HTTPS request with a JSON body. The API checks it, answers with a receipt in about fifty milliseconds, hands the message to the mail system and keeps its status for you.
You need a token from Madagascar Pet Hotel. How tokens work
Your request
POST /v1/messages HTTP/1.1
Host: email.madagascarhotelags.com
Authorization: Bearer ems_k2q7…
Content-Type: application/json
Idempotency-Key: booking-4821
{
"to": ["guest@example.com"],
"subject": "Your stay is confirmed",
"text": "Luna checks in on Friday at 10:00."
}The receipt
HTTP/1.1 202 Accepted
Location: /v1/messages/msg_01k6qz…
{ "id": "msg_01k6qz…", "status": "queued",
"created_at": "2026-10-01T15:04:05.000Z" }How a message travels
Sending is asynchronous. The API accepts your message and answers at once; a separate delivery worker hands it to the mail system. You can ask where it is at any moment.
Accepted
The token, its limits, the sender and every field are checked. You get
26 to 117 ms of server time in our measurements202and a message id.Queued
The message waits for the delivery worker, which picks it up within about a second.
StatusqueuedSent
The worker hands it to the mail system and records the result. Temporary failures are retried for about seven hours.
Hand-off took 0.6 to 0.8 sDelivered
The recipient's mail server takes it from there. Delivery reports are not exposed yet, so the
Coming in a later releasedeliveryfield stays empty for now.
What you can count on
The rules are few and they do not change without notice. Each one links to the page that explains it.
- Retries never send twice
- Repeat a request with the same
Idempotency-Keyand you get the first answer back. Retries and idempotency - Errors you can act on
- Every refusal has an HTTP status, a stable
codeand, for limits, aRetry-After. All error codes - Tokens the hotel controls
- A token can be limited, given an expiry, rotated or blocked, and the change applies to the very next request. Tokens
- Only approved senders
- Mail leaves from addresses the hotel has approved, and people who unsubscribed or bounced are skipped automatically. Sending email
- A status you can check
GET /v1/messages/{id}says exactly where a message is, with the reason if it failed. Message status- Light and close to you
- Requests are answered on Cloudflare's network; checking one takes 1.5 ms of computing time at the median. Speed and latency
Find your way
Start with the quickstart; come back to the reference when you need a detail.
- QuickstartFrom token to a sent message in four requests, in the language you use.
- How it worksThe parts of the service, the standards it follows, and what it deliberately does not do.
- Request builderFill in a form, see the request checked as the API would, copy the code. Nothing is sent.
- Send a test emailPaste a token, fill in every field, press Send and see the API's full answer.
- Add it to your codeReady-made client modules for Node.js, Python, PHP, Go, C# and Cloudflare Workers.
- API referenceEvery endpoint, field, header and response, plus the OpenAPI document.
- PoliciesTerms, acceptable use, privacy, data processing, security, logging and access.