Set dashboard widget placements
curl --request PUT \
--url https://clarus-api.com/api/dashboards/{id}/widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "dashboards",
"attributes": {
"placements": [
{
"dashboard_widget_id": 12,
"position": {
"x": 0,
"y": 0,
"w": 2,
"h": 2
}
},
{
"dashboard_widget_id": 17,
"position": {
"x": 2,
"y": 0,
"w": 4,
"h": 2
}
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/dashboards/{id}/widgets"
payload = { "data": {
"type": "dashboards",
"attributes": { "placements": [
{
"dashboard_widget_id": 12,
"position": {
"x": 0,
"y": 0,
"w": 2,
"h": 2
}
},
{
"dashboard_widget_id": 17,
"position": {
"x": 2,
"y": 0,
"w": 4,
"h": 2
}
}
] }
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'dashboards',
attributes: {
placements: [
{dashboard_widget_id: 12, position: {x: 0, y: 0, w: 2, h: 2}},
{dashboard_widget_id: 17, position: {x: 2, y: 0, w: 4, h: 2}}
]
}
}
})
};
fetch('https://clarus-api.com/api/dashboards/{id}/widgets', 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": {}
}
]
}Dashboards
Set dashboard widget placements
Atomically replace the widget placements for a dashboard. The full set of placements you want on the dashboard must be supplied in placements; any existing placements not in the list are removed.
PUT
/
api
/
dashboards
/
{id}
/
widgets
Set dashboard widget placements
curl --request PUT \
--url https://clarus-api.com/api/dashboards/{id}/widgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "dashboards",
"attributes": {
"placements": [
{
"dashboard_widget_id": 12,
"position": {
"x": 0,
"y": 0,
"w": 2,
"h": 2
}
},
{
"dashboard_widget_id": 17,
"position": {
"x": 2,
"y": 0,
"w": 4,
"h": 2
}
}
]
}
}
}
'import requests
url = "https://clarus-api.com/api/dashboards/{id}/widgets"
payload = { "data": {
"type": "dashboards",
"attributes": { "placements": [
{
"dashboard_widget_id": 12,
"position": {
"x": 0,
"y": 0,
"w": 2,
"h": 2
}
},
{
"dashboard_widget_id": 17,
"position": {
"x": 2,
"y": 0,
"w": 4,
"h": 2
}
}
] }
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'dashboards',
attributes: {
placements: [
{dashboard_widget_id: 12, position: {x: 0, y: 0, w: 2, h: 2}},
{dashboard_widget_id: 17, position: {x: 2, y: 0, w: 4, h: 2}}
]
}
}
})
};
fetch('https://clarus-api.com/api/dashboards/{id}/widgets', 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": "dashboards",
"attributes": {
"placements": [
{ "dashboard_widget_id": 12, "position": { "x": 0, "y": 0, "w": 2, "h": 2 } },
{ "dashboard_widget_id": 17, "position": { "x": 2, "y": 0, "w": 4, "h": 2 } }
]
}
}
}
Behavior
- Replaces every placement on the dashboard with the supplied list, inside a single database transaction
- A
dashboard_widget_idmay appear at most once in the list — duplicates are rejected with 422 positionis optional; if omitted it is stored as an empty object and the dashboard renderer falls back to a default layout slot- Returns 204 No Content on success
Position object
position carries gridstack layout coordinates. Keys: x (column offset), y (row offset), w (column width), h (row height). All integers.
Acquiring widget IDs
List available widgets via the List dashboard widgets GraphQL endpoint.Authorizations
Response
Operation completed successfully with no content to return

