Set
[POST] .../v1/userdashboard/set
Assigns a dashboard to a user. Use this method after Dashboard/Add or Dashboard/Get to attach a dashboard to the current user or to another user. The method checks the user-dashboard set permission, resolves user_id from the request or current request context when user_id is omitted or 0, validates the user and dashboard, inserts or refreshes the assignment, copies the dashboard default flag to the assignment and returns new_id. The request body is required, dashboard_id must be positive and user_id may be 0 to target the current request user. Errors such as missing body, denied permission, negative user_id, invalid dashboard_id, missing current user context, missing user or dashboard, storage errors are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dashboard_id | Int64 | Required | Dashboard ID. |
| user_id | Int64 | Optional | User ID. If omitted or 0, the current request user is used. |
Request Example
{
"user_id": 0,
"dashboard_id": 3
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 22
}
}