Push API & Troubleshooting
REST API reference for /v1/push/*, test sends, error codes, and troubleshooting.
All server-side push endpoints are available at /v1/push/* (and /v1/developer/push/*) and require an API key with the push service permission enabled in Settings → API keys.
Send or schedule a push notification
POST /v1/push/messages reserves quota from your monthly pushSendsPerMonth pool and fans out deliveries across your target audience. Pass an Idempotency-Key header to make retries safe.
| Field | Type | Description |
|---|---|---|
appIdrequired | string | Push app UUID or publicId. |
titlerequired | string | Notification title (1–120 characters). |
bodyrequired | string | Notification body (1–500 characters). |
imageUrl | string | Optional HTTPS image URL. |
clickUrl | string | Optional HTTPS URL opened when the notification is tapped. |
buttons | array | Up to 3 action buttons: { id, title, url? }. |
data | object | Custom string key/value pairs delivered to the app. |
audiencerequired | object | { type: "all" | "platforms" | "externalUserIds" | "subscriberIds", ... }. |
scheduleTyperequired | string | "NOW", "AT" (requires sendAt ISO8601), or "LOCAL_TIME" (requires localTime HH:mm). |
throttleMinutes | integer | Optional spread duration: 15, 60, 360, or 1440. |
curl -X POST https://api.msgera.io/v1/push/messages \
-H "X-API-Key: $MSGERA_KEY" \
-H "Idempotency-Key: 9b2f1c4e-6a8d-4b1a-9e0c-2d4f6a8b0c1e" \
-H "Content-Type: application/json" \
-d '{
"appId": "app_01JXYZ...",
"title": "Your order has shipped!",
"body": "Tap to track your package in real time.",
"clickUrl": "https://example.com/orders/42",
"audience": {
"type": "externalUserIds",
"externalUserIds": ["user_123"]
},
"scheduleType": "NOW",
"priority": "high"
}'Test devices & test sends
Mark up to 50 subscribers per app as test devices with PATCH /v1/push/subscribers/:id ({"isTest": true}). Then call POST /v1/push/apps/:id/test to dispatch immediately to all active test devices and inspect per-device outcomes. Test sends do not count against pushSendsPerMonth and are rate-limited to 20 per app per hour.
curl -X POST https://api.msgera.io/v1/push/apps/YOUR_APP_ID/test \
-H "X-API-Key: $MSGERA_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Test notification",
"body": "Verifying push setup"
}'Subscribers & cancellation
GET /v1/push/subscribers?appId=&platform=&isTest=&q=— List subscribers with cursor pagination.PATCH /v1/push/subscribers/:id— Toggle{ "isTest": true | false }.DELETE /v1/push/subscribers/:id— Delete a single subscriber device.DELETE /v1/push/apps/:id/users/:externalUserId— Delete all devices linked to anexternalUserId.POST /v1/push/messages/:id/cancel— Cancel aSCHEDULED,QUEUED, orSENDINGmessage and refund unsent quota.
Error codes
| Code | Status | Meaning |
|---|---|---|
PUSH_APP_NOT_FOUND | 404 | The push app ID or publicId does not exist on your account. |
PUSH_PLATFORM_NOT_CONFIGURED | 409 | A mobile SDK tried to subscribe before credentials for that platform were saved. |
PUSH_CREDENTIALS_INVALID | 400 | The uploaded Firebase, Apple, or Huawei credentials failed validation. |
PUSH_ORIGIN_NOT_ALLOWED | 403 | A web push request came from an origin not listed in the app's allowedOrigins. |
PUSH_IDENTITY_REQUIRED | 401 | identityVerification is enabled on the app, but userHash was omitted. |
PUSH_IDENTITY_INVALID | 401 | The provided userHash did not match HMAC-SHA256(appSecret, externalUserId). |
PUSH_NO_TEST_DEVICES | 422 | POST /v1/push/apps/:id/test was called when no active subscribers have isTest = true. |
PUSH_TEST_DEVICE_LIMIT_REACHED | 422 | An app already has the maximum of 50 test devices. |
PUSH_TEST_SEND_RATE_LIMITED | 429 | Exceeded 20 test sends for this app within the current hour. |
PUSH_PAYLOAD_TOO_LARGE | 400 | The combined notification payload exceeds the 3,500-byte limit. |
Troubleshooting
| Field | Type | Description |
|---|---|---|
UNREGISTERED / Unregistered | android / ios | The user uninstalled the app or revoked notification permission. The subscriber is marked INVALID automatically. |
SENDER_ID_MISMATCH | android | The google-services.json in the Android app belongs to a different Firebase project than the service account JSON uploaded in Msgera. |
DeviceTokenNotForTopic | ios | The Bundle ID configured in Msgera does not match the iOS app's bundle identifier. |
BadDeviceToken | ios | The APNs token was rejected by both production and sandbox gateways. |
80300007 | huawei | The HMS Push Kit token is expired or unregistered. |
404 / 410 | web | The browser push subscription expired or notifications were blocked in browser settings. |
Paused platforms
.p8 key or deleted service account), Msgera pauses that platform, emails you once, and holds queued deliveries so your subscribers are not marked failed. Upload working credentials on the Platforms tab to resume delivery immediately.