Skip to main content

Platform — notifications endpoints

How to call the platform notification routes. The formal schema is the OpenAPI specification (Notification API, openapi/source/platform/notifications/notifications.yml); this page is the call contract. The notification journey (states + timestamps) is in notification lifecycle.

All routes require a bearer token (B2B JWT) with CLIENT role and an ACTIVE party. The global /v1 prefix applies.

Route summary

MethodPathCodePurpose
POST/v1/notifications201Send a notification
GET/v1/notifications200List notifications for the party
GET/v1/notifications/{notificationId}200Get a single notification
DELETE/v1/notifications/{notificationId}200Cancel a scheduled notification
POST/v1/notifications/{notificationId}/purge200Purge message from the provider

POST /v1/notifications — send a notification

Sends a notification to the party. The platform stores the encrypted message content, then dispatches it via the provider configured for the requested contactChannel.

BodySendNotificationRequest:

FieldTypeRequiredNotes
messageTypeMARKETING | VERIFICATION | GENERALyesControls template lookup
contactChannelSMS | EMAIL | DEVICEyesChannel for delivery
channelIdentifierstringyesPhone number, email, or device token; leading + stripped before storage
messageContentstringnoRequired when no templateId is supplied
templateIdstring (UUID)noWhen set, messageContent is derived from the template
templateVariablesobjectnoKey/value pairs substituted into {{var}} placeholders
scheduledDateTimeISO 8601 datetimenoFuture delivery window; see scheduling limits below

ResponseSendNotificationResponse:

{
"notification": {
"notificationId": "b3d5f1a2-4e6c-4b8d-9f3e-1a2b3c4d5e6f",
"vendorId": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"messageType": "GENERAL",
"contactChannel": "SMS",
"channelIdentifier": "+61 4XX XXX X12", // masked
"status": "NEW",
"scheduledDateTime": null,
"createdAt": "2026-05-25T08:00:00.000Z",
"deliveryDateTime": null,
},
"vendorId": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}

Scheduling limits (provider-enforced): scheduledDateTime must be more than 5 minutes in the future and no more than 35 days ahead. Violation → 422 NOT022003.

Allow-list gate: when the allow-list is enforced (default), the channelIdentifier must appear in the allow list for the matching notificationType. Blocked identifiers return 403 NOT003002 before any row is written.


GET /v1/notifications — list notifications

Returns notifications for the authenticated party, ordered by createdAt descending. The platform reads its own records first, then enriches each with live status from the provider. The status filter is applied after enrichment.

Query parameters:

ParameterTypeDefaultDescription
pageinteger1Page number (1-based)
limitinteger20Items per page; capped at 100
contactChannelSMS | EMAIL | DEVICEFilter by channel
messageTypeMARKETING | VERIFICATION | GENERALFilter by type
channelIdentifierstringFilter by exact (decrypted) channel identifier
statusNEW | DELIVERED | SCHEDULED_DELIVERY | ERROR | CANCELLEDFilter by status; applied after provider enrichment

ResponseGetNotificationsResponse:

{
"notifications": [
{
"notificationId": "b3d5f1a2-...",
"messageType": "GENERAL",
"contactChannel": "SMS",
"channelIdentifier": "+61 4XX XXX X12",
"status": "DELIVERED",
"scheduledDateTime": null,
"createdAt": "2026-05-25T08:00:00.000Z",
"vendorId": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"deliveryDateTime": "2026-05-25T08:00:05.000Z",
},
],
"pagination": {
"currentPage": 1,
"totalPages": 1,
"totalCount": 1,
"limit": 20,
"hasNext": false,
"hasPrevious": false,
},
}

Notifications that cannot be enriched from the provider are silently excluded from the response.


GET /v1/notifications/{notificationId} — get notification

Returns full detail for a single notification including messageContent (decrypted) and isPurged.

ResponseGetNotificationDetailResponse:

{
"notification": {
"notificationId": "b3d5f1a2-...",
"messageType": "GENERAL",
"contactChannel": "SMS",
"channelIdentifier": "+61 4XX XXX X12",
"status": "DELIVERED",
"scheduledDateTime": null,
"createdAt": "2026-05-25T08:00:00.000Z",
"vendorId": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"deliveryDateTime": "2026-05-25T08:00:05.000Z",
"messageContent": "Your OTP is 123456.",
"templateId": "otp-sms-v1",
"initiatingUserId": "usr_abc123",
"isPurged": false,
"errorDetails": null,
},
}
  • 404 (NOT004001) if the notification does not exist for the tenant.

DELETE /v1/notifications/{notificationId} — cancel a scheduled notification

Cancels a notification that is pending scheduled delivery. The platform requires the notification to have a non-null scheduledDateTime; if it does not, 400 NOT100006 is returned before reaching the provider. The provider additionally requires the message to be in scheduled or accepted status; if not, 412 NOT012001 is returned.

Returns the updated NotificationSummary after cancellation.

  • 400 (NOT100006) if scheduledDateTime is null (platform guard).
  • 404 (resource not found) if the notification does not exist for the tenant.
  • 412 (NOT012001) if the provider rejects the cancellation (message not in a cancellable status).

POST /v1/notifications/{notificationId}/purge — purge notification

Requests deletion of the message body from the provider's records (best-effort). The platform row — including the encrypted messageContent — is not deleted or scrubbed. isPurged in the response reflects the provider's record, not the platform row.

Returns NotificationSummary with isPurged: true when the provider confirms.

  • 404 (resource not found) if the notification does not exist for the tenant.

Enumerations

EnumValues
contactChannelSMS, EMAIL, DEVICE
messageTypeMARKETING, VERIFICATION, GENERAL
status (computed)NEW, DELIVERED, SCHEDULED_DELIVERY, ERROR, CANCELLED

status is not stored on the platform row. It is computed at read time: if scheduledDateTime is set and the provider status is not CANCELLED, the status is SCHEDULED_DELIVERY; otherwise the provider's own status is used.


Errors

HTTPCodeWhen
400NOT100006Cancel attempted on a non-scheduled notification (scheduledDateTime is null)
403NOT003002channelIdentifier not in the allow list (when the allow-list is enforced)
404NOT004001Notification not found — read (GET /{id}) only
404GEN004001Notification not found on cancel / purge, or template not found during send (RESOUCE_NOT_FOUND; the domain NOT004002 is unused)
412NOT012001Provider rejects cancel (message not in scheduled/accepted status)
422NOT022003scheduledDateTime outside the provider-enforced window (>now+5min and ≤now+35d)
500NOT100004Provider returned no vendorId after send