Skip to Content
HomeLink Hub
Users & Profile

Register a device's Expo push token

POST
/api/v1/user/push-tokens

Access: Bearer token required.

Registers the device's Expo push token for the signed-in user so push notifications reach it. It is an upsert, so the app can call it on every launch: an existing entry for the same token is refreshed rather than duplicated. A token belongs to one account at a time, so registering it first removes it from any other account that had it (for example the previous user of the phone). Only the 10 most recently registered devices are kept per account.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Request Body

application/json
  1. body
token*string

Expo push token, in the form ExponentPushToken[...] or ExpoPushToken[...].

Match^Expo(nent)?PushToken\[.+\]$
platform*string

Device platform: ios or android.

Value in"ios""android"
deviceName?string

Optional human-readable device name, up to 100 characters.

Lengthlength <= 100

Response Body

Token registered or refreshed

application/json
  1. response
status*integer
success*boolean
message*string
data*unknown
Example Request
curl -X POST 'http://localhost:4000/api/v1/user/push-tokens' \  -H 'Content-Type: application/json' \  -d '{  "token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",  "platform": "ios",  "deviceName": "Adaeze'\''s iPhone 15"}'
Example Response
{  "status": 200,  "success": true,  "message": "Push token registered.",  "data": null}