The short answer: three steps. Turn on Email Center on the Transactional e-mail page in Meu Interweb, verify your domain with the DNS records we give you, and send with a POST /v1/email/messages request. Before going live, test with a Sandbox key: nothing is sent and nothing is charged.
What you need
| 1 |
Email Center active on your account. You turn it on in Meu Interweb, on the Transactional e-mail page. Without it, the API answers 403 with the reason email_account_required.
|
|
| 2 |
An API key with the email_center:write permission to send and make changes, and email_center:read to look things up. Careful: email:read and email:write are different permissions, for hosting mailboxes.
|
|
| 3 |
A domain of your own, where you can change the DNS. Free mailbox domains such as gmail.com are not accepted as senders.
|
|
Step by step
| 1 |
Turn the service on. Open the Transactional e-mail page in Meu Interweb and activate it. The page has the sections you will need: domains, sending, templates, history, statistics and suppressions.
|
|
| 2 |
Add your domain and publish the records it shows in your DNS: three DKIM CNAME records (required), an SPF TXT record and a DMARC TXT record (recommended). Details in adding a sender domain.
|
|
| 3 |
Click Verify (or call POST /v1/email/domains/{domain}/verify). DNS can take a few hours to spread. Once the DKIM records are live, the domain becomes verified.
|
|
| 4 |
Create the API key in Meu Interweb, with only the Email Center permissions. Start with a Sandbox key.
|
|
| 5 |
Make your first request with the sender, the recipient, the subject and the content. See the example below.
|
|
| 6 |
Check the result in the history on the page or with GET /v1/email/messages/{id}.
|
|
Your first request
curl https://api.interweb.co.mz/v1/email/messages \
-H "Authorization: Bearer sandbox_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: fatura-2026-214" \
-d '{"from": "Invoices <invoices@asuaempresa.co.mz>",
"to": ["ana@example.com"],
"subject": "Your invoice is ready",
"text": "Hello Ana, your invoice is now available."}'
The answer has the id of the e-mail and its status. With a Sandbox key the status is simulated; with a Production key and no send_at, the e-mail goes out straight away and the answer has its real status. Every field is in the fields of POST /v1/email/messages.
|
Always send the Idempotency-Key header, with one unique value per e-mail (the invoice number, for example). If the connection drops and your system repeats the request, the e-mail does not go out twice.
|
|
An API key is a password. Keep it on the server, never in page code or a public repository. If it has been exposed, follow what to do when a key leaks.
|
|
Want your application sending e-mail from your own domain? See the API and talk to us about Email Center.
See the API page
|
RECOMMENDED PRODUCT Register your .co.mz domain Secure your company name before someone else registers it. from 3.751,20 MT/yr Search a domain |