Sending

Send email

One endpoint sends a message on any channel — email is the front door.

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.

channelstringRequired
email, sms, push, voice, or webhook.
idempotency_keystringRequired
Unique key per logical send. Retries with the same key return the original result.
destinationobjectRequired
Channel-specific recipient. For email: { email }.
payloadobjectRequired
Channel-specific content. For email: { subject, body_html, body_text }.
message_typestringOptional
transactional (default) or marketing.
metadataobjectOptional
Per-send options. For email, { from_email } sets the sender (must be a verified domain).
template_idstringOptional
Render a stored template instead of an inline payload.
template_varsobjectOptional
Variables interpolated into the template.

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.

Reusing a key with a different payload returns 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:

  • smsdestination: { phone_number }, payload: { body }
  • pushdestination: { device_token }, payload: { title, body }
  • voicedestination: { phone_number }, payload: { body }
  • webhookdestination: { url }, payload: { data }