Send Notification

POST /v1/notify

Send a push notification to your subscribers.

Request

bash
curl -X POST https://api.bzzz.sh/v1/notify \
  -H "Authorization: Bearer bzzz_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Order shipped",
    "subtitle": "Order #4821",
    "body": "Your package is on its way.",
    "url": "https://example.com/orders/4821",
    "sound": "default",
    "target": "all"
  }'

Body parameters

ParameterTypeRequiredDescription
titlestringNoNotification title (max 200 chars)
subtitlestringNoNotification subtitle (max 200 chars)
bodystringYesNotification body (max 4096 chars)
urlstringNoURL to open when tapped
soundstringNo"default" or omit for silent
targetstring/objectYesWho receives it (see below)

Targeting

All subscribers

json
{ "target": "all" }

Specific user by external ID

json
{ "target": { "external_id": "usr_123" } }

Segment

json
{ "target": { "segment": "segment_id_here" } }

Response

json
{ "sent": 42 }

Returns the number of notifications successfully sent.

Test mode

If you use a test API key (bzzz_test_), the notification is sent to at most 1 device and is not logged to notification history.

Errors

StatusCodeDescription
400VALIDATION_ERRORInvalid request body
401UNAUTHORIZEDMissing or invalid API key
404NOT_FOUNDSegment not found
429RATE_LIMITEDToo many requests (120/min)