Save a dashboard.
const url = 'https://api.siteqwality.com/dashboards/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","description":"example","tags":["example"],"definition":{"schema_version":1,"settings":{"default_time":{"from":"example","to":"example"},"refresh":"auto","timezone":"example","crosshair":"shared"},"variables":[{"name":"example","label":"example","source":"monitors","field":"example","metric":"example","multi":true,"include_all":true,"default":["example"],"values":["example"]}],"widgets":[{"config":{"queries":[{"id":"example","source":"monitors","measure":"example","aggregation":"avg","filters":[{"field":"example","op":"in","values":["example"]}],"group_by":["example"],"metric":"example","hidden":true,"alias":"example"}],"formulas":[{"id":"example","expr":"example","alias":"example","unit":"ms","hidden":true}],"display":"line","stacked":true,"series_limit":1,"legend":"auto","legend_columns":["value"],"y_axis":{"min":1,"max":1,"scale":"linear","include_zero":true},"unit":"ms","decimals":1,"thresholds":[{"value":1,"tone":"ok","style":"line","label":"example"}],"compare":"previous_period","overlays":["incidents"],"palette":"categorical"},"type":"timeseries","id":"example","title":"example","description":"example","layout":{"x":1,"y":1,"w":1,"h":1},"time":{"from":"example","to":"example"}}]},"locked":true,"version":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.siteqwality.com/dashboards/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "tags": [ "example" ], "definition": { "schema_version": 1, "settings": { "default_time": { "from": "example", "to": "example" }, "refresh": "auto", "timezone": "example", "crosshair": "shared" }, "variables": [ { "name": "example", "label": "example", "source": "monitors", "field": "example", "metric": "example", "multi": true, "include_all": true, "default": [ "example" ], "values": [ "example" ] } ], "widgets": [ { "config": { "queries": [ { "id": "example", "source": "monitors", "measure": "example", "aggregation": "avg", "filters": [ { "field": "example", "op": "in", "values": [ "example" ] } ], "group_by": [ "example" ], "metric": "example", "hidden": true, "alias": "example" } ], "formulas": [ { "id": "example", "expr": "example", "alias": "example", "unit": "ms", "hidden": true } ], "display": "line", "stacked": true, "series_limit": 1, "legend": "auto", "legend_columns": [ "value" ], "y_axis": { "min": 1, "max": 1, "scale": "linear", "include_zero": true }, "unit": "ms", "decimals": 1, "thresholds": [ { "value": 1, "tone": "ok", "style": "line", "label": "example" } ], "compare": "previous_period", "overlays": [ "incidents" ], "palette": "categorical" }, "type": "timeseries", "id": "example", "title": "example", "description": "example", "layout": { "x": 1, "y": 1, "w": 1, "h": 1 }, "time": { "from": "example", "to": "example" } } ] }, "locked": true, "version": 1 }'A whole-document save against the version the edit started from. A stale version gets a
409 whose data.current is the dashboard as it is now.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Dashboard id
Request Body required
Section titled “Request Body required ”A whole-document save. version is the version the edit started from.
object
object
object
A window of T2 tokens (now, now-2h) or instants (ISO 8601, epoch milliseconds), resolved
when the query is compiled, so a stored view stays rolling.
object
None follows the viewer’s browser; otherwise UTC or an IANA zone.
object
["*"] is All.
A fixed list instead of values from the data.
object
object
object
object
object
Metrics source only: the metric name (or $var).
A horizontal marker on a time series.
object
object
object
object
object
Metrics source only: the metric name (or $var).
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
A query or formula id; defaults to the first visible one.
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
Empty means one number column per visible query and formula.
object
A query or formula id.
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Only the creator and admins may change it; absent keeps it.
Responses
Section titled “ Responses ”The saved dashboard
object
object
object
A window of T2 tokens (now, now-2h) or instants (ISO 8601, epoch milliseconds), resolved
when the query is compiled, so a stored view stays rolling.
object
None follows the viewer’s browser; otherwise UTC or an IANA zone.
object
["*"] is All.
A fixed list instead of values from the data.
object
object
object
object
object
Metrics source only: the metric name (or $var).
A horizontal marker on a time series.
object
object
object
object
object
Metrics source only: the metric name (or $var).
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
A query or formula id; defaults to the first visible one.
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
Empty means one number column per visible query and formula.
object
A query or formula id.
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Whether the caller may save changes (role, plan, scopes and the lock).
Live public links: not paused and not expired.
Example
{ "definition": { "settings": { "refresh": "auto", "crosshair": "shared" }, "variables": [ { "source": "monitors" } ], "widgets": [ { "config": { "queries": [ { "source": "monitors", "aggregation": "avg", "filters": [ { "op": "in" } ] } ], "formulas": [ { "unit": "ms" } ], "display": "line", "legend": "auto", "legend_columns": [ "value" ], "y_axis": { "scale": "linear" }, "unit": "ms", "thresholds": [ { "tone": "ok", "style": "line" } ], "compare": "previous_period", "overlays": [ "incidents" ], "palette": "categorical" }, "type": "timeseries" } ] }}Invalid name, tags or definition
Missing or invalid authentication
Custom dashboards require a paid plan
Locked, or the role is view-only
No such dashboard
Someone saved first; data.current holds their version
The body of a 409 on a stale save: the dashboard as it is now.
object
object
object
object
A window of T2 tokens (now, now-2h) or instants (ISO 8601, epoch milliseconds), resolved
when the query is compiled, so a stored view stays rolling.
object
None follows the viewer’s browser; otherwise UTC or an IANA zone.
object
["*"] is All.
A fixed list instead of values from the data.
object
object
object
object
object
Metrics source only: the metric name (or $var).
A horizontal marker on a time series.
object
object
object
object
object
Metrics source only: the metric name (or $var).
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
A query or formula id; defaults to the first visible one.
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
Empty means one number column per visible query and formula.
object
A query or formula id.
A conditional color on a value (query value, toplist, table cells).
object
object
object
object
object
Metrics source only: the metric name (or $var).
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Whether the caller may save changes (role, plan, scopes and the lock).
Live public links: not paused and not expired.
Example
{ "current": { "definition": { "settings": { "refresh": "auto", "crosshair": "shared" }, "variables": [ { "source": "monitors" } ], "widgets": [ { "config": { "queries": [ { "source": "monitors", "aggregation": "avg", "filters": [ { "op": "in" } ] } ], "formulas": [ { "unit": "ms" } ], "display": "line", "legend": "auto", "legend_columns": [ "value" ], "y_axis": { "scale": "linear" }, "unit": "ms", "thresholds": [ { "tone": "ok", "style": "line" } ], "compare": "previous_period", "overlays": [ "incidents" ], "palette": "categorical" }, "type": "timeseries" } ] } }}Internal server error