List dashboard widgets
curl --request POST \
--url 'https://clarus-api.com/graphql#ListDashboardWidgets' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListDashboardWidgets"
payload = { "query": "query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }" }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListDashboardWidgets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"dashboard_widgets": {
"all": {
"edges": [
{
"node": {
"id": "12",
"code": "tasks-by-type",
"name": "Tasks by Type",
"description": "Open tasks grouped by task type",
"widget_type": "bar",
"configuration": {
"metric": "total_records",
"color_palette": "default",
"show_legend": true,
"legend_position": "bottom",
"horizontal": false,
"log_scale": false,
"limit": 10
},
"dashboard_filters": {
"warehouse_id": 1
},
"report_query_id": "4"
}
}
]
}
}
}
}{
"error": "<string>"
}Dashboard Widgets
List dashboard widgets
Retrieve dashboard widgets using GraphQL. Widgets are reusable chart components bound to a report query; they are placed onto dashboards via the dashboard widget placement endpoint.
POST
/
graphql#ListDashboardWidgets
List dashboard widgets
curl --request POST \
--url 'https://clarus-api.com/graphql#ListDashboardWidgets' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListDashboardWidgets"
payload = { "query": "query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }" }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListDashboardWidgets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"dashboard_widgets": {
"all": {
"edges": [
{
"node": {
"id": "12",
"code": "tasks-by-type",
"name": "Tasks by Type",
"description": "Open tasks grouped by task type",
"widget_type": "bar",
"configuration": {
"metric": "total_records",
"color_palette": "default",
"show_legend": true,
"legend_position": "bottom",
"horizontal": false,
"log_scale": false,
"limit": 10
},
"dashboard_filters": {
"warehouse_id": 1
},
"report_query_id": "4"
}
}
]
}
}
}
}{
"error": "<string>"
}Query Structure
query($filter: DashboardWidgetFilterType) {
dashboard_widgets {
all(filter: $filter) {
edges {
node {
id
code
name
description
widget_type
configuration
dashboard_filters
report_query_id
}
}
}
}
}
Filter Argument
All filters are passed inside thefilter argument. Each filter field accepts an input object with operators:
{
"filter": {
"widget_type": {
"eq": "bar"
}
}
}
Available Filters
| Filter | Input Type | Operators | Description |
|---|---|---|---|
code | StringInputType | eq, ilike, like, in, between | Widget code |
name | StringInputType | eq, ilike, like, in, between | Widget name |
widget_type | DashboardWidgetTypeInputType | eq, in | Rendering type (bar, line, pie, etc. — see create endpoint for full list) |
report_query_id | IdInputType | eq, gt, gteq, lt, lteq, in, filled | Filter by linked report query |
Filter Operators
| Input Type | Operators |
|---|---|
| StringInputType | eq (exact), ilike (case-insensitive partial), like (case-sensitive partial), in (array match), between (range) |
| IntegerInputType | eq, gt, gteq, lt, lteq, between |
| DatetimeInputType | eq, from, to, between |
| BooleanInputType | eq (required) |
| IdInputType | eq, gt, gteq, lt, lteq, in, filled |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
FlowAuthorization Code
- Authorization URL
- https://clarus-api.com/oauth/authorize
- Token URL
- https://clarus-api.com/oauth/token
FlowClient Credentials
- Token URL
- https://clarus-api.com/oauth/token
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
GraphQL query string
Example:
"query($filter: DashboardWidgetFilterType) { dashboard_widgets { all(filter: $filter) { edges { node { id code name description widget_type configuration dashboard_filters report_query_id } } } } }"
Query variables including the filter object
Show child attributes
Show child attributes
Example:
{
"filter": { "widget_type": { "eq": "bar" } }
}

