For developers

Email API

Send account email, answer people and read your inbox from your own app, without ever sending twice.

Which API key do I need to send email?

In API keys on your dashboard, make a key with Full access and limit it to one site. A read-only key, or one that reaches more than one site, is refused. So a key that leaks from one app cannot send as another site.

Keep it on your server. Never put it in a web page or a mobile app.

How do I send a sign-in link or a receipt?

POST https://asuito.com/api/v1/email/{domain} sends one email to one person. from must be on your site’s own domain, verified with the email provider the site uses. Use kind: "account" for email they need from your app, such as a sign-in link, receipt or password reset. Its links are never tracked.

Use kind: "invite" for email they did not ask for in that moment. It needs unsubscribe_url, an https address on your site, with the same address in text, and in html if you send one. Your app must stop email to whoever uses it. People who unsubscribed, bounced or reported spam are skipped. Set track_links: true to count its clicks, where your provider does.

text is required, up to 20,000 characters. Add html for your own design, up to 200,000. Add up to 10 attachments, 5 MB in all, each with a filename, base64 content and optional content_type. Attachments need Asuito Mail or Amazon SES.

bash
curl -X POST https://asuito.com/api/v1/email/example.com \
  -H "Authorization: Bearer $ASUITO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: sign-in-7f3a" \
  -d '{
    "kind": "account",
    "from": "hello@example.com",
    "from_name": "Example",
    "to": "ana@example.net",
    "subject": "Your sign-in link",
    "text": "Open https://example.com/sign-in?code=abc"
  }'

How do I retry without sending the same email twice?

Send an Idempotency-Key header of up to 256 characters, without spaces, that is different for each email. Make it once and use it for every retry. Keys are remembered for 30 days, so never retry after that. It is optional for /api/v1/email, and required for /api/v1/outreach. Do not put personal details in it.

The same key and the same email again answers sent: true and repeat: true, and sends nothing. The same key with a different email answers 409.

uncertain: true means it may have gone out, so do not send it again. Treat no answer at all the same way, unless you can retry with the same key. An error with retryable: true and uncertain: false can be tried again later, with the same key.

How do I answer people from my app?

GET https://asuito.com/api/v1/outreach/{domain}?since=2026-12-01T00:00:00Z lists your mailboxes, the email in your inbox and, as problems, your app’s emails that bounced or were reported as spam. answers is the Message-ID of your email that a reply answers, even when it came from another address. Ask again from a little before the newest one you have, and drop any id you already hold. problems_since does the same for problems.

POST https://asuito.com/api/v1/outreach/{domain} writes to one person from your default mailbox, or from the one in from. To answer somebody, put their email’s message_id in in_reply_to and send it to the address it came from. Anything else is a first email. A mailbox on your own domain cannot send one unless Asuito has turned that on, and answers not_allowed. Add html to send the same email designed: text is still required, for mail apps that show only text, so make both say the same. Links are never tracked.

The other reasons are no_mailbox, paused, suppressed, daily_limit, refused and unavailable.

bash
curl -X POST https://asuito.com/api/v1/outreach/example.com \
  -H "Authorization: Bearer $ASUITO_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: answer-42" \
  -d '{
    "to": "ana@example.net",
    "subject": "Re: Opening hours",
    "text": "We open at nine.",
    "in_reply_to": "<their-message-id@example.net>"
  }'

How does my app find out that an email bounced?

Add a webhook for your site and choose events under API email: email.delivered, email.bounced, email.complained, email.opened and email.clicked. They are sent only for email sent with this API, and only when your email provider sends delivery events to Asuito. A bounce is always a permanent one. Opens and clicks come only when your provider counts them.

Each is signed. x-asuito-signature is t=<seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of <t>.<the body exactly as it came> with your signing secret. Compare them in constant time, and refuse a t more than five minutes from now. The same event can come more than once, so drop any id you have seen. One that fails is tried again later.

json
{
  "id": "evt_0123456789abcdef01234567",
  "type": "email.bounced",
  "created_at": "2026-12-01T10:00:05.000Z",
  "site_id": "00000000-0000-4000-8000-000000000000",
  "data": {
    "email": {
      "id": "00000000-0000-4000-8000-000000000001",
      "provider_id": "0100018f-example-000000",
      "to": "ana@example.net"
    },
    "at": "2026-12-01T10:00:00.000Z"
  }
}

Limits

Each endpoint takes 60 requests a minute for your whole account, and reading and writing to the inbox are counted apart. Asuito Mail also has a daily limit for each site, shared by everything the site sends. Invites use only part of it, so they can never use up the sends that sign-in links need.

Email your app sends is recorded by its status, its time, your key and a fingerprint of the request. The address is kept only if the email bounces or is reported as spam. These records are deleted after 30 days. Email you receive stays in your inbox.