Email API for Multi-Tenant SaaS (2026): Per-Domain Keys on Rovela
How multi-tenant SaaS apps send as each customer with Rovela: verify each domain, restrict a sending_access key to that domain, and keep full_access off the send path.
A multi-tenant email API is about isolation, not a special verb
A multi-tenant SaaS often has to send mail as each customer: billing@acme.com for one tenant, hello@other.co for another. The danger is not the HTTP call — it is a leaked credential or a bug that lets tenant A send as tenant B. Rovela does not invent a separate “tenant” object in the Emails API. What it does document is the isolation you actually need: each sending domain is verified on its own, and a key can be restricted to a single domain, so a leaked key cannot be used to send as anybody else (Authentication).
This is distinct from Email API for SaaS Apps (lifecycle mail for your product: codes, invites, receipts) and from Verified Domain Email API (how verification itself works). Credential design is Email API Authentication.
Start from the Email API product page, the Quick Start, the Send Email API, and Authentication.
Related product guides in this series:
- Transactional Email Service
- REST Email API
- Email API for Startups
- Send Email Programmatically
- Email API vs SMTP Relay
- Transactional Email Provider
- Email Delivery Status API
- Email API Authentication
- HTML Email API
- Email API Retries
- Receipt Email API
- Email API Logs
- Email API Rate Limits
- Transactional Email Infrastructure
One organization, many verified domains
Rovela organizations can hold multiple sending domains. Pricing lists 1 domain on Free, 5 on Pro, and 50 on Enterprise; limits can be raised for a single organization if you need more. Before any tenant’s from address is accepted, that domain has to be added and verified — SPF, DKIM, DMARC, and return-path — through the dashboard or the Domains API (POST /domains, POST /domains/:id/verify). Domain management needs a full_access key or a session; a sending_access key is refused with 403.
Operationally, that usually means:
- The tenant proves they control
customer.com(or a subdomain such asmail.customer.com) and publishes the records Rovela generated for that domain. Do not copy DKIM values from another tenant (Domain setup guide, What Is an Email Domain?). - You send with
fromon that verified domain only. Afromon a domain that is not in the organization, or is still unverified, is refused with400. - You create a
sending_accesskey restricted to that domain for the worker that sends as that tenant. A leak then cannot send as a different customer.
GET /domains and GET /domains/:id (full access) are how tooling lists status and DNS records. DELETE /domains/:id removes the domain; mail from it is refused afterwards, and the DNS records (which belong to the customer) are left alone.
What the send path looks like
The send itself is still POST /emails. The tenant-specific parts are the key, the from address, and an Idempotency-Key that includes the tenant and the business action:
curl -X POST https://api.rovela.dev/emails \
-H "Authorization: Bearer re_your_sending_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: receipt-order-1042" \
-d '{
"from": "Acme <receipts@mail.acme.com>",
"to": "alice@example.com",
"subject": "Your Acme receipt for order 1042",
"html": "<p>Thanks for your order.</p><p>Order <b>1042</b> — total <b>$42.00</b>.</p>",
"text": "Thanks for your order. Order 1042 — total $42.00.",
"tags": { "kind": "receipt", "orderId": "1042" }
}'
In production code, MAIL_FROM and ROVELA_API_KEY should be per tenant (or looked up per tenant), not one global pair that can From: anyone in the organization. Keep full_access for an admin tool that provisions domains and inspects GET /emails/:id; do not ship it in the multi-tenant send worker (Email Delivery Status API, Email API Retries).
If the product also gives tenants a human inbox on the same domain, that is a mailbox — webmail, IMAP, and mailbox SMTP as themselves — not a high-volume app relay (Transactional Email API + Hosted Mailboxes, Email API vs SMTP Relay).
What this article will not invent
- No per-tenant billing objects, dedicated IPs, or automatic domain-delegation APIs beyond the documented Domains API.
- No claim that one
sending_accesskey is automatically isolated without the domain restriction being set. - No change to quota accounting: monthly allowance and the 50-recipient cap still apply per organization and are shared by everyone in it (Pricing, Email API Rate Limits). Plan for that when many tenants share one org.
A small isolation checklist
- Provision and verify the tenant’s domain before the first send.
- Issue a domain-restricted
sending_accesskey; store it in a secret scoped to that tenant. - Derive
Idempotency-Keyfrom tenant id plus action id. - On
400naming a domain, treat it as a provisioning bug (wrong org, unverified, or typo), not as a transient network error. - Use webhooks and tags (for example
tenantId) so bounce handling can be attributed without opening afull_accesskey on the send path (Transactional Email Webhooks, Email Bounce Handling).
FAQ
Can many tenants share one sending domain, such as mail.myapp.com? Yes, if you are sending as yourself (your product’s domain) to their users. That is ordinary SaaS transactional mail (Email API for SaaS Apps), not sending as the customer’s domain. Domain-restricted keys still help you isolate environments (staging vs production).
Do I need one Rovela organization per tenant? The documented model is domains and optional per-domain keys inside an organization. Splitting organizations is an operational choice you can make; it is not required by the API, and this article will not invent tenancy billing around it.
Who publishes DNS? The customer (or you, if you already run their DNS). Rovela generates the records; verification checks that they are published (Domains API).
Isolate the key, not just the From header
A From header is easy to get right in happy-path code and easy to get wrong in a retry, a shared worker, or a leaked secret. Verify each tenant domain, restrict each sending key to that domain, and keep full-access credentials off the send path. That is multi-tenant use of Rovela as the current docs describe it.