Unregister push token
Me
Unregister push token
Remove a single push token from the authenticated user’s record. Idempotent — removing a token that isn’t present succeeds quietly.
DELETE
Unregister push token
Overview
The client calls this on:- Sign-out — to stop sending push to a device that’s no longer logged in.
- Notification permission revoked — to keep the server-side record in sync with the device.
- App uninstall preflight — best-effort only; FCM 410-GONE cleanup (see Push notification fan-out) is the real safety net.
200 { removed: false } rather than 404. This is intentional: the client should not have to track whether a given token is currently registered.
Authentication
Bearer <accessToken> required. requireAuth + requireOnboarded middleware applied.
Path parameters
| Name | Type | Required | Notes | Example |
|---|---|---|---|---|
token | string | yes | The FCM registration token to remove. URL-encode it (FCM tokens contain : and other reserved chars). | fcm_eYqJ...VeryLongFCMRegistrationToken... |
Query parameters
None.Request body
None.Response — 200 OK
| Field | Type | Notes | Example |
|---|---|---|---|
removed | boolean | true iff the token was present and is now gone. false if the token was not on the user’s record (idempotent no-op). | true |
Side effects
- On
removed: true: the(token)entry is pulled from the user’spushTokensarray. - On
removed: false: no mutation.
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | :token path parameter was empty after URL-decoding. |
| 401 | UNAUTHENTICATED | Missing, malformed, or expired access token. |
| 403 | ONBOARDING_INCOMPLETE | Caller has not finished onboarding. |
See also
- Register push token — the upsert counterpart.
- Push notification fan-out — Invalid token cleanup — the worker also removes tokens on FCM 410-GONE responses, so this endpoint is rarely strictly required.