Overview
A PushDevice represents one browser profile or installed mobile application. installation_id is a stable identifier chosen by your application. push_token is the current token returned by the Firebase client SDK.
Firebase can refresh a token. Register the same installation_id again with the new push_token; PulseGrid updates the existing installation instead of creating a duplicate.
Call this endpoint from a trusted backend. Do not expose X-PulseGrid-Secret-Key in browser JavaScript or a distributed mobile application.
Setup
1. Request notification permission in the app.
2. Use Firebase's client SDK to obtain the FCM registration token.
3. Send the token to your own authenticated backend.
4. Your backend calls PulseGrid using the project public and secret keys.
5. platform must be android, ios or web.
6. app_user_id is optional and links the installation to a known PulseGrid AppUser.
7. topics is an optional list, for example ["news", "order-updates"].
8. Re-register after token refresh, login or relevant device-profile changes.
9. Deactivate the installation when the user opts out or signs out if that is your application's desired privacy behaviour.
Code example
POST https://your-pulsegrid-domain.com/api/push/devices/register/
X-PulseGrid-Public-Key: pk_your_public_key
X-PulseGrid-Secret-Key: sk_your_secret_key
Content-Type: application/json
{
"project_id": "210d1f81-1d6e-412b-a0a0-b3cd843e82fb",
"installation_id": "browser-c9f09b",
"push_token": "FCM_REGISTRATION_TOKEN",
"platform": "web",
"device_name": "Customer Chrome",
"app_version": "1.4.0",
"topics": ["order-updates"]
}
Deactivate:
POST https://your-pulsegrid-domain.com/api/push/devices/deactivate/
{
"project_id": "210d1f81-1d6e-412b-a0a0-b3cd843e82fb",
"installation_id": "browser-c9f09b"
}
Notes
The project ID must match the API key's project. Cross-project registration is rejected. Plan limits control active devices per project. Tokens rejected by Firebase as invalid or unregistered are automatically disabled so they are not repeatedly billed or retried.