Users

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.

patch/users/me/preferences/notifications

Request body

Example request

{
  "preferences": [
    {
      "level": "nothing",
      "scope": {
        "account_id": "biz_xxxxxxxxxxxxxx",
        "channel": "in_app",
        "experience_id": "exp_xxxxxxxxxxxxxx",
        "team_account_id": "biz_xxxxxxxxxxxxxx",
        "topic_id": "topic_xxxxxxxxxxxxxx"
      }
    }
  ]
}

Response

preferences set

Example response

{
  "data": [
    {
      "level": "nothing",
      "object": "notification_preference",
      "scope": {
        "account_id": "biz_xxxxxxxxxxxxxx",
        "channel": "in_app",
        "experience_id": "exp_xxxxxxxxxxxxxx",
        "team_account_id": "biz_xxxxxxxxxxxxxx",
        "topic_id": "topic_xxxxxxxxxxxxxx"
      }
    }
  ]
}

Changes

Changed in 3 of the 41 revisions of this API.4

    • added the optional property error/code to the response with the 400 status

      response-optional-property-added

    • added the optional property error/code to the response with the 404 status

      response-optional-property-added

    This revision also has 9 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the security scope user:notifications:update was added to the endpoint's security scheme bearerAuth

      api-security-scope-added

    This revision also has 16 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog