Skip to main content
Version: 4.0.2

Send Notification

POST 

/notifications-srv/notifications

Sends a template-based notification to one or more recipients through a supported communication channel: email, SMS, IVR, push, or chat.

Quick start

  1. Set criteria (templateKey, groupId, commMethod, optional locale) to select a published, enabled template.
  2. Pass placeholder values in systemAttributes / customAttributes / contextAttributes (root and/or per recipient).
  3. Omit request content.subject and content.content for normal template sends — the server renders them from the template.
  4. Check each recipient’s status in the 200 response (SUCCESS, FAILED, or SKIPPED).

Important: Subject and body come from the matched template, rendered with your attributes (Handlebars). Do not put HTML in content.content or content.data.htmlContent expecting it to be the email body. To send pre-built HTML, put it in an attribute (for example customAttributes.htmlContent) and use {{{htmlContent}}} in the template. See Communication templates — How content is built.


Template resolution (criteria)

FieldRequiredDescription
templateKeyYesTemplate type / action key (e.g. VERIFY_USER, INACTIVE_USER)
groupIdYesTemplate group (sender, provider, and group defaultLocale)
commMethodYesemail, sms, ivr, push, or chat
localeNoPreferred locale (e.g. en, de-DE). If omitted or unmatched, fallback applies
processingTypeNoExact match when set (LINK, CODE, GENERAL, …); omitted = not filtered
usageTypeNoExact match when set; omitted = not filtered
verificationTypeNoExact match when set; omitted = not filtered
numberNoReminder sequence (1–5); advanced opt-in reminder flows

Locale fallback (when selecting a template row): exact criteria.locale → locale prefix variants → template group defaultLocale → tenant instance default locale.

criteria.defaultLocale is not used for normal template lookup. Configure fallback on the template group instead.

Discover allowed attributes for a key via template type attributes / group template filters.


Rendering (attributes → subject / body)

Placeholder values are merged into one flat map (later keys win):

  1. Root systemAttributescustomAttributescontextAttributes
  2. Then that recipient’s systemAttributescustomAttributescontextAttributes

Syntax: {{name}} (escaped) and {{{htmlContent}}} (raw HTML). Required attributes are validated on the merged map per recipient. Keys not allowed on the template type may be stripped from root attributes.

Root attributes work for single and multiple recipients (defaults). Recipient values override the same keys.

Attribute bagTypical use
systemAttributesProfile fields allowed by the template type (given_name, email, code, …)
customAttributesApp / developer placeholders (e.g. htmlContent, subject, custom fields)
contextAttributesRequest context (client_id, device_id, sub, …)

Request field roles

FieldRole
criteriaSelects the template row
Attribute bagsFill {{…}} / {{{…}}} in the template
content.subject / content.content / content.messageFormatIgnored / overwritten after template render on template-based sends
content.dataChannel-specific payload (mainly push); does not drive email/SMS subject or body

Draft vs disabled templates

Template stateBehavior
Draft (isDraft: true)Excluded from selection. Service tries the next locale match. 400 if no published template matches.
Disabled (enabled: false)May still be selected. HTTP 200 with per-recipient status: SKIPPED and a reason.

Publish and enable templates before relying on them in production.


Recipients (recipientAddresses)

  • Single recipient requests must contain exactly 1 entry.
  • Multiple recipient requests support up to 100 entries.

Each entry needs address (and usually name) plus any per-recipient attributes.


Sender overrides

If senderName, senderAddress, or replyAddress are omitted, the API falls back to the communication group settings (groupId) or the communication provider configuration.


Channel-specific content.data (push)

For email, SMS, IVR, chat, omit content.data (or set it to null). It does not supply the message body.

For push, optional fields include:

FieldTypeDescription
datamap[string]stringSilent key-value pairs for the app
topicstringTopic fan-out instead of individual tokens
image_urlstringRich notification image URL
prioritystringhigh or normal (default)
click_actionstringDeep link / intent on tap
analytics_labelstringAnalytics segmentation label
validate_onlybooleanValidate with the provider without delivering

Attachments

File attachments require Content-Type: multipart/form-data (email only):

FieldDescription
attachmentA single file
attachmentsMultiple files

Other body fields (criteria, recipientAddresses, …) must be included as form parts in the same multipart request.

Request

Responses

OK — Notification dispatched. Check data[].status for per-recipient delivery outcome.