import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const response = await client.users.preferences.notifications.set({
preferences: [
{
level: 'all',
scope: {},
},
],
});
console.log(response.data);curl --request PATCH \
--url https://api.whop.com/api/v1/users/me/preferences/notifications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"preferences": [
{
"scope": {
"account_id": "<string>",
"experience_id": "<string>",
"team_account_id": "<string>",
"topic_id": "<string>"
}
}
]
}
'import requests
url = "https://api.whop.com/api/v1/users/me/preferences/notifications"
payload = { "preferences": [{ "scope": {
"account_id": "<string>",
"experience_id": "<string>",
"team_account_id": "<string>",
"topic_id": "<string>"
} }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/users/me/preferences/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'preferences' => [
[
'scope' => [
'account_id' => '<string>',
'experience_id' => '<string>',
'team_account_id' => '<string>',
'topic_id' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.whop.com/api/v1/users/me/preferences/notifications"
payload := strings.NewReader("{\n \"preferences\": [\n {\n \"scope\": {\n \"account_id\": \"<string>\",\n \"experience_id\": \"<string>\",\n \"team_account_id\": \"<string>\",\n \"topic_id\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.whop.com/api/v1/users/me/preferences/notifications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"preferences\": [\n {\n \"scope\": {\n \"account_id\": \"<string>\",\n \"experience_id\": \"<string>\",\n \"team_account_id\": \"<string>\",\n \"topic_id\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/users/me/preferences/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"preferences\": [\n {\n \"scope\": {\n \"account_id\": \"<string>\",\n \"experience_id\": \"<string>\",\n \"team_account_id\": \"<string>\",\n \"topic_id\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"level": "all",
"object": "notification_preference",
"scope": {
"account_id": "<string>",
"channel": "in_app",
"experience_id": "<string>",
"team_account_id": "<string>",
"topic_id": "<string>"
}
}
]
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}Set
Sets the authenticated user’s notification preferences. Each preference is addressed by scope, not by id, so a scope read back from either list endpoint can be sent straight here.
A scope naming an experience with no topic sets that experience’s level, and accepts all three levels. Any other scope sets a topic override, which is binary — all or nothing — and requires a channel.
level: null clears the preference. Preferences are stored as overrides, so clearing one means the scope inherits its default again rather than being switched off.
The batch is applied in one transaction: if any entry is rejected, none are written. Experience levels are applied before topic overrides, because setting a level replaces every topic preference for that experience — so an override sent alongside a level wins. The response reports what each scope now resolves to, in the order the entries were sent.
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const response = await client.users.preferences.notifications.set({
preferences: [
{
level: 'all',
scope: {},
},
],
});
console.log(response.data);curl --request PATCH \
--url https://api.whop.com/api/v1/users/me/preferences/notifications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"preferences": [
{
"scope": {
"account_id": "<string>",
"experience_id": "<string>",
"team_account_id": "<string>",
"topic_id": "<string>"
}
}
]
}
'import requests
url = "https://api.whop.com/api/v1/users/me/preferences/notifications"
payload = { "preferences": [{ "scope": {
"account_id": "<string>",
"experience_id": "<string>",
"team_account_id": "<string>",
"topic_id": "<string>"
} }] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/users/me/preferences/notifications",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'preferences' => [
[
'scope' => [
'account_id' => '<string>',
'experience_id' => '<string>',
'team_account_id' => '<string>',
'topic_id' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.whop.com/api/v1/users/me/preferences/notifications"
payload := strings.NewReader("{\n \"preferences\": [\n {\n \"scope\": {\n \"account_id\": \"<string>\",\n \"experience_id\": \"<string>\",\n \"team_account_id\": \"<string>\",\n \"topic_id\": \"<string>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.whop.com/api/v1/users/me/preferences/notifications")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"preferences\": [\n {\n \"scope\": {\n \"account_id\": \"<string>\",\n \"experience_id\": \"<string>\",\n \"team_account_id\": \"<string>\",\n \"topic_id\": \"<string>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/users/me/preferences/notifications")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"preferences\": [\n {\n \"scope\": {\n \"account_id\": \"<string>\",\n \"experience_id\": \"<string>\",\n \"team_account_id\": \"<string>\",\n \"topic_id\": \"<string>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"level": "all",
"object": "notification_preference",
"scope": {
"account_id": "<string>",
"channel": "in_app",
"experience_id": "<string>",
"team_account_id": "<string>",
"topic_id": "<string>"
}
}
]
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}Authorizations
A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
Headers
Pins the request to a dated API version.
"2026-07-27"
Body
The preferences to set, at most 100 per request.
1 - 100 elementsShow child attributes
Show child attributes
Response
preferences set
Show child attributes
Show child attributes

