[POST] .../v1/usernotify/set
Sets (includes/disables) subscription on notification for user Use this batch method to 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 through the persistent layer and returns row_affected. This controller method currently does not perform a dedicated permission check, although it executes in the current request user context. Empty array, missing notification_key, invalid user_id, persistent validation errors and database failures are returned as HTTP 200 ErrorResult business errors.
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": []
}
}