Site notification API
Authenticate an app, backend, or CMS plugin and send an idempotent web push notification.
Site notification API
Use the private API verification key from Sites → Settings as a Bearer token. Requests are scoped to the site in the URL.
curl -X POST https://pushrr.online/api/v1/sites/SITE_ID/notifications \
-H "Authorization: Bearer sk_site_REPLACE_ME" \
-H "Idempotency-Key: order-123-shipped-v1" \
-H "Content-Type: application/json" \
-d '{
"title": "Order shipped",
"body": "Your order is on its way.",
"targetUrl": "https://example.com/orders/123",
"audience": { "type": "all" }
}'Successful new requests return 202 Accepted with the campaign ID, selected delivery backend, and a status URL. Repeating the same site and Idempotency-Key returns the original campaign without sending twice.
Retries and replay semantics
- If the first request fails before delivery starts (
503), retry with the sameIdempotency-Key. The request is picked up again and, once delivery starts, returns202with"idempotentReplay": true. It never sends twice. - If the monthly impression limit is reached (
429), the campaign is markedfailed. Replays with the same key return that campaign with statusfailed; use a newIdempotency-Keyafter the limit resets or the plan changes. - A replay of a campaign that has already started returns
200with the campaign's current status and"idempotentReplay": true.
Audience
- Omit
audience, or use{ "type": "all" }, for all active subscribers. - Use
{ "type": "segment", "segmentId": "…" }when the site's plan includes segmentation. - Use
{ "type": "subscriber", "subscriberId": "…" }for one subscriber.
Audience IDs are verified against the authenticated site. Rich images and segmented sends follow plan entitlements, and API-created campaigns count toward monthly campaign limits.
Status
Call GET /api/v1/sites/SITE_ID/notifications/CAMPAIGN_ID with the same Bearer key. The response includes current campaign and delivery progress.
Rotate a key
Rotating a site API key immediately invalidates the previous server credential. It does not rotate the public browser key, service worker, hosted subscription origin, VAPID keys, or stored subscribers.