UseDocumentation Index
Fetch the complete documentation index at: https://segmentflow.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
emails.send when your backend needs to send one expected email to one primary recipient, such as an order confirmation, password reset, account invite, receipt, or shipping update.
emails.send creates one durable EmailSend. The REST route is POST /api/v1/emails; each accepted request snapshots one saved Email Template, resolves one primary Profile, freezes the effective envelope, enqueues delivery, and returns the EmailSend status handle.
Use emails.batchSend when your backend already has several independent EmailSends to create at once. Each item has its own primary recipient, data, idempotency key, durable status record, and result.
If you are deciding between one email, batch email, event-triggered Journeys, Broadcasts, or Newsletter Issues, start with Which API should I use?.
EmailSend always uses a saved Email Template. It does not accept raw
html,
text, react, inline template content, Template aliases, Template slugs,
Template names, or locale-key resolution in v1.Prerequisites
- A saved Email Template whose purpose is
Transactional. - A verified sending domain.
- A SenderProfile on that verified sending domain.
- A purpose-scoped API Key with
emails:writeto send andemails:readto retrieve status. - A caller-generated
Idempotency-Keyfor everyemails.sendrequest, or an item-levelidempotencyKeyfor everyemails.batchSenditem.
Send one email
UsetemplateId to choose the saved Email Template. Use envelope fields such as from, to.email, subject, replyTo, cc, and bcc the same way you would in an email provider API, while still keeping the content template-backed.
EmailSend status handle. Store send.id in your system and use it for reconciliation.
from, replyTo, subject, to, cc, and subscriptionGroupId. They do not echo bcc.
Recipient resolution
Every EmailSend has exactly one primary recipient. That primary recipient resolves to one Profile and creates at most one Message. Useto.email when you know the recipient email address:
to.externalId when you want Segmentflow to link or reconcile the Profile against your stable customer id:
profileId when you already know the Segmentflow Profile. If you omit to.email, Segmentflow uses the Profile’s canonical email for delivery.
profileId and to.email must refer to the same Profile. to.externalId alone must resolve to an existing Profile; include to.email when the send may need to create a new Profile.
EmailSend does not update durable Profile properties. Use the Profiles API or events.track profile.properties when you need future segmentation or personalization state.
Template, sender, and subject
Pass the exacttemplateId of a saved Email Template. v1 does not resolve aliases, slugs, locale keys, or template names. If you edit the Template after a send is accepted, the existing EmailSend still uses the TemplateSnapshot created for that send.
SenderProfile resolution is deterministic:
- Use request
fromorsenderProfileIdwhen present. - If both
fromandsenderProfileIdare present, they must resolve to the same SenderProfile. - Otherwise use the SenderProfile saved on the Template.
- If no valid transactional SenderProfile on a verified domain resolves, the send is rejected or skipped with
InvalidSenderProfile.
from accepts a bare email or "Name <email@example.com>". The email must exactly match a verified SenderProfile email. A verified domain does not authorize arbitrary local-parts.
replyTo accepts one bare email or "Name <email@example.com>". It may differ from from, but it must use a verified sender domain owned by your Organization.
Request-level subject is final text. Segmentflow freezes it onto the EmailSend and does not interpolate it. If you omit subject, the saved Template subject is frozen instead.
Copied recipients
Usecc and bcc to copy operational recipients on the same provider envelope.
cc and bcc accept a single friendly-address string or an array of friendly-address strings. Segmentflow validates and stores them for provider handoff.
Copied recipients are envelope-only in v1:
- They do not create Profiles.
- They do not create Messages.
- They do not own personalization.
- They do not receive separate Delivery Events.
- Primary Profile erasure, suppression, and subscription checks apply to the primary recipient, not copied recipients.
cc is returned in ordinary create and retrieve responses for operational visibility. bcc is stored for delivery and retry behavior, but ordinary API responses, Resource Events, and dashboard list rows do not expose it.
Batch independent sends
emails.batchSend accepts up to 100 independent items. Use shared defaults for fields that are identical across the batch, then override specific fields on each item.
templateId, from, senderProfileId, subject, replyTo, subscriptionGroupId, and tracking. Each item can override those defaults.
Batch defaults cannot include profileId, to, data, cc, or bcc. Recipient identity, one-send data, and copied recipients must stay item-specific.
Malformed batch envelopes fail the whole request. Item-specific validation, idempotency, sender, template, or recipient failures return Rejected results for those items without rolling back accepted items.
emails.batchSend is not a campaign sender. Use Broadcasts or Newsletter Issues when the system should compute or manage an audience, scheduling, campaign review, compliance controls, or one shared message sent to a segment.
Tracking
tracking.clicks: false for sensitive links that should not pass through a redirect. Open tracking is disabled for email in v1 and cannot be enabled per request.
Subscription groups
PasssubscriptionGroupId when this email should respect a specific SubscriptionGroup. If the primary recipient is not subscribed according to that group’s OptIn or OptOut policy, Segmentflow creates a durable skipped EmailSend with skippedReason: "ProfileUnsubscribed".
Omit subscriptionGroupId for strictly service-requested transactional emails such as password resets or receipts.
Retrieve status
Store the returnedid in your system. Use it as the durable handle for reconciliation when Resource Events are delayed or unavailable.
from, replyTo, subject, to, and cc are returned, while bcc is not.
Idempotency
Everyemails.send request requires an Idempotency-Key header. Every emails.batchSend item requires an idempotencyKey field. Choose a stable key from your business event, such as order-confirmation:ord_9421 or password-reset:user_123:<reset-request-id>.
Idempotency is scoped to your Organization and the full effective request. The effective request includes the resolved recipient identity, templateId, sender, subject, replyTo, copied recipients, tracking settings, subscription gate, and one-send data.
- Reusing the same key with the same effective request returns the existing EmailSend with its current status.
- Reusing the same key with a different effective request returns
409 Conflictforemails.sendor aRejecteditem result foremails.batchSend. - Keys remain reserved for the lifetime of the EmailSend record.
- Idempotent replay does not re-enqueue, re-render, recreate a Message, or send a duplicate email.
defaults and an item does not change idempotency when the merged effective request is the same.
Status lifecycle
| Status | Meaning |
|---|---|
Queued | The request was accepted, persisted, and enqueued for worker processing. |
Processing | A worker is resolving, rendering, or sending the email. |
Sent | Segmentflow’s delivery adapter accepted the email. This is not an inbox-delivery guarantee. |
Failed | The send was accepted for processing, but rendering, provider submission, or worker execution failed. |
Skipped | Segmentflow intentionally did not attempt provider delivery because of policy, suppression, subscription, admission, or rate limit. |

