Get Notification Preferences
curl --request GET \
--url https://api.sublay.io/v8/:projectId/push-notifications/preferences \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/push-notifications/preferences"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/push-notifications/preferences', 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/v8/:projectId/push-notifications/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/push-notifications/preferences"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v8/:projectId/push-notifications/preferences")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/push-notifications/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"disabledTypes": [
"<string>"
]
}Push Notification Endpoints
Get Notification Preferences
Read the authenticated user’s disabled push notification types
Get Notification Preferences
curl --request GET \
--url https://api.sublay.io/v8/:projectId/push-notifications/preferences \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/push-notifications/preferences"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/push-notifications/preferences', 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/v8/:projectId/push-notifications/preferences",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/v8/:projectId/push-notifications/preferences"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sublay.io/v8/:projectId/push-notifications/preferences")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/push-notifications/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"disabledTypes": [
"<string>"
]
}Returns the set of notification event types the acting user has disabled for push. A user with no preference row is all-on — the response is an empty
Returned when an end-user token names a
Returned when the
Returned when a service/master key omits the required
Returned when the
Returned while the
Rate limit: 100 requests per 5 minutes per IP. Exceeding it returns
disabledTypes array.
Disabling a type only suppresses push; the in-app notification is still written.
Requires authentication. Acting-user-scoped: an end-user token (Authorization: Bearer <accessToken>) reads its own preferences. A service/master key acts on behalf of a named user via the optional userId query param — a service key without userId is rejected, and an end-user token may not name a different user. Requires the push bundle.
Query Parameters
string
The acting user whose preferences are read. Service/master keys only — a service key must pass it; an end-user token infers it from the auth token and may not name a different user.
Response
Returns200.
{ "disabledTypes": ["new-follow", "message"] }
string[]
The event types the user has opted out of. Empty when no preferences are set (all-on). Values are drawn from the event palette.
Error Responses
No Credential — 401
No Credential — 401
Plain-text
Unauthorized, with no JSON body and no code. Returned when the
request carries no Authorization header at all.Rejected Credential — 403
Rejected Credential — 403
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.Acting As Another User — 403
Acting As Another User — 403
{ "error": "Unauthorized", "code": "notification-preferences/unauthorized" }
userId other than its own.Invalid Query — 400
Invalid Query — 400
{ "error": "...", "code": "notification-preferences/invalid-query" }
userId query parameter is not a valid identifier.Missing User ID — 400
Missing User ID — 400
{ "error": "Missing user ID", "code": "notification-preferences/missing-user-id" }
userId (it has no implicit session user).Bundle Not Installed — 403
Bundle Not Installed — 403
{
"code": "database/tables-not-available",
"missingTables": ["PushProviderConfigs", "PushDevices", "NotificationPreferences"],
"dashboardUrl": "https://…/<projectId>/database"
}
push bundle is not installed for this project.Bundle Provisioning — 503
Bundle Provisioning — 503
{
"code": "database/tables-provisioning",
"missingTables": ["PushProviderConfigs", "PushDevices", "NotificationPreferences"],
"bundleId": "push"
}
push bundle is mid-install. Retry shortly.Server Error — 500
Server Error — 500
{
"error": "Internal server error.",
"code": "notification-preferences/server-error"
}
429 with a plain-text message and no code.

