Update notification settings
const options = {
method: 'PATCH',
headers: {cookie: 'session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: {slack: {enabled: true, webhookUrl: '<string>', channel: '<string>'}},
subscriptions: {}
})
};
fetch('https://api.example.com/v1/regions/global/notifications/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/global/notifications/settings"
payload := strings.NewReader("{\n \"channels\": {\n \"slack\": {\n \"enabled\": true,\n \"webhookUrl\": \"<string>\",\n \"channel\": \"<string>\"\n }\n },\n \"subscriptions\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "session=")
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))
}curl --request PATCH \
--url https://api.example.com/v1/regions/global/notifications/settings \
--header 'Content-Type: application/json' \
--cookie session= \
--data '
{
"channels": {
"slack": {
"enabled": true,
"webhookUrl": "<string>",
"channel": "<string>"
}
},
"subscriptions": {}
}
'import requests
url = "https://api.example.com/v1/regions/global/notifications/settings"
payload = {
"channels": { "slack": {
"enabled": True,
"webhookUrl": "<string>",
"channel": "<string>"
} },
"subscriptions": {}
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"channels": {
"inApp": {
"enabled": true
},
"email": {
"enabled": true,
"address": "jsmith@example.com",
"digestFrequency": "realtime"
},
"slack": {
"enabled": true,
"webhookUrl": "<string>",
"channel": "<string>"
}
},
"subscriptions": {}
},
"meta": {}
}Settings
Update notification settings
Update user’s notification preferences
PATCH
/
v1
/
regions
/
global
/
notifications
/
settings
Update notification settings
const options = {
method: 'PATCH',
headers: {cookie: 'session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
channels: {slack: {enabled: true, webhookUrl: '<string>', channel: '<string>'}},
subscriptions: {}
})
};
fetch('https://api.example.com/v1/regions/global/notifications/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/global/notifications/settings"
payload := strings.NewReader("{\n \"channels\": {\n \"slack\": {\n \"enabled\": true,\n \"webhookUrl\": \"<string>\",\n \"channel\": \"<string>\"\n }\n },\n \"subscriptions\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "session=")
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))
}curl --request PATCH \
--url https://api.example.com/v1/regions/global/notifications/settings \
--header 'Content-Type: application/json' \
--cookie session= \
--data '
{
"channels": {
"slack": {
"enabled": true,
"webhookUrl": "<string>",
"channel": "<string>"
}
},
"subscriptions": {}
}
'import requests
url = "https://api.example.com/v1/regions/global/notifications/settings"
payload = {
"channels": { "slack": {
"enabled": True,
"webhookUrl": "<string>",
"channel": "<string>"
} },
"subscriptions": {}
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"channels": {
"inApp": {
"enabled": true
},
"email": {
"enabled": true,
"address": "jsmith@example.com",
"digestFrequency": "realtime"
},
"slack": {
"enabled": true,
"webhookUrl": "<string>",
"channel": "<string>"
}
},
"subscriptions": {}
},
"meta": {}
}Authorizations
Session-based authentication via HTTP-only cookie
Was this page helpful?