Skip to main content
This endpoint registers or refreshes an Expo push token for your account. Pacifica sends mobile_push notifications to every active token on the account.

Operation Type (for Signing)

Request Body

FieldTypeNeedDescriptionExample
”account”stringrequiredUser’s wallet address42trU9A5…
“signature”stringrequiredCryptographic signature5j1Vy9Uq…
“timestamp”integerrequiredCurrent timestamp in milliseconds1716200000000
”expo_push_token”stringrequiredExpo push token from the Expo SDK. It must have the form ExponentPushToken[…] or ExpoPushToken[…], and up to 512 charactersExponentPushToken[xxxx]
“platform”stringrequired”ios” or “android”ios
”device_id”stringrequiredSecret installation key that your app generates once and keeps. 16 to 256 charactersb7f3c1a9…
“expiry_window”integeroptionalSignature expiry in milliseconds30000
You must sign this request with the account key. An agent wallet can’t sign it. device_id identifies one installation of your app. Generate at least 128 random bits on the first install, and keep them in the device’s secure storage. Don’t use a hardware ID or a user ID. The length check doesn’t make a weak key safe.
  • When you register again with the same device_id, Pacifica refreshes the registration. If the token changed, Pacifica turns off the old token.
  • A token belongs to one installation. If a different device_id already holds the token, the request fails with status 409. This is also true after that installation unregisters the token.
  • If the same installation registers under another account, the token moves to that account. The previous account stops sending to it.
After you register, turn on mobile_push with Set notification master preference and Set notification preference.

Response

  • Status 200: Device registered
FieldTypeDescription
”expo_push_token”stringRegistered Expo push token
”platform”string”ios” or “android"
"device_id”stringInstallation key that holds the token
”enabled”booleantrue when Pacifica sends to this token
  • Status 400: Invalid request parameters or signature. A bad token returns error_id invalid_expo_push_token. A missing or bad device_id returns invalid_notification_device_id
  • Status 403: The account doesn’t exist. An account exists after its first deposit
  • Status 409: Another installation holds this token
  • Status 429: Rate limit exceeded
  • Status 500: Internal server error

Code Example (Python)