Skip to main content
DELETE
/
:projectId
/
api
/
v7
/
push-notifications
/
devices
Deregister Device
curl --request DELETE \
  --url https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices \
  --header 'Content-Type: application/json' \
  --data '
{
  "platform": "<string>",
  "token": "<string>",
  "subscription": {
    "endpoint": "<string>",
    "keys.p256dh": "<string>",
    "keys.auth": "<string>"
  }
}
'
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). If the device doesn’t exist or belongs to a different user, the request is a clean no-op (returns 404) rather than an error. Requires end-user authentication. Service and master keys are rejected for the same reason as Register Device. Requires the push bundle.

Body Parameters

platform
string
required
The device platform. One of "ios", "android", or "web".
token
string
The APNs or FCM device token. Required when platform is "ios" or "android".
subscription
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 with an empty body when the device was found and removed.

Error Responses

{ "error": "Device not found", "code": "push-device/not-found" }
Returned when no matching device exists for this user. This includes the case where the device exists but is registered to a different user — callers cannot deregister devices they don’t own.
{ "error": "Unauthorized", "code": "push-device/unauthorized" }
{ "error": "...", "code": "push-device/invalid-body" }
{ "error": "...", "code": "database/tables-not-available" }

See Also