Docs / Server
Public APIAvailable
Send and read notifications from your server, with idempotency and predictable errors.
Authentication
Use a server key in the Authorization header. Each key has scopes: notifications:send, notifications:read, devices:write and devices:read.
Authorization: Bearer vp_live_...Send a notification
curl -X POST https://vivapush.com/api/v1/notifications \
-H "Authorization: Bearer vp_live_..." \
-H "Idempotency-Key: order-981-shipped" \
-H "content-type: application/json" \
-d '{
"name": "Order shipped",
"kind": "transactional",
"title": "Your order is on its way",
"body": "Arriving today by 6 pm.",
"open_url": "https://shop.com/orders/981",
"external_user_ids": ["customer-42"]
}'A 202 response with the id and status QUEUED or SCHEDULED: the notification was saved and queued, not delivered yet. To schedule, send send_at in ISO 8601.
Fields
| Field | Type | Notes |
|---|---|---|
name | text | Internal name, 3 to 120 characters |
kind | marketing | transactional | Transactional only with external_user_ids (up to 1,000) |
title / body | text | Up to 65 and 240 characters |
open_url | https:// or app link | javascript:, data:, file: and intent: are refused |
image_url | https:// | Large image (Android, iOS with the extension, Chrome) |
data | object | Up to 20 pairs; reserved keys (aps, from, google.*, gcm.*, vp_*) are refused |
audience | object | { mode: all } or a segment/filter (marketing only) |
ttl_seconds | number | Message lifetime; default 86400 |
Read the result
curl https://vivapush.com/api/v1/notifications/ID -H "Authorization: Bearer vp_live_..."Returns the status and counters: sent, accepted by the services, delivered, opened, clicked, invalid and failed.
List campaigns
curl "https://vivapush.com/api/v1/notifications?status=COMPLETED,FAILED&limit=50" -H "Authorization: Bearer vp_live_..."Scope notifications:read. Returns the key's app campaigns, newest first, each with the same fields as the lookup by id, counters included (sent, delivered_confirmed, opened, clicked, failed). Filters: status (one or several, comma separated), kind, created_after and created_before (ISO 8601), and include_tests=true to include test sends (left out by default).
{
"data": [{ "id": "…", "name": "Order shipped", "status": "COMPLETED", "counters": { "sent": 1200, "delivered_confirmed": 1100, "opened": 300, "clicked": 80, "failed": 4 } }],
"has_more": true,
"next_cursor": "MjAyNi0xMC0yM1QxMjowMDowMHw…"
}limit goes up to 100 (default 20). For the next page, repeat the call with cursor=next_cursor; when has_more is false, you are done.
Delete a campaign
curl -X DELETE https://vivapush.com/api/v1/notifications/ID -H "Authorization: Bearer vp_live_..."Scope notifications:send. A draft is removed; a scheduled, paused or still queued campaign is canceled, then deleted; a completed, failed or canceled one leaves every list and the API. Numbers already counted in reports and billing stay.
A 204 response the first time; after that, 404 (the campaign no longer exists for the API). Another app's campaign also answers 404.
Delete an end user's data
To honor a deletion request (LGPD, GDPR), delete one device by installation_id or every device of a user by external_user_id. Needs a key with the devices:write scope.
curl -X DELETE https://vivapush.com/api/v1/devices/INSTALLATION_ID -H "Authorization: Bearer vp_live_..."
curl -X DELETE https://vivapush.com/api/v1/users/customer-42 -H "Authorization: Bearer vp_live_..."A 200 response with how many devices and subscriptions were deleted; 404 when nothing matches. The device, its token, tags and delivery history are deleted for good; campaign totals stay. If the app registers the device again, it comes back as a new device.
Errors
{ "error": { "code": "validation", "message": "Use up to 65 characters.", "details": [...] } }| HTTP | When |
|---|---|
401 | No key or an invalid key |
403 | Missing scope, no permission or unauthorized origin |
402 | Plan block (limit reached) |
409 | Invalid state (app disabled, send in progress) |
413 | Body too large |
422 | Invalid data (including transactional without listed users) |
429 | Rate limited: try again later |