Skip to main content
Deregister Device
Removes the calling user’s push device registration. The device is identified the same way it was registered — by its token (iOS/Android) or subscription endpoint (Web). It is a POST with the device in the request body because a device token or web-push subscription doesn’t belong in a URL, which gets logged; and your app knows its push token, not Sublay’s device id. Deregistration is idempotent. The endpoint returns 200 whether or not a matching registration existed — the contract is “this binding is gone”, and it is equally gone if an earlier call removed it or it never existed. There is no not-found error. Only the calling user’s own binding is removed. A device can be registered by several accounts at once, so deregistering unbinds the caller’s account from that device and leaves every other account’s binding on the same device intact — callers cannot deregister devices they don’t own. Requires end-user authentication. A service key is refused (403 push-device/user-token-required) for the same reason as Register Device. Requires the push bundle.

Body Parameters

string
required
The device platform. One of "ios", "android", or "web".
string
The APNs or FCM device token. Required when platform is "ios" or "android".
object
The Web Push subscription object. Required when platform is "web". The server uses only the endpoint field to identify the registration.

Response

Returns 200 on success, including when no matching registration existed.

Error Responses

Plain-text Unauthorized, with no JSON body and no code. Returned when the request carries no Authorization header at all.
Plain-text Forbidden, with no JSON body and no code. Returned when the access token is malformed, has the wrong signature, or has expired — the common case, since access tokens live 30 minutes. Refresh the access token and retry; do not treat this as a permanent refusal.
Returned when a service key is used, with or without actingUserId, before the body is checked. This endpoint has no acting-as-a-user path by design (see Security note).
A user token, or a request with no credentials, sent actingUserId, even naming its own user. A user token always acts as its own user. (A service key gets the 403 above instead.)
A body field (platform, token or subscription) was sent in the query string. On this endpoint every field goes in the request body.
DELETE /v8/:projectId/push-notifications/devices, with the device in a request body, is not a v8 route. Once the request passes the checks that run ahead of it (such as the bundle check and id validation), it gets this error, with or without a body.
Returned while the push bundle is mid-install. Retry shortly.
The deletion could not be performed. No diagnostic detail is returned; retry.
Rate limit: 50 requests per 5 minutes per IP. Exceeding it returns 429 with a plain-text message and no code.

See Also