REST API Reference
Email Send REST API
Send transactional and marketing emails via a simple JSON REST API.
Docs Summary
- What this page explains: How to send emails programmatically using MailSend's JSON REST API endpoint.
- Who should use it: Developers integrating automated email triggers into web apps.
- Related MailSend feature: REST API sending, SDKs
- Common use cases: OTPs, alerts, password resets, order confirmations
- Related docs: SDK Reference, Webhooks, Domain Setup
The MailSend REST API allows sending beautiful, high-speed emails from your backend or serverless edge routes. Authenticate by passing your Bearer API key in the request headers.
API Endpoint
POST `https://api.mailsend.dev/v1/emails`
bash
curl --location 'https://api.mailsend.dev/v1/emails' \
--header 'Authorization: Bearer ms_live_abc123XYZ' \
--header 'Content-Type: application/json' \
--data-raw '{
"from": "David <david@yourdomain.com>",
"to": ["user@example.com"],
"subject": "Welcome to MailSend 🎉",
"html": "<strong>Welcome to the platform!</strong>"
}'Request Parameters
Specify these JSON parameters in your request body:
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | The verified sending email address (e.g. hello@domain.com or Name <hello@domain.com>). |
| to | string[] | Yes | List of recipient email addresses. Maximum 50 per batch request. |
| subject | string | Yes | The subject line of the email. |
| html | string | No | HTML body of the email. Supports inline CSS styling. |
| text | string | No | Plain text alternative body of the email. |
| reply_to | string | No | Reply-to address for emails. |
| headers | object | No | Custom headers to attach to the SMTP transaction. |
| capture_replies | boolean | No | Generate a unique Reply-To address and collect replies in MailSend Inbox. |