Skip to main content

Send email to list API

Api call to subrite to send email to list

  • Method: POST
  • Route: {baseUrl}/api/v1/communications/email/send
  • Authorization: Bearer token (use the m2m token collected in ## configuration)
  • Body: See example below

Example of body :

{
"communicationType": "marketing", // Possible values: "marketing" or "information"
"name": "coming from external",
"senderId": 2, // Use sender ID from Step 2 response
"consentId": null,
"segmentId": 1, // Use segment ID from Step 3 response
"subject": "email subject",
"emailPreviewText": "sample",
"templateId": 1, // optional
"emailContent": "<div>hello world</div>",
"hostName": "example.com" // Optional. See "Host name" below.
}

Host name

hostName is optional. When set, unsubscribe links generated for this email use the supplied hostname instead of the tenant's primary hostname. Use it when your tenant serves multiple brand domains so recipients land on the correct brand.

  • Must match the tenant's primary hostname or one of its registered additional hostnames. Foreign or unregistered hostnames are silently ignored and the tenant's primary hostname is used as a fallback.
  • DNS-safe characters only (a–z, 0–9, ., -, optional :port); IDN hostnames must be supplied in punycode form.
  • Omit the field to use the tenant's primary hostname.

Success API response :

{
"success": true,
"message": "Email sent successfully",
"id": 168
}