Send a push notification
Post a JSON message to the endpoint below. The service validates your request, then delivers the notification to the target device through Expo's push service.
POST https://vortextapi.ca/pushflow
Header: Content-Type: application/json
Example request
// curl
curl -X POST https://vortextapi.ca/pushflow \
-H "Content-Type: application/json" \
-d '{
"to": "your-push-token",
"title": "Live Chat",
"body": "monies",
"data": {
"category": "FINANCE",
"livechat": "1",
"this": "that"
}
}'
Fields
| Field | Required | Type | Description |
|---|---|---|---|
to |
Yes | string | The recipient's push token. Send the token itself — the service wraps it in ExponentPushToken[...] automatically. Must be registered, otherwise the request is rejected. |
title |
Yes | string | The notification title. |
body |
Yes | string | The notification body text. |
sound |
No | string | Sound to play. Defaults to "default". |
data |
No | object | Arbitrary data delivered with the notification. The message category goes in data.category. |
Inside data
| Field | Type | Description |
|---|---|---|
category | string | The message category (e.g. Work, Finance, Personal, Alerts). Defaults to General if omitted. |
id | string | Message identity. A later push with the same id updates the existing message instead of adding a new one. |
image_url | string | Optional image shown below the message. |
sound | string | Audio file played in-app when the notification is received in the foreground. |
anything_else | any | Any other keys are passed through and delivered with the notification. |
Defaults & rules
to,title, andbodyare required.- The message category is read from
data.categoryand defaults toGeneralif omitted. sounddefaults to"default"when not supplied.- All other fields are passed through to Expo unchanged.
The
to token must exist in the access_tokens table. Unregistered tokens are rejected.Response
The service returns Expo's response. On success it looks like:
{
"data": [
{
"status": "ok",
"id": "c1f6d1a0-0000-0000-0000-000000000000"
}
]
}
If something is wrong, an error is returned instead:
{
"error": "push token not authorized"
}
HTTP status codes
| Code | Meaning |
|---|---|
| 200 | Accepted by Expo push service. |
| 400 | Invalid JSON, or a required field (to, title, body) is missing. |
| 401 | The push token is not registered / authorized. |
| 502 | The Expo push service could not be reached. |
Replies
Recipients can reply to a notification from the message detail screen in the PushFlow app. When a reply is sent, the app POSTs the reply as JSON to the Reply endpoint configured in the app's Settings (→ Replies → Reply endpoint). The last reply and its timestamp are also stored on the device.
Reply JSON format
{
"response": "Got it, thanks!",
"title": "Original message title",
"body": "Original message body",
"data": {
"category": "FINANCE",
"id": "message-id",
"from": "sender-push-token"
}
}
Fields
| Field | Required | Type | Description |
|---|---|---|---|
response |
Yes | string | The reply text entered by the recipient. |
title |
No | string | The original message title. |
body |
No | string | The original message body, if any. |
data |
No | object | The original notification's data, passed through unchanged. Use it to route the reply back to the sender (for example, include the sender's token as data.from). |