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, templateData2# Optional (safe to remove): tenantId, version, recipientRef (IN_APP & PUSH only),3# priority, scheduledAt, correlationId, metadata45curl -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
| Field | Type | Required | Description |
|---|---|---|---|
| channel | Channel | Required | Delivery channel. Must match the channel of the template being sent. |
| eventType | String | Required | Business event that triggered the notification, e.g. "RECEIPT_CREATED". |
| templateId | String | Required | UUID of the message template family to render. |
| version | Integer | Optional | Specific template version to render. Omit to use the latest active version for the channel. |
| recipientId | String | Required | Identifier of the user receiving the notification. |
| recipientRef | String | Optional | Channel-specific recipient reference, e.g. a device token. IN_APP and PUSH only. |
| tenantId | String | Required | Tenant the notification is sent on behalf of. |
| templateData | Map<String, Object> | Required | Values substituted into the template's placeholders. Must cover every required variable; pass an empty map when the template has none. |
| priority | Priority | Optional | Delivery priority. Defaults to NORMAL when omitted. |
| scheduledAt | Instant | Optional | Defers delivery until the given time. Omit to send immediately. |
| correlationId | String | Optional | Caller-supplied ID for tracing the notification across systems. |
| metadata | Map<String, String> | Optional | Arbitrary key-value pairs carried through to delivery reporting. |