Skip to main content

Notifications API

POST /api/v1/notifications

Sends a push notification to one or more subscribers.

Request Body

{
"subscriberIds": ["user-123", "user-456"],
"title": "Hello!",
"body": "You have a new message.",
"data": {
"screen": "inbox"
}
}

Response

{ "id": "notif_def012", "sent": 2 }

Audience filters

Optionally narrow the audience by device or subscriber attributes with the top-level device_filters and subscriber_filters fields (Mongo-style predicates). Both are optional; when present they are ANDed.

{
"target": { "type": "all" },
"device_filters": {
"os_version": { "$gte": { "major": 17, "minor": 0, "patch": 0 } }
},
"subscriber_filters": {
"tier": { "$eq": "premium" }
}
}

Supported operators: $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists. Version-typed keys (os_version, sdk_version, app_version) take structured {major, minor, patch} operands. See the Audience Filters guide for the full reference, custom version fields, and indexing notes.