Rivier/ Reference/ campaigns

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 stringrequired
    One address, or a list: each gets a message of its own (nobody sees the others)
  • fromstring
    Defaults to the project's sending address; must be on its sending domain At most 320 characters.
  • fromNamestring
    At most 120 characters.
  • replyTostring
    At most 320 characters.
  • subjectstring
    Required unless the template has one. May use {{variables}} At most 998 characters.
  • htmlstring
    At most 1000000 characters.
  • textstring
    Defaults to the html as plain text At most 1000000 characters.
  • templatestring
    A template name or id from the template library At most 120 characters.
  • dataobject
    Values the template or the message reads: {{name}}, {{#if plan == "pro"}}, {{#each items}}
  • groupstring
    Unsubscribe group; adds the unsubscribe link and one-click header, and honours the person's choice At most 40 characters.
  • tagslist of string
  • headersobject
    Extra headers (X-...); headers the platform sets are refused
  • sendAtstring
    ISO 8601 time, at most 30 days ahead; default now At most 40 characters.
  • trackOpensboolean
  • trackClicksboolean
  • sandboxboolean
    Validate and render, report what would happen, send and store nothing
  • idempotencyKeystring
    Same as the Idempotency-Key header: the same key twice sends once At most 200 characters.
  • attachmentslist of object
    Up to 10 files, 5 MB together; programs and scripts are refused
    • filenamestringrequired
      The name the recipient sees, such as invite.ics At most 200 characters.
    • contentTypestring
      Defaults from the file name; text/calendar for an invitation At most 120 characters.
    • contentstringrequired
      The file's bytes in base64 At most 7000000 characters.

Responses

  • 202application/json
    Success
    • 400application/json
      The request was malformed
      • errorstringrequired
      • messagestring
    • 401application/json
      No valid credential
      • errorstringrequired
      • messagestring
    • 403application/json
      The credential lacks the scope, origin or address
      • errorstringrequired
      • messagestring
    • 429application/json
      Over the key's rate limit; see Retry-After
      • errorstringrequired
      • messagestring

    This page as Markdown