Appearance
Send Email
POST /v1/email/send
Dispatches a highly deliverable transactional email. SendAPI utilizes dedicated IP pools to ensure your mission-critical password resets, receipts, and alert emails do not land in the spam folder.
Authentication
All requests to this endpoint must include your API key in the Authorization header as a Bearer token.
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer sk_live_YOUR_API_KEY |
Idempotency-Key | string | No | A unique UUIDv4 to prevent duplicate deliveries on network retries. |
Request Body
Send an application/json payload with the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | The recipient email address (single address). |
from | string | No | The sender email address. Either a verified custom domain or omitted (defaults to hello@sendapi.co). Supports "Name <email@domain>" format. |
from_name | string | No | Optional sender display name (overrides any name embedded in from). |
subject | string | Yes | The email subject line. |
html | string | No* | The HTML body of the email. |
text | string | No* | The plaintext body fallback of the email. |
template_id | integer | No* | The ID of an email template created via the dashboard. |
variables | object | No | A JSON dictionary of variables to inject into your template_id (e.g., {"name": "Alice"}). |
track_opens | boolean | No | Track email opens (default true). |
track_clicks | boolean | No | Track link clicks (default true). |
*Note: You must provide either html, text, or template_id.
Example Request
bash
curl -X POST https://sendapi.co/v1/email/send \
-H "Authorization: Bearer sk_live_123456789" \
-H "Content-Type: application/json" \
-d '{
"to": "alice@example.com",
"from": "Acme Corp <hello@acme.com>",
"subject": "Welcome to Acme Corp!",
"html": "<strong>Thanks for signing up.</strong> Let us know if you have any questions."
}'javascript
import { SendAPI } from '@sendapi/node';
const client = new SendAPI('sk_live_123456789');
const response = await client.email.send({
to: 'alice@example.com',
from: 'Acme Corp <hello@acme.com>',
subject: 'Welcome to Acme Corp!',
template_id: 12,
variables: {
first_name: 'Alice',
login_url: 'https://acme.com/login'
}
});Response
HTTP 201 Created:
json
{
"success": true,
"data": {
"id": 185,
"to": "alice@example.com",
"from": "hello@acme.com",
"subject": "Welcome to Acme Corp!",
"status": "sent",
"created_at": "2026-03-09T14:30:00.000000Z"
},
"meta": {
"request_id": "cc4b29f9-0535-4f2d-b178-a865154a7090",
"timestamp": "2026-03-09T14:30:00.966108Z"
}
}From-address rules
- Omit
fromentirely → defaults tohello@sendapi.co(always allowed). - Pass a
fromfrom a domain you've verified in Dashboard → Email → Domains → uses that address. - Pass a
fromfrom an unverified domain →422 invalid_from_domain.
Tracking & Analysis
By default, SendAPI tracks deliveries, opens, clicks, and bounces. Receive these events in real-time by registering a webhook (see Webhooks).