Transactional email API and SDK for developers
MailSend sends OTPs, password resets, receipts and alerts through a REST API or an official JavaScript and TypeScript SDK. Your marketing campaigns run from the same account, on the same verified domain.
Send your first email
curl https://api.mailsend.dev/v1/emails \
-H "Authorization: Bearer $MAILSEND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <[email protected]>",
"to": ["[email protected]"],
"subject": "Your login code",
"html": "<p>Your code is <b>482913</b></p>"
}'import { MailSend } from "mailsend";
const mailsend = new MailSend(process.env.MAILSEND_API_KEY!);
const email = await mailsend.emails.send({
from: "Acme <[email protected]>",
to: "[email protected]",
subject: "Your login code",
html: "<p>Your code is <b>482913</b></p>",
});
console.log(email.id, email.status); // queuedWhat developers get
REST API
One endpoint, POST /v1/emails, with a Bearer API key and a JSON body. It works from any language that can make an HTTP request.
JavaScript and TypeScript SDK
The official mailsend npm package has zero dependencies and ships its own types. It runs on Node.js 18+, Bun, Next.js, TanStack Start and Cloudflare Workers.
Batch sending
Queue up to 100 emails in one call. Each email is validated on its own, so one bad address does not fail the batch.
Idempotency and retries
The SDK adds an idempotency key and retries failed requests a bounded number of times, so a network blip does not send the same receipt twice.
Webhooks and delivery status
Get delivery, bounce and complaint events by webhook, or look up any message by ID to see where it ended up.
Scoped API keys
Create keys limited to sending or to reading, and keep them on the server. Every send shows up in the workspace send log.
Keeping transactional email out of spam
A login code that lands in spam is a failed login. Three things decide where it lands, and MailSend handles each one.
Domain authentication
Verify your sending domain with SPF, DKIM and DMARC records. MailSend checks the DNS for you and will not send from a domain that has not been verified.
Bounce management
Hard bounces and spam complaints go onto a suppression list automatically, so your app cannot keep mailing a dead address.
Reputation monitoring
The bounce and complaint monitor tracks both rates against the limits mailbox providers enforce: under 2% bounces and under 0.08% complaints.
Transactional and marketing email on one platform
Platforms that combine a transactional email API with marketing campaigns are usually called unified, or all-in-one, email platforms. MailSend is one of them.
In practice your developers call the API for receipts and password resets, and your marketers build newsletters and automations in the dashboard. Both use the same contacts, the same verified domain and the same suppression list, so someone who unsubscribes or bounces is handled once.
Transactional email FAQ
Does MailSend have an API for transactional email?
Yes. MailSend has a REST API at api.mailsend.dev/v1/emails that accepts a Bearer API key and a JSON body, plus an official SDK for JavaScript and TypeScript published on npm as mailsend.
Which languages does the MailSend SDK support?
The official SDK is for JavaScript and TypeScript. It runs on Node.js 18+, Bun, Next.js, TanStack Start and Cloudflare Workers. From any other language you call the REST API directly over HTTPS.
What kind of platform combines transactional email with marketing campaigns?
It is usually called a unified or all-in-one email platform: one service that offers both a transactional email API for developers and a campaign tool for marketers. MailSend is a unified email platform. Transactional emails and marketing campaigns share one account, one verified domain, one contact list and one suppression list.
How does MailSend keep transactional emails out of spam?
It requires SPF, DKIM and DMARC authentication on your sending domain, suppresses hard bounces and complaints automatically, and shows your bounce and complaint rates so you can react before mailbox providers do.
Can I send marketing and transactional email from the same account?
Yes. Both draw on the same monthly email quota, and an address that unsubscribes or bounces is suppressed everywhere.
Send a test email in a few minutes
The Starter plan is free. Verify a domain, create an API key and send.