NevTan Mail is secure, ad-free business email on your own custom domain with a REST API and webhooks included — read, search, send and reply to mail, and provision mailboxes with an admin key. This guide is for developers who need to automate a real mailbox rather than blast transactional mail, and it covers the distinction most "email API" articles skip entirely. For the full product picture, see our complete NevTan Mail platform guide.
Search for "email API" and you will mostly find transactional senders — SendGrid, Postmark, Resend, Mailgun. Those send mail; they do not give you a mailbox you can read, search and reply from. If your automation needs to react to incoming mail on your own domain, you need a mailbox API, and the usual options there are the Gmail API or Microsoft Graph. Both work, and both carry real overhead: Gmail's restricted scopes require an annual third-party security assessment starting around $675 and running to $5,400, plus verification that takes weeks. NevTan Mail gives you an API key, 120 requests per minute, and webhooks on email.received, email.sent and mailbox.created — no OAuth verification process, no security assessment, no seven-day token expiry.
The Distinction That Trips Up Most Developers
This is the single most useful thing to get straight before you write any code, because picking the wrong category costs you a rewrite.
Transactional email APIs — SendGrid, Postmark, Resend, Mailgun, Amazon SES — exist to send mail at volume and report on what happened to it. Password resets, receipts, order confirmations, notifications. They are excellent at that job. What they do not give you is a mailbox: there is no inbox to read, no thread to search, no conversation to reply into. Some offer inbound parsing that forwards received mail to a webhook, but you are receiving a parsed payload, not operating a mailbox.
Mailbox APIs — the Gmail API, Microsoft Graph, and NevTan Mail's REST API — operate an actual account. You can list and search messages, read a thread, send as that address, reply inside an existing conversation, and manage folders. This is what you need when the automation is about correspondence rather than notifications.
The test is simple: does your automation need to read mail that arrived from a human? If yes, you need a mailbox API. If you are only pushing outbound notifications, a transactional sender is the cheaper and more appropriate tool — and you should keep that traffic separate from your business correspondence anyway, for reasons our guide to transactional vs marketing emails covers.
A related choice sits underneath this one: API, IMAP, or SMTP. SMTP sends and nothing else. IMAP reads a mailbox but requires you to poll it, holds connection state, and handles folders and read flags awkwardly. A REST API gives you both directions with normal HTTP semantics. Our comparison of IMAP, SMTP and API integrations works through when each is genuinely the right pick.
What You Need Before Starting
A mailbox on a domain you control. Automations act as an address, and that address should be on your own domain rather than a consumer account — see business email on your own domain if you are not set up yet.
Working authentication on that domain. If SPF, DKIM and DMARC are not configured, anything your automation sends is liable to be filtered, and you will spend a day debugging your code when the problem is DNS. NevTan Mail generates all four records with copy buttons and rechecks them every thirty seconds until they pass. Our guides to domain authentication and deliverability best practices cover the setup.
An API key. In NevTan Mail this lives in developer settings. You will want two: a standard key for reading and sending, and an admin key only if you need to provision mailboxes. Treat both as credentials, not configuration.
An HTTPS endpoint for webhooks. Any public URL that accepts POST. For local development, a tunnel such as ngrok or Cloudflare Tunnel works fine.
A decision about what you are automating. The most common failure mode in this area is a technically correct integration that nobody uses, because it automated something that was not actually a problem.
On the code below. The examples show the shape of each call — method, payload structure, and the order of operations. Confirm exact endpoint paths, header names and field names against your API reference before you ship, since those differ between providers and versions.
Your First Five Calls
1. Authenticate
API key authentication, sent as a bearer token. No OAuth dance, no consent screen, no token refresh loop.
curl https://api.nevtan.com/v1/messages \
-H "Authorization: Bearer $NEVTAN_API_KEY"
Keep the key in an environment variable or a secrets manager. Never in source control, never in client-side code — a key in a browser bundle is a key that has been published.
2. Send a message
curl -X POST https://api.nevtan.com/v1/messages \
-H "Authorization: Bearer $NEVTAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["client@example.com"],
"subject": "Invoice 2184 attached",
"text": "Hi — invoice 2184 is attached, due 14 December.",
"html": "<p>Hi — invoice 2184 is attached, due 14 December.</p>"
}'
Send both text and html. A multipart message renders correctly in every client and looks less like bulk mail to filters than HTML alone.
3. Search the mailbox
curl -G https://api.nevtan.com/v1/messages/search \
-H "Authorization: Bearer $NEVTAN_API_KEY" \
--data-urlencode 'q=from:client@example.com has:attachment' \
--data-urlencode 'limit=25'
Search is where a mailbox API earns its keep. The same operators you use in the web interface — from:, has:attachment, larger:, after:, before: — are available programmatically.
4. Reply inside a thread
curl -X POST https://api.nevtan.com/v1/messages/{message_id}/reply \
-H "Authorization: Bearer $NEVTAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Thanks — confirming receipt. We will process this today."
}'
Replying to a message ID rather than composing a new one keeps the conversation threaded in the recipient's client. Composing fresh and pasting Re: into the subject does not thread, and recipients notice.
5. Provision a mailbox (admin key)
curl -X POST https://api.nevtan.com/v1/admin/mailboxes \
-H "Authorization: Bearer $NEVTAN_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"address": "newhire@yourcompany.com",
"display_name": "New Hire"
}'
This is the call that makes staff onboarding automatable end to end, and it is the one most teams do not realise they have.
Webhooks: Stop Polling
The architectural point of this whole guide. Three events are available:
Event | Fires when |
|---|---|
| A message arrives in the mailbox |
| A message is sent from the mailbox |
| A new mailbox is provisioned on your domain |
Register an endpoint, subscribe to the events you need, and each one arrives as an HTTP POST with a JSON body. Failed deliveries are retried up to 12 times, which covers transient outages — though not an endpoint that is simply wrong or offline, so verify yours is live before you depend on it.
A minimal receiver:
import express from 'express';
const app = express();app.post('/hooks/nevtan', express.json(), async (req, res) => {
// Acknowledge immediately — do the work afterwards.
res.sendStatus(200);
const { event, data } = req.body;
if (event !== 'email.received') return;
if (/invoice/i.test(data.subject)) {
await queue.add('process-invoice', {
from: data.from,
subject: data.subject,
messageId: data.id,
});
}
});
app.listen(3000);
Two things in that handler matter more than they look.
Acknowledge before you work. Return 200 immediately, then process asynchronously. If you do fifteen seconds of work before responding, you risk a timeout, a retry, and the same email processed twice.
Make the handler idempotent. Retries exist, which means duplicate deliveries happen. Key your processing on the message ID so a second delivery of the same event is a no-op. This is the single most common source of "why did the client get three copies of that confirmation."
If you would rather not write and host a receiver at all, Zapier's Catch Hook gives you a URL that parses the payload into mappable fields — our guide to connecting your business email to Zapier covers the no-code route.
Five Automations Worth Building
1. Log every enquiry. email.received on your sales address, filtered against known suppliers, appended to a database or sheet. Trivially simple, and it converts an inbox into something you can count. Most teams discover something about their own business within a month of running it.
2. Auto-acknowledge with context. Reply within seconds confirming receipt and setting an expectation. Because you have the full mailbox, you can check whether this sender has written before and vary the reply for first-time versus returning contacts.
3. Onboard staff end to end. mailbox.created triggers account creation in your other tools, directory updates, and a welcome sequence. The underused event of the three.
4. File attachments automatically. email.received filtered on attachments and subject, with the file written to object storage in a dated path. Your accountant will thank you in January.
5. Escalate on silence. Combine email.sent with a scheduled job: if a thread you sent has no reply after N days, raise a task. This is the automation that recovers revenue, because quotes and proposals mostly die from inattention rather than rejection. NevTan Mail does a version of this natively with AI follow-up nudges — reading threads awaiting a reply in both directions, ignoring thank-yous and FYIs, noticing deadlines like "by Friday" to time the reminder, and surfacing a ready-written follow-up. Check whether the built-in feature covers your case before building it yourself; our piece on how AI is changing the inbox covers the wider shift.
Before building any of these, check the native feature list. Vacation responders, filters, forwarding and snooze already exist in the product and cost nothing to run — rebuilding an out-of-office responder against the API is work you can simply not do, as our guide to out-of-office automation shows. The same applies to calendar and task automations where those already share a workspace, per email, calendar and tasks in one workspace.
Rate Limits, Honestly
NevTan Mail allows 120 requests per minute per API key. Here is the honest comparison with the incumbents:
NevTan Mail | Gmail API | Microsoft Graph (Outlook mail) | |
|---|---|---|---|
Rate limit | 120 req/min per key | 6,000 quota units/min per user | 10,000 req/10 min per app+mailbox |
Concurrency cap | Not published | Unpublished; 429 on exceed | 4 in flight per app+mailbox |
Push notifications | Webhooks, 12 retries |
| Subscriptions with renewal |
Verification to read mail | API key | Restricted-scope review + annual assessment | Azure app registration + admin consent |
Sending cap | — | 2,000/day Workspace, 500/day personal | 30 messages/min per mailbox |
In raw throughput, 120 requests per minute is lower than both. If you are building a mail client serving thousands of users, that matters and you should plan around it or talk to us.
For the automations this guide describes, it rarely binds — and the reason is architectural. Gmail's quota is consumed by polling: messages.list costs 5 units, messages.get costs 20, and history.list costs 2, so a loop checking for new mail burns quota continuously whether or not anything arrived. A webhook-driven design spends nothing while the mailbox is quiet and makes one or two calls when something actually happens. Push beats poll on rate limits the way it beats poll on latency.
Note also Microsoft Graph's concurrency limit of four simultaneous requests per app and mailbox pair — not four per minute, four in flight. Developers routinely discover that one in production after building a parallel processing pipeline.
The Compliance Overhead You Skip
This is the part that decides build-versus-buy for a lot of teams, and it is rarely mentioned in beginner tutorials.
To read a user's Gmail from a server, you need a restricted scope — gmail.readonly, gmail.modify, gmail.compose or full access. Restricted scopes require Google's restricted-scope verification and, when message data reaches your server, an annual third-party security assessment under the App Defense Alliance CASA framework. Google assigns the level based on factors including your user count and scopes; one authorised lab lists pricing from $675 for AL1 and $5,400 for AL2, renewable every twelve months. Verification itself can take weeks or months depending on what you are requesting.
Until you are approved, the practical constraints bite: unverified apps display a warning screen and are capped at 100 new users, and in Testing mode refresh tokens expire after seven days — which means your integration breaks weekly during development. There are exemptions for personal-use apps, apps limited to a handful of known users, and apps marked Internal within your own Workspace organisation, so a purely internal tool may avoid the process. A product you intend to ship to customers will not.
Microsoft Graph has no equivalent paid assessment, but you are registering an Azure application, requesting Mail.Read or Mail.Send permissions, and often needing tenant admin consent — straightforward inside your own organisation, a sales conversation in someone else's.
NevTan Mail's API is an API key you generate in settings. For an internal automation on a domain you already control, that is the difference between shipping this afternoon and shipping next quarter.
Security
The key is a credential. Environment variables or a secrets manager, never source control or client-side code. Rotate on any suspicion and whenever someone with access leaves.
Separate your keys. A standard key for reading and sending; the admin key only where mailbox provisioning actually happens. An admin key in a web application is an unnecessary blast radius.
Your webhook endpoint is a public URL that causes things to happen. Anyone who learns it can POST fabricated data. At minimum, append a shared secret to the registered URL and reject requests without it. Where your provider signs payloads, verify the signature.
Scope what leaves the mailbox. Webhook payloads carry message content — sender, subject, usually the body — and that content travels onward to every system in your pipeline, each with its own retention. Audit the chain before connecting anything handling confidential correspondence. Our overview of email encryption for business covers what protection travels with a message and what does not, and our privacy policy sets out how we handle data on our side.
Anything you send automatically is still subject to deliverability rules. Automated acknowledgements that start landing in spam are worse than no acknowledgement, because you believe they arrived — see why emails go to spam and how to fix it. And because automations touch authentication and sender reputation, it is worth understanding phishing protection and TLS before you put a reply flow into production.
Common Mistakes
1. Reaching for a transactional API when you need a mailbox. Discovered three weeks in, when "reply to the sender in-thread" turns out to be impossible. Fix: Decide the category first.
2. Polling instead of subscribing. Burns rate limit, adds latency, scales badly. Fix: Webhooks for anything event-shaped.
3. Doing the work before acknowledging the webhook. Timeouts become retries become duplicates. Fix: 200 first, queue second.
4. Assuming webhook delivery is exactly-once. It is at-least-once; retries exist. Fix: Key on message ID and make handlers idempotent.
5. Shipping without authentication configured. You will debug your code for a day over a missing DKIM record. Fix: Verify SPF, DKIM and DMARC before the first API call.
6. Rebuilding features that already exist. Filters, forwarding, vacation responders and snooze ship in the product. Fix: Read the features page before you write the first line.
7. Testing with a trivial payload. A one-word test email with no attachment and no reply-to leaves half your fields unexercised. Fix: Test with something that resembles real traffic.
Frequently Asked Questions
What is the best email API for developers who need to read and reply to mail?
For reading, searching and replying to mail on your own domain, you need a mailbox API rather than a transactional sender. The main options are the Gmail API, Microsoft Graph, and NevTan Mail's REST API. Gmail and Graph offer higher raw throughput; NevTan Mail offers an API key with no verification process, webhooks with automatic retries, and mailbox provisioning via an admin key. Transactional services like SendGrid and Postmark send mail but do not provide a mailbox you can operate.
What is the difference between a transactional email API and a mailbox API?
A transactional API sends outbound mail at volume and reports delivery — password resets, receipts, notifications. A mailbox API operates an actual account: list and search messages, read threads, send as that address, and reply inside existing conversations. If your automation reacts to mail a human sent you, you need a mailbox API.
Does NevTan Mail have a REST API?
Yes. The REST API reads, searches, sends and replies to mail, and creates mailboxes with an admin key, at 120 requests per minute per key. Webhooks fire on email.received, email.sent and mailbox.created, retried up to 12 times.
What webhook events are available?
Three: email.received when a message arrives, email.sent when one is sent from the mailbox, and mailbox.created when a new mailbox is provisioned on your domain. Most automations are built on email.received; mailbox.created is the one for staff onboarding.
What are NevTan Mail's API rate limits?
120 requests per minute per API key. Because the API is paired with webhooks, event-driven automations consume very little of that — you are not spending requests polling for mail that has not arrived.
Do I need OAuth verification or a security assessment to use the API?
Not with NevTan Mail — you generate an API key in settings. By contrast, reading mail through Gmail's restricted scopes requires restricted-scope verification and, where data reaches your server, an annual CASA security assessment; one authorised lab lists pricing from $675 for AL1 and $5,400 for AL2, renewed every twelve months, with verification taking weeks to months.
Should I use the API or IMAP?
The API, for almost all automation. IMAP requires polling, holds connection state, and handles folders and read flags awkwardly, so it is better suited to reading historical mail than reacting to new mail. The API plus webhooks gives you both directions with ordinary HTTP semantics.
Can I build automations without writing code?
Yes. Zapier's Catch Hook gives you a URL that parses webhook payloads into mappable fields, so you can connect your mailbox to thousands of apps without hosting anything. Note that Webhooks by Zapier is a premium app requiring a paid plan.
Is the API available on the free plan?
Check your current plan in developer settings before building, since feature availability by tier can change. The features page lists what is included where, and our terms of service cover API usage conditions.
How do I secure a webhook endpoint?
At minimum, append a shared secret to the URL you register and reject any request that does not carry it. Verify payload signatures where available. Treat the URL itself as a credential: anyone who has it can POST data that triggers your automation.
Start Building
A mailbox API turns your inbox from a place where work arrives into a place where work starts. Setup is an API key and a webhook URL; the ongoing cost is close to nothing; and the result is that enquiries get logged, attachments get filed, and nothing sits unnoticed in a shared inbox.
NevTan Mail gives you the pieces: a REST API to read, search, send and reply at 120 requests per minute per key, an admin key for provisioning, webhooks on email.received, email.sent and mailbox.created with retry handling, and underneath it secure, ad-free business email on your own domain with calendar, meetings, tasks, role-based admin controls, TLS everywhere and content encrypted at rest. Your mail is never used to train AI. The principles behind the product explain how we think about all of it.
If you are weighing the cost of getting set up, our guide to cheap business email for startups compares the realistic options, and why teams are switching to modern webmail covers what you get beyond the API. More guides are on the NevTan Mail blog.
Ready to build? Start free with NevTan Mail — ten mailboxes on your own domain, no card needed.
