API email — also called an email API (application programming interface) — is a service that lets software send, track and manage emails programmatically by making HTTP requests to an email provider, instead of sending them from an email client or by talking SMTP directly. Developers use an email API to send transactional emails such as password resets, order confirmations and notifications straight from their website or application.
In short: your code says "send this message to this person", the provider delivers it, and you get back a message ID and delivery events you can act on.
How does an email API work?
- Authenticate: your application identifies itself with an API key issued by the email provider.
- Send a request: the application makes an HTTPS request (usually to a REST endpoint) with the message data — sender, recipient, subject, HTML or text content, attachments — typically formatted as JSON.
- Get a response: the provider accepts the message, returns a status (and usually a message ID) or an error code you can handle in your code.
- Deliver and report: the provider handles the SMTP delivery, bounces and retries, then reports events such as deliveries, opens, clicks and bounces — by API calls or through webhooks that push each event to your server in real time.
What does an email API request look like?
Every provider has its own endpoint and field names, but a typical send request is a POST with a JSON body. A generic example:
POST https://api.example.com/v1/email/send
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Your order #10482 is confirmed",
"html": "<p>Thanks, Anna! Your order is on its way.</p>",
"text": "Thanks, Anna! Your order is on its way."
}
The response usually contains an HTTP status code (for example 200 or 202 when the message is accepted, 401 for a bad key, 429 when you exceed the rate limit) and an ID you store to follow the message later.
Sending APIs vs mailbox APIs
The term "email API" covers two different kinds of service:
- Sending (transactional) email APIs deliver messages your application generates and report on them. This is what most people mean by API email, and what this definition covers.
- Mailbox APIs read and manage an existing inbox — fetching messages, folders or contacts from an email account — for apps such as CRMs or help desks that sync a user's mail.
Email API vs SMTP
| Email API | SMTP relay | |
|---|---|---|
| Protocol | HTTPS requests (REST, JSON) | SMTP, the standard email protocol |
| Setup | Code in your application | Server, port, username and password in your software's settings |
| Best for | Custom apps, developers, automation | Existing tools: CMS, CRM, e-commerce, ERP |
| Feedback | Structured responses, message IDs, webhooks | SMTP reply codes; events in the provider's logs |
| Speed | Fewer round trips per message | More back-and-forth per message |
Both reach the same inbox. Use SMTP when your software already supports it; choose an email API when you build your own integration. Our article SMTP relay vs email API compares them in detail, and the FAQ difference between SMTP and API gives the short answer.
Common email API use cases
- Transactional emails: receipts, invoices, shipping notices, password resets, one-time codes
- Account and security alerts triggered by your application
- Personalized notifications and reports generated from your own data
- Adding new sign-ups to a contact list and triggering a follow-up email
- Syncing events and statistics back into your CRM or back office
For a wider view of what to send and when, see our transactional email guide.
Best practices for sending email by API
- Keep the API key on the server. Never put it in front-end JavaScript or a mobile app, and rotate it if it leaks.
- Authenticate your sending domain with SPF, DKIM and DMARC so mailbox providers trust the messages your app sends.
- Handle errors and rate limits. Retry temporary errors with a delay, respect any Retry-After header, and log permanent failures.
- Listen to events. Use webhooks or a status endpoint to stop sending to addresses that hard bounce or complain.
- Separate transactional and marketing traffic so a promotional campaign never delays a password reset.
The Mailpro email API
The Mailpro Email API lets your application send campaigns and transactional emails, manage address books, templates and senders, and retrieve statistics (opens, clicks, countries, bounces). Mailpro also offers a CRM API and an SMS API. According to the Mailpro API page, the APIs provide:
- REST and JSON, with XML also available on the Email API, and standard HTTP verbs and status codes.
- Authentication by API key, bearer token or OAuth 2.0 (PKCE) for third-party tools, over HTTPS. You find your API key in your Mailpro account under Settings, API Settings.
- Delivery tracking: every transactional email returns an identifier you can use to query its status (delivered, deferred, bounced). See how to check delivery status via the API.
- Signed webhooks for events such as email delivered, bounce, open and click, pushed to your URL as JSON, signed with HMAC-SHA256 and retried automatically.
- Rate limit of 500 requests per minute per account, with a 429 response and Retry-After header beyond that. Details are in the FAQ on API limits, requests and attachments.
Endpoints are documented on the Mailpro developer portal, and an open-source starter with examples in Node.js, Python, PHP, C# and Java is on GitHub. For setup questions, see the FAQ API email and how APIs work, or Mailpro's API solutions. Deciding between a raw email API and a managed platform? See our guide to the best Amazon SES alternatives.
Related terms
API email FAQ
Is an email API the same as an SMTP server?
No. Both send email, but an SMTP server speaks the SMTP protocol, while an email API receives HTTPS requests and hands the message to the provider's own mail servers. Many providers, Mailpro included, offer both.
Do I need to code to use an email API?
Yes, at least a little: the API is called from your application's code. If your software has SMTP settings instead, an SMTP relay needs no code.
Can an email API send marketing campaigns?
It can, but most teams use the API for one-to-one transactional messages and a campaign editor for newsletters. Some APIs, like Mailpro's, also create and send campaigns to address books.
How do I know if an email sent by API was delivered?
Store the message ID returned by the API, then query its status or receive delivery, bounce, open and click events by webhook.
Mailpro and email API
Send email from your application with Mailpro
Send transactional emails over REST and JSON, track every delivery and receive signed webhooks, with Swiss hosting, priced by emails sent, not by contacts.