Skip to content

Update the caller's own notification preferences

PUT
/api/users/me/notifications
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.

The kinds to change

Media typeapplication/json
One of:
object

The preferences after saving

Media typeapplication/json
object
data
required
object
address

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.

string
detail_level
required

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.

string
Allowed values: simplified advanced simplified advanced simplified advanced simplified advanced simplified advanced simplified advanced
groups
required

Groups is every group the kinds are shown under, in page order.

Array<object>
object
description
required

Description is one sentence saying what the group’s kinds are about.

string
group
required

Group is the identifier kinds name in NotificationKindResponse.Group.

string
title
required

Title is the group’s heading.

string
kinds
required

Kinds is every notification the server knows how to send, in a stable order.

Array<object>
object
description
required

Description is the sentence explaining when this one fires.

string
enabled

Enabled is this user’s answer, or the kind’s default when they have never given one.

boolean
group
required

Group names the NotificationGroupResponse this kind is shown under.

string
kind
required

Kind is the stable identifier, the key the update body uses.

string
title
required

Title is the short label shown beside the toggle.

string
mail_enabled

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.

boolean
error
string

Example

{
"data": {
"detail_level": "simplified"
}
}

Malformed body, an unrecognized notification kind, or an unknown detail level

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

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.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

No valid session

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

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.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

The session has no user record

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

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.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}