PushFlow

Push Notification API

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

FieldRequiredTypeDescription
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

FieldTypeDescription
categorystringThe message category (e.g. Work, Finance, Personal, Alerts). Defaults to General if omitted.
idstringMessage identity. A later push with the same id updates the existing message instead of adding a new one.
image_urlstringOptional image shown below the message.
soundstringAudio file played in-app when the notification is received in the foreground.
anything_elseanyAny other keys are passed through and delivered with the notification.

Defaults & rules

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

CodeMeaning
200Accepted by Expo push service.
400Invalid JSON, or a required field (to, title, body) is missing.
401The push token is not registered / authorized.
502The 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

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