Skip to content

Switch one notification channel on or off

PATCH
/notifications/preferences
curl --request PATCH \
--url https://work.optidata.cloud/api/notifications/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "app_id": 1, "notification_key": "drive.share.permission_created", "channel": "email", "is_enabled": false }'

Enables or disables a single channel of a single notification. The response is deliberately minimal — the rest of the tree is unchanged, so there is nothing to resynchronise.

An app that does not expose notification preferences, or a notification or channel the tenant cannot address, is rejected with 422 on the matching field.

Media typeapplication/json
object
app_id
required

The app that emits the notification.

integer
notification_key
required
string
channel
required
string
Allowed values: email web mobile
is_enabled
required
boolean
locale

Locale used for any validation message.

string | null
Examples
ExampledisableEmail
{
"app_id": 1,
"notification_key": "drive.share.permission_created",
"channel": "email",
"is_enabled": false
}

The preference was stored.

Media typeapplication/json

Minimal acknowledgement returned by several write operations.

object
success
required
boolean
Example
{
"success": true
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}