Send a transactional email (one message per recipient)
post/mail/send
Send a transactional email (one message per recipient). Use an Idempotency-Key (header or idempotencyKey) so a retry sends once; sandbox: true checks and renders without sending. Refuses suppressed addresses with a structured error. Mail goes out through the project's chosen transport once consent, quiet rules, test mode and the plan's limit allow it.
Before you call
- Credential
Authorization: Bearer $KEY- Scope
campaigns:write- Mcp
rivier_campaign_mail_send- Graphql
Mutation.campaignsMailSendCreate- Sdk
mail.send- Cli
mail send- Events
campaigns.mail.queued
Request bodyapplication/json, required
- tostring or list of stringrequiredOne address, or a list: each gets a message of its own (nobody sees the others)
- fromstringDefaults to the project's sending address; must be on its sending domain At most 320 characters.
- fromNamestringAt most 120 characters.
- replyTostringAt most 320 characters.
- subjectstringRequired unless the template has one. May use {{variables}} At most 998 characters.
- htmlstringAt most 1000000 characters.
- textstringDefaults to the html as plain text At most 1000000 characters.
- templatestringA template name or id from the template library At most 120 characters.
- dataobjectValues the template or the message reads: {{name}}, {{#if plan == "pro"}}, {{#each items}}
- groupstringUnsubscribe group; adds the unsubscribe link and one-click header, and honours the person's choice At most 40 characters.
- tagslist of string
- headersobjectExtra headers (X-...); headers the platform sets are refused
- sendAtstringISO 8601 time, at most 30 days ahead; default now At most 40 characters.
- trackOpensboolean
- trackClicksboolean
- sandboxbooleanValidate and render, report what would happen, send and store nothing
- idempotencyKeystringSame as the Idempotency-Key header: the same key twice sends once At most 200 characters.
- attachmentslist of objectUp to 10 files, 5 MB together; programs and scripts are refused
- filenamestringrequiredThe name the recipient sees, such as invite.ics At most 200 characters.
- contentTypestringDefaults from the file name; text/calendar for an invitation At most 120 characters.
- contentstringrequiredThe file's bytes in base64 At most 7000000 characters.
- filenamestringrequired
Responses
- 202application/jsonSuccess
- 400application/jsonThe request was malformed
- errorstringrequired
- messagestring
- 401application/jsonNo valid credential
- errorstringrequired
- messagestring
- 403application/jsonThe credential lacks the scope, origin or address
- errorstringrequired
- messagestring
- 429application/jsonOver the key's rate limit; see Retry-After
- errorstringrequired
- messagestring