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.

Header
Authorization: Bearer vp_live_...

Send a notification

cURL
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.

Repeating the same Idempotency-Key never sends twice: the API returns the notification already created.

Fields

FieldTypeNotes
nametextInternal name, 3 to 120 characters
kindmarketing | transactionalTransactional only with external_user_ids (up to 1,000)
title / bodytextUp to 65 and 240 characters
open_urlhttps:// or app linkjavascript:, data:, file: and intent: are refused
image_urlhttps://Large image (Android, iOS with the extension, Chrome)
dataobjectUp to 20 pairs; reserved keys (aps, from, google.*, gcm.*, vp_*) are refused
audienceobject{ mode: all } or a segment/filter (marketing only)
ttl_secondsnumberMessage lifetime; default 86400

Read the result

cURL
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
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).

Response
{
  "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
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.

If the campaign is being sent, the response is 409. To cancel the remaining sends and delete it, call with ?cancel=true.

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
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.

In the dashboard, the same is under Audience → device → Delete device (owners and admins).

Errors

Format
{ "error": { "code": "validation", "message": "Use up to 65 characters.", "details": [...] } }
HTTPWhen
401No key or an invalid key
403Missing scope, no permission or unauthorized origin
402Plan block (limit reached)
409Invalid state (app disabled, send in progress)
413Body too large
422Invalid data (including transactional without listed users)
429Rate limited: try again later