Transactional Email
Invoices, confirmations and password resets sent through our API, from your verified domain, with every step logged.
Invoices, order confirmations, password resets and account notices: emails your system sends one by one, the very moment something happens to a customer.
Send from invoices@, info@ or any other address on your own verified domain, always with DKIM, SPF and DMARC.
Save the subject and body once, with {{name}}, {{amount}} and {{date}}; each request only carries the values.
Add invoices, receipts and tickets as PDF files, encoded in base64, up to 5 MB in total per email, in the same request.
Sent, delivered, bounced or marked as spam: each status goes into the log and reaches you by webhook, right away.
Tiered bands: each band only charges the emails of the month that fall in it.
One credit balance shared with E-mail Marketing and SMTP Relay, with no monthly fee.
Start with a Sandbox key, which validates your requests without sending anything or using credits. When you are ready, switch to a Production key.
sandbox_ in the API Center, with the email_center:write scope, and keep it on your server.POST /v1/email/messages and, once the Sandbox response is right, switch to the prod_ key.curl https://api.interweb.co.mz/v1/email/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: invoice-2026-214" \
-d '{"from": "[email protected]",
"to": "[email protected]",
"template_id": 12,
"variables": {"name": "João", "number": "FT 2026/214"}}'<?php
$ch = curl_init('https://api.interweb.co.mz/v1/email/messages');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
'Idempotency-Key: invoice-2026-214',
],
CURLOPT_POSTFIELDS => json_encode([
'from' => '[email protected]',
'to' => '[email protected]',
'template_id' => 12,
'variables' => ['name' => 'João', 'number' => 'FT 2026/214'],
]),
]);
$mail = json_decode(curl_exec($ch), true);
echo $mail['data']['status']; // sent, or simulated in Sandboximport requests
r = requests.post(
"https://api.interweb.co.mz/v1/email/messages",
headers={"Authorization": "Bearer YOUR_API_KEY",
"Idempotency-Key": "invoice-2026-214"},
json={"from": "[email protected]",
"to": "[email protected]",
"template_id": 12,
"variables": {"name": "João", "number": "FT 2026/214"}},
timeout=30,
)
print(r.json()["data"]["status"]) # sent, or simulated in Sandboxconst r = await fetch("https://api.interweb.co.mz/v1/email/messages", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "invoice-2026-214",
},
body: JSON.stringify({
from: "[email protected]",
to: "[email protected]",
template_id: 12,
variables: { name: "João", number: "FT 2026/214" },
}),
});
console.log((await r.json()).data.status); // sent, or simulated in Sandbox
{
"data": {
"id": "5120", "status": "simulated", "simulated": true,
"to": ["[email protected]"], "recipients": 1,
"subject": "Invoice FT 2026/214 is ready",
"template_id": 12, "charged": false, "suppressed": []
}
}
They all start at https://api.interweb.co.mz, with the key in the Authorization: Bearer header. The full list, with every field and response, is in the documentation.
Before the first send, your domain is verified. That is what separates an email that lands in the inbox from one that ends up in the spam folder.
| Record | What it does | Example |
|---|---|---|
| DKIMRequired | Signs every email, to prove it was not changed on the way. | em…._domainkey TXT v=DKIM1; k=rsa; p=… |
| SPFRecommended | Says that our servers may send on behalf of your domain. | TXT v=spf1 include:… ~all |
| DMARCRecommended | Tells the receiver what to do if a message fails the check. | _dmarc TXT v=DMARC1; p=none |
| MAIL FROMOptional | A subdomain of yours for bounces, which aligns SPF. | bounce CNAME … |
The exact values appear in Email Center when you add the domain, and the verification checks them for you.
When an invoice is issued, an account is created or an order ships, the customer gets the right message straight away. Nobody has to remember to write it.
Send the invoice with the PDF attached once it is issued, the receipt when payment comes in and a reminder before it is due.
Welcome emails, address confirmation, new sign-in alerts and password resets, with a link that only works once and expires soon.
Confirm the paid order, send a summary of what was bought and let the customer know when it leaves for delivery.
Each message goes through a series of statuses. The log keeps them and the webhook tells your system, so it can react without anyone watching.
The statuses of an email:
scheduledqueuedsentdeliveredbouncedcomplainedfailedsimulatedWho it went to, when it left and what happened to it, with filters and the stats for the month.
Addresses that bounce or complain stop receiving your emails, to protect your sender reputation.
A notice to your HTTPS address for every event, with a signature so you can confirm where it came from.
Set the time with send_at, up to 30 days ahead, and cancel if plans change.
Many emails in one request, each with its own recipient and variables.
If your software only speaks SMTP, use SMTP Relay with the very same domains.
Both keys use the same address and the same operations. The difference is what happens when you send.
sandbox_prod_simulated: true.[email protected] and [email protected].
Each key has its own scopes and can be revoked at any time. Requests always travel over HTTPS, with no exceptions.
email_center:read to look things up and email_center:write to send.
Optional: the key only works from the addresses that you list.
30, 90 or 365 days, or no expiry at all. Revoke it whenever you like.
With Idempotency-Key, the same request sent twice never sends twice.
Every notice carries X-Webhook-Signature, an HMAC-SHA256 with your secret.
Up to 5 MB per email, and executable files are always refused outright.
Pay only for the emails you send, at a price per 1,000. Each band charges only the emails that fall in it, and the price per 1,000 drops as you send more.
Each recipient counts as one email, and the bands start again at the beginning of each month. No monthly fee, and credits never expire.
Templates ready to copy. The inbox shows how they reach the customer.
Hello {{name}}, invoice {{number}} for {{amount}} is now ready and is due on {{date}}. It is attached, and you can pay it at {{link}}.
When the invoice is issued.Hello {{name}}, we received a request to change your password. Use this link within the next 30 minutes: {{link}}. Not you? Just ignore this email.
Right after the request.Hello {{name}}, order No. {{number}} has been paid and is already being prepared. You will get another email when it leaves for delivery, with the courier's contact.
After the payment.Hello João, invoice FT 2026/214 for MZN 2,450.00 is now ready and is due on 30/11/2026. It is attached, and you can pay it at yourcompany.co.mz/pay.
Hello João, we received a request to change your password. Use this link within the next 30 minutes: yourcompany.co.mz/reset. Not you? Just ignore this email.
Hello João, order No. 8812 has been paid and is already being prepared. You will get another email when it leaves for delivery, with the courier's contact.
Click a template or an email to see how it arrives.
The habits that keep your emails in the inbox and well away from the spam folder.
Idempotency-Key on retries.
Everything you need to integrate, with examples in cURL, PHP, Python and Node.js.
Articles to help you choose, set up and get the most from this service
The short answer: an API is the agreed way for one program to ask another for something. Instead of a person opening a page and clicking, your site sends…
Read the article
The short answer: if an API key, a token or a webhook secret has turned up somewhere it should not (a public repository, a file inside the site, a…
Read the article
To talk to an API from PHP you use cURL: open a request, send it, read the status code (200, 401, 404…) and only then decode the JSON in…
Read the article
The most frequent questions about transactional email through the API
It is an email sent to one person because of something they did or something that concerns them: an invoice, an order confirmation, a password reset or an account notice. It is not advertising.
Yes. Add the domain in Email Center and publish the DKIM record we give you (required) and, ideally, SPF and DMARC too. The verification checks them for you, and after that you can send from any address on that domain.
Yes, such as invoices, receipts or tickets in PDF, sent in base64 inside the request itself. By default, up to 5 MB in total per email; executable files are refused.
The API is the most complete option, with templates, attachments and JSON responses. SMTP Relay is for software and websites that can only send over SMTP. For newsletters and promotions, use Email Marketing.
Yes, with the send_at field (ISO 8601, up to 30 days ahead), and cancel it before the time with POST /v1/email/messages/{id}/cancel. Credits are only used when the email goes out.
Buy credits with the “Buy credits” button, add your domain in Email Center and create a key in API Center. The price is per 1,000 emails a month, in tiered bands: $5.25 for the first 1,000, $0.83 per 1,000 from 1,001 to 10,000 and $0.53 per 1,000 above that. The maths is under Pricing. Credits are one single balance, shared with E-mail Marketing and SMTP Relay, and each transactional e-mail uses 1 credit.
Yes. Save templates with the subject, the HTML and the text, with variables such as {{name}}, and send by giving the template_id and the values for each email in variables.
Hard bounces and complaints go straight to the suppression list, and those addresses stop receiving. Sends to them are dropped from the request before sending and are never charged. You can view and manage the list through the API.
Yes. With a Sandbox key the request is validated and the full response comes back, but no email is sent and nothing is charged. Send to [email protected] or [email protected] to simulate a bounce or a complaint.
Sent, delivered, bounced, complained and failed, one notice per event and recipient, signed with X-Webhook-Signature. If your server does not answer within 5 seconds, we try again up to five more times.
Get Interweb's Fast and Secure Web Hosting Plan with a FREE Domain!