Set

[POST] .../v1/usernotify/set

Enables or disables a user notification subscription. Replace or set one or more notification subscription values for users. The request body is a JSON array of UserNotifySet records; the method validates that the array is not empty, each notification_key is provided and each user_id is positive, then writes the settings and returns row_affected. this method does not perform a dedicated permission check, although it executes in the current request user context. Empty array, missing notification_key, invalid user_id, validation errors and storage errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
notification_key String Required Template code or notification key.
user_id Int64 Required User ID.
value Boolean Required Boolean value (true or false).

Request Example

[
  {
    "user_id": 17,
    "notification_key": "task_assigned",
    "value": true
  },
  {
    "user_id": 17,
    "notification_key": "task_closed",
    "value": false
  }
]

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 2,
    "ids": []
  }
}