List dashboards
curl --request POST \
--url 'https://clarus-api.com/graphql#ListDashboards' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListDashboards"
payload = { "query": "query($filter: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }" }
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: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListDashboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"dashboards": {
"all": {
"edges": [
{
"node": {
"id": "3",
"code": "warehouse-ops",
"name": "Warehouse Operations",
"description": "Day-to-day operational view",
"is_active": true,
"is_default": true,
"roles": [
{
"id": "1",
"name": "Administrator"
}
],
"dashboard_widget_placements": [
{
"id": "21",
"position": {
"x": 0,
"y": 0,
"w": 2,
"h": 2
},
"dashboard_widget": {
"id": "12",
"code": "tasks-by-type",
"name": "Tasks by Type",
"widget_type": "bar"
}
}
]
}
}
]
}
}
}
}{
"error": "<string>"
}Dashboards
List dashboards
Retrieve dashboards using GraphQL. Each dashboard groups a set of widget placements and is visible to users assigned to one of its associated roles.
POST
/
graphql#ListDashboards
List dashboards
curl --request POST \
--url 'https://clarus-api.com/graphql#ListDashboards' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"query": "query($filter: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }"
}
'import requests
url = "https://clarus-api.com/graphql#ListDashboards"
payload = { "query": "query($filter: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }" }
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: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }'
})
};
fetch('https://clarus-api.com/graphql#ListDashboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"dashboards": {
"all": {
"edges": [
{
"node": {
"id": "3",
"code": "warehouse-ops",
"name": "Warehouse Operations",
"description": "Day-to-day operational view",
"is_active": true,
"is_default": true,
"roles": [
{
"id": "1",
"name": "Administrator"
}
],
"dashboard_widget_placements": [
{
"id": "21",
"position": {
"x": 0,
"y": 0,
"w": 2,
"h": 2
},
"dashboard_widget": {
"id": "12",
"code": "tasks-by-type",
"name": "Tasks by Type",
"widget_type": "bar"
}
}
]
}
}
]
}
}
}
}{
"error": "<string>"
}Query Structure
query($filter: DashboardFilterType) {
dashboards {
all(filter: $filter) {
edges {
node {
id
code
name
description
is_active
is_default
roles { id name }
dashboard_widget_placements {
id
position
dashboard_widget { id code name widget_type }
}
}
}
}
}
}
Filter Argument
All filters are passed inside thefilter argument. Each filter field accepts an input object with operators:
{
"filter": {
"is_active": {
"eq": true
}
}
}
Available Filters
| Filter | Input Type | Operators | Description |
|---|---|---|---|
code | StringInputType | eq, ilike, like, in, between | Dashboard code |
name | StringInputType | eq, ilike, like, in, between | Dashboard name |
is_active | BooleanInputType | eq | Active flag |
is_default | BooleanInputType | eq | Default-dashboard flag |
role_id | IdInputType | eq, gt, gteq, lt, lteq, in, filled | Filter by an associated role ID |
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: DashboardFilterType) { dashboards { all(filter: $filter) { edges { node { id code name description is_active is_default roles { id name } dashboard_widget_placements { id position dashboard_widget { id code name widget_type } } } } } } }"
Query variables including the filter object
Show child attributes
Show child attributes
Example:
{ "filter": { "is_active": { "eq": true } } }

