SDK Docs

SDK reference

How to send a notification from your service using the notification SDK.

Quick start

Build a NotificationEvent and hand it to send(event). Look up the exact templateId, channel, and required variables for the template you're sending from its entry on the Message Templates page — each version has a ready-to-copy example in its own expanded row.

1# Required: eventType, channel, recipientId, templateId, templateData
2# Optional (safe to remove): tenantId, version, recipientRef (IN_APP & PUSH only),
3# priority, scheduledAt, correlationId, metadata
4
5curl -X POST 'https://<notification-engine-host>/notifications/v1' \
6 -H 'Content-Type: application/json' \
7 -H 'Authorization: Bearer <YOUR_API_TOKEN>' \
8 -d '{
9 "eventType": "EVENT-TYPE",
10 "channel": "EMAIL",
11 "recipientId": "<RECIPIENT_ID>",
12 "recipientRef": "...",
13 "templateId": "your-template-uuid",
14 "tenantId": "<YOUR_TENANT_ID>",
15 "version": 1,
16 "templateData": {
17 "orderId": "...",
18 "customerName": "..."
19 },
20 "priority": "NORMAL",
21 "scheduledAt": "2025-01-01T00:00:00Z",
22 "correlationId": "...",
23 "metadata": { "key": "value" }
24}'

Field reference

Every field the NotificationEvent builder accepts, whether it's required, and what it does.

NotificationEvent fields

FieldTypeRequiredDescription
channelChannelRequiredDelivery channel. Must match the channel of the template being sent.
eventTypeStringRequiredBusiness event that triggered the notification, e.g. "RECEIPT_CREATED".
templateIdStringRequiredUUID of the message template family to render.
versionIntegerOptionalSpecific template version to render. Omit to use the latest active version for the channel.
recipientIdStringRequiredIdentifier of the user receiving the notification.
recipientRefStringOptionalChannel-specific recipient reference, e.g. a device token. IN_APP and PUSH only.
tenantIdStringRequiredTenant the notification is sent on behalf of.
templateDataMap<String, Object>RequiredValues substituted into the template's placeholders. Must cover every required variable; pass an empty map when the template has none.
priorityPriorityOptionalDelivery priority. Defaults to NORMAL when omitted.
scheduledAtInstantOptionalDefers delivery until the given time. Omit to send immediately.
correlationIdStringOptionalCaller-supplied ID for tracing the notification across systems.
metadataMap<String, String>OptionalArbitrary key-value pairs carried through to delivery reporting.