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
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Notification title (max 200 chars) |
subtitle | string | No | Notification subtitle (max 200 chars) |
body | string | Yes | Notification body (max 4096 chars) |
url | string | No | URL to open when tapped |
sound | string | No | "default" or omit for silent |
target | string/object | Yes | Who 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
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 404 | NOT_FOUND | Segment not found |
| 429 | RATE_LIMITED | Too many requests (120/min) |