Skip to main content
POST
/
api
/
dashboards
Create a dashboard
curl --request POST \
  --url https://clarus-api.com/api/dashboards \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "dashboards",
    "attributes": {
      "code": "warehouse-ops",
      "name": "Warehouse Operations",
      "description": "Day-to-day operational view",
      "is_active": true,
      "is_default": true,
      "role_ids": [
        1,
        4
      ]
    }
  }
}
'
{
  "id": 3
}

Request Structure

{
  "data": {
    "type": "dashboards",
    "attributes": {
      "code": "warehouse-ops",
      "name": "Warehouse Operations",
      "description": "Day-to-day operational view",
      "is_active": true,
      "is_default": true,
      "role_ids": [1, 4]
    }
  }
}

Key Fields

FieldRequiredDescription
codeYesUnique dashboard code (max 30 chars)
nameYesDisplay name (max 50 chars)
descriptionNoOptional description (max 255 chars)
is_activeNoWhether the dashboard is visible to users (default true)
is_defaultNoWhen true, this dashboard becomes the default for users — the previous default is cleared atomically (default false)
role_idsNoArray of role IDs that can access this dashboard. Passed inside attributes (not relationships)

Adding widgets

Use PUT /api/dashboards/{id}/widgets (setDashboardWidgetPlacements) to attach widgets to the dashboard. That endpoint replaces all placements atomically.

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Dashboard created successfully. Response contains the new dashboard's id.

id
integer

Identifier of the created dashboard