Update channel preferences (mandatory types cannot be disabled).
PUT
/notifications/preferences
const url = 'https://api.gospl.example/v1/notifications/preferences';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"type":"weekly_summary.submitted","channels":["in_app"],"mandatory":true}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.gospl.example/v1/notifications/preferences \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "type": "weekly_summary.submitted", "channels": [ "in_app" ], "mandatory": true } ]'Attempting to disable a mandatory type returns 422 (see spec §C).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
Array<object>
object
type
required
Seed registry; grows per feature. See spec §2.
string
channels
required
Array<string>
mandatory
Read-only hint — if true, channels cannot be fully disabled.
boolean
Responses
Section titled “ Responses ”Updated.
Media type application/json
Array<object>
object
type
required
Seed registry; grows per feature. See spec §2.
string
channels
required
Array<string>
mandatory
Read-only hint — if true, channels cannot be fully disabled.
boolean
Example
[ { "type": "weekly_summary.submitted", "channels": [ "in_app" ] }]Missing/invalid credentials.
Media type application/json
object
code
required
string
message
required
string
Example generated
{ "code": "example", "message": "example"}Attempted to disable a mandatory notification type.
Media type application/json
object
code
required
string
message
required
string
Example generated
{ "code": "example", "message": "example"}