Add

[POST] .../v1/dashboard/add

Creates a dashboard. Create a user-owned dashboard before adding widgets or assigning the dashboard to users. The method requires a non-empty dashboard name up to 50 characters, accepts optional firm_id and stock_id filters, validates referenced company and stock when they are non-zero, inserts the dashboard, assigns it to the current request user and returns new_id. The request body is required; firm_id and stock_id may be 0 to leave the corresponding dashboard filter unset and stock must belong to firm when both are provided. The current implementation does not perform a separate permission check for dashboard creation and assigns the new dashboard to the current request user. Errors such as missing body, missing or long name, missing request user context, unknown company or stock, stock-company mismatch, storage errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
firm_id Int64 Optional Optional company filter stored on the dashboard. 0 means company is not specified.
name String Required Dashboard name, up to 50 characters.
stock_id Int64 Optional Optional stock filter stored on the dashboard. 0 means stock is not specified.

Request Example

{
  "name": "Sales overview",
  "firm_id": 10,
  "stock_id": 4
}

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": 3
  }
}