Send an email
Send an email with a single call to POST /v1/send. The SDKs expose an ergonomic emails.send helper; the raw API takes a channel-tagged body.
The request body
The raw API accepts the following fields.
Idempotency
Every send requires an idempotency_key. Retrying with the same key returns the original result instead of sending again, so network retries never double-send. The SDKs generate a key automatically when you don't pass one.
409 — keys are bound to the request they first succeeded with.Batch sending
Send many messages in one request with POST /v1/send/batch. Each item is processed independently; the response preserves request order with per-item success or error, so partial success is normal.
curl https://api.sendara.dev/v1/send/batch \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '[
{ "channel": "email", "idempotency_key": "b1",
"destination": { "email": "a@acme.com" },
"payload": { "subject": "Hi", "body_html": "<p>Hi</p>" } },
{ "channel": "email", "idempotency_key": "b2",
"destination": { "email": "b@acme.com" },
"payload": { "subject": "Hi", "body_html": "<p>Hi</p>" } }
]'Templates
Pass a template_id with template_vars instead of an inline payload to render a stored template — useful for keeping copy out of your codebase.
Message types
Set message_type to transactional (the default) for receipts, OTPs, and alerts, or marketing for campaigns. Marketing mail is subject to unsubscribe handling and suppression rules.
Other channels
The same endpoint sends on other channels — switch channel and the matching destination / payload shape:
- sms —
destination: { phone_number },payload: { body } - push —
destination: { device_token },payload: { title, body } - voice —
destination: { phone_number },payload: { body } - webhook —
destination: { url },payload: { data }