Email API
Add and verify sending domains, manage destination addresses, and read what your Workers sent.
On this page
The settings behind a Worker's send_email binding. They belong to the account and serve every project it owns. See Email for how sending works.
/ emailDomains, destinations, sending Workers and this month's count/ email/ domainsAdd a sending domain/ email/ domains/ {domain}/ verifyCheck its DNS records now/ email/ domains/ {domain}Remove a sending domain/ email/ destinationsAdd a destination and mail it a confirmation link/ email/ destinations/ {address}Remove a destination/ email/ activityThe last 100 messagesAdd a sending domain
curl -X POST https://api.fortly.com/email/domains \
-H "Authorization: Bearer $FORTLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"domain": "mail.example.com"}'Answers 201 with the domain and the records to publish:
{
"domain": "mail.example.com",
"state": "pending",
"records": [
{ "purpose": "ownership", "type": "TXT", "name": "mailjet._1a2b3c4d.mail.example.com", "value": "1a2b3c4d…", "status": "pending", "required": true },
{ "purpose": "dkim", "type": "TXT", "name": "mailjet._domainkey.mail.example.com", "value": "k=rsa; p=…", "status": "pending", "required": true },
{ "purpose": "spf", "type": "TXT", "name": "mail.example.com", "value": "v=spf1 include:spf.mailjet.com ~all", "status": "pending", "required": false }
],
"created_at": 1792303200,
"checked_at": null,
"verified_at": null,
"last_error": null
}A domain becomes verified once its required records check out. Fortly re-checks a pending domain every five minutes for three days after it is added; verify checks at once, at any time. A domain verified by another account answers 409.
Add a destination
curl -X POST https://api.fortly.com/email/destinations \
-H "Authorization: Bearer $FORTLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"address": "me@example.com"}'Answers 201 with { "address": "me@example.com", "confirmed": false } and mails the address a confirmation link. Calling it again for an address still waiting sends the link again. An address that is already confirmed answers 200 with "confirmed": true.
Activity
GET /email/activity takes an optional ?project=. Each message has sender, recipients, subject (the MIME Subject header for a raw message when readable; otherwise null), bytes, result (sent, refused or failed), detail (the reason, when it was not sent) and at.
The response wraps the newest 100 entries in messages. These routes configure outbound sending; they do not provision incoming routing or a Worker’s email() handler. See Email for setup, binding restrictions and monthly allowances.