Skip to content

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.

HeaderTypeRequiredDescription
AuthorizationstringYesBearer sk_live_YOUR_API_KEY
Idempotency-KeystringNoA unique UUIDv4 to prevent duplicate deliveries on network retries.

Request Body

Send an application/json payload with the following parameters:

ParameterTypeRequiredDescription
tostringYesThe recipient email address (single address).
fromstringNoThe sender email address. Either a verified custom domain or omitted (defaults to hello@sendapi.co). Supports "Name <email@domain>" format.
from_namestringNoOptional sender display name (overrides any name embedded in from).
subjectstringYesThe email subject line.
htmlstringNo*The HTML body of the email.
textstringNo*The plaintext body fallback of the email.
template_idintegerNo*The ID of an email template created via the dashboard.
variablesobjectNoA JSON dictionary of variables to inject into your template_id (e.g., {"name": "Alice"}).
track_opensbooleanNoTrack email opens (default true).
track_clicksbooleanNoTrack 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 from entirely → defaults to hello@sendapi.co (always allowed).
  • Pass a from from a domain you've verified in Dashboard → Email → Domains → uses that address.
  • Pass a from from 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).

Released under the MIT License.