A polymorphic endpoint for sending email messages to one or more recipients. The endpoint is designed to feel natural in use:
The response includes a request_id and an array of per-recipient
EmailMessageResult objects describing each message created in the process.
Check out the examples with their responses for common use cases, and browse the full input schema to see everything that’s possible with the Send API.
Provide your BetterMail API key as a Bearer token: Authorization: Bearer YOUR_API_KEY. You can generate and manage API keys in the Developer Centre [https://bettermail.app/developer-centre/api] in your BetterMail account.
User-defined, human-friendly key that uniquely identifies a campaign within an account. You can create this key when launching a transactional campaign.
"WELCOME_EMAIL"
Single recipient object, an RFC 5322 email address string, or an array containing both.
Arbitrary key-value pairs to upsert/merge into the recipient's profile and to use for template personalization.
{
"first_name": "Emily",
"loyalty": { "level": "gold", "points": 1200 },
"marketing_opt_in": true
}Unified per-message override for email, layered on top of your transactional campaign's defaults. Use this object to override corresponding campaign parts (e.g., from/reply-to/subject/bodies) without changing the campaign itself.
Precedence & merge rules
cc, bcc) replace (no merge).headers are merged, with recipient-level keys winning on conflict.Bodies & formats
text is the plain-text email body.html is rich content and supports BML.Attachments applied to all recipients.
Recipient-level attachments (if any) are additive.
Size limit: The sum of all attachments for each message (request-level + recipient-level + any unreferenced multipart binaries auto-attached) must not exceed 10 MB. For base64 data, the decoded byte size is used; for multipart files, the uploaded part size is used; for URLs, the fetched content size is used.
In multipart/form-data requests, streamed files can be referenced via file_ref.
Any unreferenced binary parts are auto-attached to each
email message using their filename and content type.
1 - 10 elementsUnion of supported attachment types. In multipart/form-data requests, any unreferenced binary parts are auto-attached to each email message using their filename and content type.