Update a dashboard widget
curl --request PATCH \
--url https://clarus-api.com/api/dashboard_widgets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "dashboard_widgets",
"attributes": {
"name": "Tasks by Type (last 7 days)",
"configuration": {
"metric": "total_records",
"color_palette": "cool",
"show_legend": true,
"legend_position": "bottom",
"horizontal": false,
"log_scale": false,
"limit": 5
}
}
}
}
'import requests
url = "https://clarus-api.com/api/dashboard_widgets/{id}"
payload = { "data": {
"type": "dashboard_widgets",
"attributes": {
"name": "Tasks by Type (last 7 days)",
"configuration": {
"metric": "total_records",
"color_palette": "cool",
"show_legend": True,
"legend_position": "bottom",
"horizontal": False,
"log_scale": False,
"limit": 5
}
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'dashboard_widgets',
attributes: {
name: 'Tasks by Type (last 7 days)',
configuration: {
metric: 'total_records',
color_palette: 'cool',
show_legend: true,
legend_position: 'bottom',
horizontal: false,
log_scale: false,
limit: 5
}
}
}
})
};
fetch('https://clarus-api.com/api/dashboard_widgets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Dashboard Widgets
Update a dashboard widget
Update an existing dashboard widget’s attributes. All fields are optional; only supplied fields are updated.
PATCH
/
api
/
dashboard_widgets
/
{id}
Update a dashboard widget
curl --request PATCH \
--url https://clarus-api.com/api/dashboard_widgets/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "dashboard_widgets",
"attributes": {
"name": "Tasks by Type (last 7 days)",
"configuration": {
"metric": "total_records",
"color_palette": "cool",
"show_legend": true,
"legend_position": "bottom",
"horizontal": false,
"log_scale": false,
"limit": 5
}
}
}
}
'import requests
url = "https://clarus-api.com/api/dashboard_widgets/{id}"
payload = { "data": {
"type": "dashboard_widgets",
"attributes": {
"name": "Tasks by Type (last 7 days)",
"configuration": {
"metric": "total_records",
"color_palette": "cool",
"show_legend": True,
"legend_position": "bottom",
"horizontal": False,
"log_scale": False,
"limit": 5
}
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'dashboard_widgets',
attributes: {
name: 'Tasks by Type (last 7 days)',
configuration: {
metric: 'total_records',
color_palette: 'cool',
show_legend: true,
legend_position: 'bottom',
horizontal: false,
log_scale: false,
limit: 5
}
}
}
})
};
fetch('https://clarus-api.com/api/dashboard_widgets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "dashboard_widgets",
"attributes": {
"name": "Tasks by Type (last 7 days)",
"configuration": {
"metric": "total_records",
"color_palette": "cool",
"show_legend": true,
"legend_position": "bottom",
"horizontal": false,
"log_scale": false,
"limit": 5
}
}
}
}
widget_type values and the per-type configuration reference.Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the dashboard widget to update
Body
application/json
Show child attributes
Show child attributes
Response
Operation completed successfully with no content to return
⌘I

