Abrova
☰ Docs menu · Send push
Coming soon. Abrova Push is coming soon. This page describes how it will work; it can’t be used yet.

REST API

Send push notifications from your server using the Abrova Push REST API — authentication, send endpoints, request body, and error responses.

Last updated: 27 Oct 2026

Send push notifications from your server using the REST API.

Server-Side Only.

This REST API must only be used from your backend server, never from mobile apps or client-side code. The server secret can be extracted from mobile apps by attackers, which would allow them to send unauthorized push notifications.

For mobile apps: use the native SDKs (iOS, Android, Flutter, React Native) which only support receiving notifications. To send notifications from your app, make a request to your own backend server, which then calls the AbrovaPush API.

Authentication#

All API requests require both your API Key and Server Secret in the headers.

bash
curl -H "x-api-key: ab_live_your_api_key" \
     -H "x-server-secret: ab_srv_your_server_secret" \
  https://push-api.abrova.ir/push/...

Required Headers

OptionTypeRequiredDescription
x-api-keyStringYesYour project API key (ab_live_xxx)
x-server-secretStringYesYour server secret (ab_srv_xxx) — required for all send operations
IP Whitelist (Optional).

For additional security, you can configure an IP whitelist in your project settings. When enabled, only requests from whitelisted IP addresses can use the server secret.

Send Notification#

The REST API exposes six send endpoints, one per audience shape: a single user (all their devices), a single device, multiple devices by ID, a topic, a segment, or every registered device.

Send to User

Send to all devices of a user.

bash
curl -X POST https://push-api.abrova.ir/push/send-to-user \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_123",
    "title": "Hello!",
    "body": "You have a new message",
    "data": {
      "messageId": "msg_456",
      "action": "open_chat"
    }
  }'

Send to Device

Send to a specific device.

bash
curl -X POST https://push-api.abrova.ir/push/send \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceId": "dev_abc123def456",
    "title": "Order Update",
    "body": "Your order has shipped!",
    "data": {
      "orderId": "ORD-789"
    }
  }'

Send to Devices

Send to multiple devices by ID.

bash
curl -X POST https://push-api.abrova.ir/push/send-to-devices \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "deviceIds": ["dev_abc123", "dev_def456", "dev_ghi789"],
    "title": "Batch Notification",
    "body": "This goes to multiple devices",
    "data": {
      "campaign": "promo_2024"
    }
  }'

Send to Topic

Send to every subscriber of a topic.

bash
curl -X POST https://push-api.abrova.ir/push/send-to-topic \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "sports",
    "title": "Breaking News",
    "body": "Your team just won!"
  }'

Send to Segment

Send to every device in a saved segment.

bash
curl -X POST https://push-api.abrova.ir/push/send-to-segment \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "segmentId": "segment-uuid-123",
    "title": "Just for you",
    "body": "A deal for our most active users"
  }'

Broadcast

Send to every registered device.

bash
curl -X POST https://push-api.abrova.ir/push/broadcast \
  -H "x-api-key: ab_live_your_api_key" \
  -H "x-server-secret: ab_srv_your_server_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "App Update",
    "body": "New features available! Update now."
  }'

Request Body#

OptionTypeRequiredDescription
titlestringConditionalNotification title (required unless templateId is set)
bodystringConditionalNotification body text (required unless templateId is set)
templateIdstringNoRender a saved template instead of title/body
templateVariablesobjectNoVariables substituted into the template
localestringNoTemplate locale to render (e.g. en, fa)
dataobjectNoCustom data payload delivered to the client as-is
userIdstringConditionalTarget user ID (required for send-to-user)
deviceIdstringConditionalTarget device ID (required for /push/send)
deviceIdsstring[]ConditionalArray of device IDs (required for send-to-devices)
topicstringConditionalTarget topic name (required for send-to-topic)
segmentIdstringConditionalTarget segment ID (required for send-to-segment)
appIdentifierstringNoOnly deliver to devices of this app (bundle ID / package name). Not accepted by send-to-devices

Unknown body fields are rejected with 400 Bad Request.

For rich notifications with images, action buttons, deep links, and more, see Rich Notifications.

Response#

Successful sends return the device counts, the generated messageId (a UUID) and a billing summary:

json
{
  "success": 5,
  "failed": 0,
  "messageId": "3f1c2a9e-8b7d-4e21-9a0c-5d6e7f8a9b0c",
  "billing": {
    "messagesCharged": 5,
    "remaining": 99995
  }
}

success and failed are device counts. billing.remaining is -1 when nothing was charged or the remaining quota is unknown.

No Recipients

When the target had zero registered devices the send is not treated as a delivery failure. The response carries reason: "no_recipients" and both counts are zero so your server can distinguish the two cases without polling the message:

json
{
  "success": 0,
  "failed": 0,
  "messageId": "3f1c2a9e-8b7d-4e21-9a0c-5d6e7f8a9b0c",
  "reason": "no_recipients",
  "billing": { "messagesCharged": 0, "remaining": -1 }
}

The message is recorded with status: "no_recipients" and the webhook fires message.no_recipients (not message.failed).

Error Responses#

Missing or Invalid Credentials

json
{
  "statusCode": 401,
  "message": "API key is required (x-api-key header)"
}

Missing Server Secret

json
{
  "statusCode": 401,
  "message": "Server secret is required for this operation (x-server-secret header). Server secret can only be used from your backend server, never from client apps."
}

IP Not in Whitelist

json
{
  "statusCode": 403,
  "message": "Access denied: Your IP address (x.x.x.x) is not in the allowed list. Please add your server IP to the allowed IPs in Abrova Console (Project settings)."
}
Was this page helpful?
Report a problem