Update the caller's own notification preferences
const url = 'https://example.com/api/users/me/notifications';const options = { method: 'PUT', headers: { 'X-Ssoossh-Key-Secret': '<X-Ssoossh-Key-Secret>', 'Content-Type': 'application/json' }, body: '{}'};
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://example.com/api/users/me/notifications \ --header 'Content-Type: application/json' \ --header 'X-Ssoossh-Key-Secret: <X-Ssoossh-Key-Secret>' \ --data '{}'Sets the caller’s answer for each notification kind named in the body, leaving every other kind unchanged. An unrecognized kind is rejected rather than ignored, and nothing is stored when one is present. detail_level, when present, sets the email detail level in the same save.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The kinds to change
object
The kinds to change
object
DetailLevel is how much of the covered pages this person sees: “simplified” or “advanced”. Stored on the server so it follows the person between browsers; the email level is separate and travels with the notification preferences.
Kinds maps a notification kind to whether it should be sent. An unknown key is rejected rather than ignored: silently dropping it would report success for a preference that was never stored.
object
Responses
Section titled “Responses”The preferences after saving
object
object
Address is where notifications would be sent, from the users table. Empty when the identity provider releases no email claim — the other reason nothing arrives, and equally worth showing.
DetailLevel is how much of the covered pages this person sees: “simplified” or “advanced”. Stored on the server so it follows the person between browsers; the email level is separate and travels with the notification preferences.
Groups is every group the kinds are shown under, in page order.
object
Description is one sentence saying what the group’s kinds are about.
Group is the identifier kinds name in NotificationKindResponse.Group.
Title is the group’s heading.
Kinds is every notification the server knows how to send, in a stable order.
object
Description is the sentence explaining when this one fires.
Enabled is this user’s answer, or the kind’s default when they have never given one.
Group names the NotificationGroupResponse this kind is shown under.
Kind is the stable identifier, the key the update body uses.
Title is the short label shown beside the toggle.
MailEnabled reports whether the server can send mail at all. False means the toggles are still recorded but nothing is delivered, which the page says out loud rather than leaving the user to infer.
Example
{ "data": { "detail_level": "simplified" }}Malformed body, an unrecognized notification kind, or an unknown detail level
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}No valid session
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}The session has no user record
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}