Send a push to one registered user, and list or remove registered indie ids.
Required
Register your users with indie push registration before using these APIs.
Send to one user
POST https://app.nativenotify.com/api/indie/notification
{
"subId": "user_8241",
"appId": 12345,
"appToken": "yourAppToken",
"title": "Your order shipped",
"message": "Tap to track your package",
"pushData": { "url": "/orders/12345" }
}
subId is the id you registered (subID also works). appId and appToken are in your Native Notify dashboard. The server stamps the inbox date itself. pushData (an object or a JSON string) and Expo's rich fields, such as subtitle, badge, ttl and sound, are optional: see Rich notifications.
Content-Type
Send JSON with Content-Type: application/json. fetch and server languages like Python must set it (axios does), or the server can't read appId and appToken and answers 401.
Response
| Status | Meaning |
|---|---|
201 with Success! | The push was sent. |
201 with an explanation | Nothing was sent: the subId isn't registered to this app ("That subID is not registered to this app…"), the free trial has ended, or sending is paused for an unpaid invoice (see Plans & billing). Check that the body is exactly Success!. |
400 | No subId, a missing title or message, an invalid rich field, or a payload over Expo's 4 KiB limit (notification payload exceeds Expo's 4KiB limit). |
401 | The appId and appToken pair doesn't match an app. |
Get one successfully registered ID
GET https://app.nativenotify.com/api/expo/indie/sub/:appId/:appToken/:subId
Answers 201 with [] when the id isn't registered, or one entry, { sub_id, expo_ios_token, ios_apn_token, expo_android_token, android_fcm_token }, where each token field is an array of that subscriber's device tokens. A non-empty array means registered.
Get all successfully registered IDs
GET https://app.nativenotify.com/api/expo/indie/subs/:appId/:appToken
Returns every registered subscriber, one entry per unique user id in the shape above. The X-Total-Count response header carries the count.
Paging is opt-in. Add take and skip to read one page at a time:
GET https://app.nativenotify.com/api/expo/indie/subs/:appId/:appToken?take=500&skip=0
Page to the end
take is honored exactly as sent, with no maximum (a value below 1 counts as 1). Pages run newest registration first, so keep requesting pages until you've read X-Total-Count rows.
Unregister a registered ID
DELETE https://app.nativenotify.com/api/app/indie/sub/:appId/:appToken/:subId
Deletes the id and every device registered under it. Answers 201 with delete Indie Sub successful, also when the id wasn't registered. It can't be undone.
Logging out one device
One id can belong to many devices (a user's phone and tablet, or every member of a group sharing it), and this DELETE removes all of them. To log out one device, use the request below.
Unregister one device
Call unregisterIndieDevice() in the app, or send the same request yourself:
PUT https://app.nativenotify.com/api/unregister/indie/device
{
"appId": 12345,
"appToken": "yourAppToken",
"subID": "user_8241",
"expoToken": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
"deviceToken": "0c9d8e…"
}
expoToken and deviceToken are the device's Expo push token and native device token. Only that device's tokens are removed. Answers 201 with Delete Indie Sub successful, or 400 with That subID is not registered to this app.