Skip to content

Area: Developers

POST

Register a mobile app push token

Path
/appPush/tokens
Auth
Access token · browser or app
POST
/appPush/tokens
curl --request POST \
--url https://releva.ai/api/v0/appPush/tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "profileId": "DEMO-CUSTOMER-1001", "deviceId": "demo-device-android-0001", "deviceType": "android", "pushToken": "demo-fcm-registration-token-android-0001" }'

Registers the push token of one app install so Releva can send it push notifications from campaigns and workflows. The Releva mobile SDKs call it for you (React Native registerPushToken). Call it again when the token or the profile id changes. Writes a pushNotificationSubscribe event (which can trigger campaigns) on every call, and creates a placeholder profile when profileId is unknown. Only tokens with deviceType android or ios are ever sent to. With tokenType: apns, Releva exchanges the APNs token for an FCM token through the shop’s iOS Firebase project (“APNs import”). Processing is asynchronous. Unknown fields are ignored.

Media typeapplication/json
object
profileId
required

Your customer id for the profile. Must not be null. A merged-away id is resolved to the surviving profile.

string
deviceId
required

Stable id of the app install.

string
deviceType

Stored as the token’s platform. Only android and ios tokens receive pushes; always send it.

string
Allowed values: android ios huawei other
pushToken
required

FCM registration token, or a raw APNs device token (64 hex characters) when tokenType is apns.

string
tokenType

Apns exchanges the APNs token for an FCM token through the shop’s iOS Firebase project and stores the device as ios.

string
default: fcm
Allowed values: fcm apns
bundleId

IOS bundle identifier. Required when tokenType is apns.

string
notificationStyle

Data (stored default): data-only messages, the SDK draws the notification. notification: Android pushes carry an FCM notification block so Android draws them (used with the Expo adapter).

string
Allowed values: data notification
key
additional properties
any

Examples

{
"profileId": "DEMO-CUSTOMER-1001",
"deviceId": "demo-device-android-0001",
"deviceType": "android",
"pushToken": "demo-fcm-registration-token-android-0001"
}

Accepted for asynchronous processing.

Media typeapplication/json
object
0

Example

{}

Authentication, validation or APNs import error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Examples

{
"message": "The 'profileId' field is required. The 'deviceId' field is required. The 'pushToken' field is required."
}

The domain is disabled.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Domain is disabled. Please reach out to support@releva.ai to enable it."
}

Request body larger than 800 KB.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "request entity too large"
}

Unexpected server error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "An internal error occurred."
}