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>"
}
}
'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices"
payload = {
"platform": "<string>",
"token": "<string>",
"subscription": {
"endpoint": "<string>",
"keys.p256dh": "<string>",
"keys.auth": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
platform: '<string>',
token: '<string>',
subscription: {endpoint: '<string>', 'keys.p256dh': '<string>', 'keys.auth': '<string>'}
})
};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'platform' => '<string>',
'token' => '<string>',
'subscription' => [
'endpoint' => '<string>',
'keys.p256dh' => '<string>',
'keys.auth' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices"
payload := strings.NewReader("{\n \"platform\": \"<string>\",\n \"token\": \"<string>\",\n \"subscription\": {\n \"endpoint\": \"<string>\",\n \"keys.p256dh\": \"<string>\",\n \"keys.auth\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices")
.header("Content-Type", "application/json")
.body("{\n \"platform\": \"<string>\",\n \"token\": \"<string>\",\n \"subscription\": {\n \"endpoint\": \"<string>\",\n \"keys.p256dh\": \"<string>\",\n \"keys.auth\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"platform\": \"<string>\",\n \"token\": \"<string>\",\n \"subscription\": {\n \"endpoint\": \"<string>\",\n \"keys.p256dh\": \"<string>\",\n \"keys.auth\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyPush Notification Endpoints
Deregister Device
Remove a device registration so the authenticated user stops receiving push notifications on it
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>"
}
}
'import requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices"
payload = {
"platform": "<string>",
"token": "<string>",
"subscription": {
"endpoint": "<string>",
"keys.p256dh": "<string>",
"keys.auth": "<string>"
}
}
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
platform: '<string>',
token: '<string>',
subscription: {endpoint: '<string>', 'keys.p256dh': '<string>', 'keys.auth': '<string>'}
})
};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'platform' => '<string>',
'token' => '<string>',
'subscription' => [
'endpoint' => '<string>',
'keys.p256dh' => '<string>',
'keys.auth' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices"
payload := strings.NewReader("{\n \"platform\": \"<string>\",\n \"token\": \"<string>\",\n \"subscription\": {\n \"endpoint\": \"<string>\",\n \"keys.p256dh\": \"<string>\",\n \"keys.auth\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices")
.header("Content-Type", "application/json")
.body("{\n \"platform\": \"<string>\",\n \"token\": \"<string>\",\n \"subscription\": {\n \"endpoint\": \"<string>\",\n \"keys.p256dh\": \"<string>\",\n \"keys.auth\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/push-notifications/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"platform\": \"<string>\",\n \"token\": \"<string>\",\n \"subscription\": {\n \"endpoint\": \"<string>\",\n \"keys.p256dh\": \"<string>\",\n \"keys.auth\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyRemoves 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
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.
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
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
Returns200 with an empty body when the device was found and removed.
Error Responses
Not Found — 404
Not Found — 404
{ "error": "Device not found", "code": "push-device/not-found" }
Unauthorized — 401
Unauthorized — 401
{ "error": "Unauthorized", "code": "push-device/unauthorized" }
Invalid Body — 400
Invalid Body — 400
{ "error": "...", "code": "push-device/invalid-body" }
Bundle Not Installed — 403
Bundle Not Installed — 403
{ "error": "...", "code": "database/tables-not-available" }

