Send a broadcast notification
Pushes a notification with a title, body and optional deep link to chosen users (by username), every active user in a role, or every active user of the merchant. Recipients cannot opt out of these broadcasts. Returns how many users it was sent to.
How to use it
- Choose the target: type USERS with usernames from List users, ROLE with a role from List roles, or TENANT for everyone.
- Send a title, body and optional deepLink.
- The notification is delivered straight away and the response gives the recipient count.
BearerAuthAuthorizationBearer <JWT>application/json- body
title*stringNotification headline. Required, must not be blank.
body*stringNotification message text. Required, must not be blank.
target*Who receives it: specific users, everyone in a role, or every active user of the merchant.
deepLink?|Optional in-app link opened when the recipient taps the notification.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request was processed; otherwise an error status.
message*stringShort human-readable message describing the outcome, e.g. which record was saved or why the call failed.
data?How many users the broadcast was sent to.
curl -X POST 'https://beta.iotoms.com/api/v1/notifications/broadcast' \ -H 'Content-Type: application/json' \ -d '{ "title": "string", "body": "string", "target": { "type": "USERS" }}'{ "status": "string", "message": "string", "data": { "recipientCount": 0 }}