Move and resize dashboard charts

Move and resize several charts on a dashboard at once. Every move is checked against the 12-column grid and against the final layout, so charts can swap places. The moves are applied together or not at all, and charts then move up to fill any gaps. Returns the full dashboard. The dashboard's version before the moves is kept, so the layout can be rolled back.

PUT https://telemetry.betterstack.com/api/v4/dashboards/{id}/layout

URL parameters

id
required string

Query parameters

team_id
string

Headers

Authorization
required string
Content-Type
string

Body parameters

charts
required array of objects
charts[].id
required string
charts[].x
required integer
charts[].y
required integer
charts[].w
integer or null
charts[].h
integer or null
200

Response body

{
  "data": {
    "id": "123456789",
    "type": "dashboard",
    "attributes": {
      "name": "Sample Dashboard",
      "dashboard_group_id": "789",
      "refresh_interval": 30,
      "date_range_from": "now-3h",
      "date_range_to": "now",
      "source_eligibility_sql": "SELECT countMerge(events_count) FROM {{source}} WHERE name = 'node_cpu_seconds_total' LIMIT 1",
      "variables": [
        {
          "name": "environment",
          "variable_type": "string",
          "values": [
            "production"
          ],
          "default_values": [
            "production"
          ],
          "allow_multiple_values": false
        }
      ],
      "charts": [
        {
          "id": "567",
          "chart_type": "line_chart",
          "name": "CPU Usage",
          "x": 0,
          "y": 0,
          "w": 6,
          "h": 4
        }
      ],
      "sections": [
        {
          "id": "890",
          "name": "Key Metrics",
          "y": 0,
          "collapsed": false
        }
      ],
      "has_overlaps": false,
      "product": "rum",
      "created_at": "2025-01-20T15:00:00.000Z",
      "updated_at": "2025-01-21T10:00:00.000Z",
      "url": "https://telemetry.betterstack.com/team/t123456/dashboards/123",
      "team_id": "t123456",
      "team_name": "example-team"
    }
  }
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/logs/api/getting-started/#obtaining-a-logtail-api-token"
}
403

Response body

{
  "errors": "Dashboard 123 belongs to another team. The API only changes your own teams' dashboards."
}
404

Response body

{
  "errors": "Resource with the provided ID was not found"
}
422
422

Response attributes

id
string
type
string
name
string
dashboard_group_id
string or null
refresh_interval
integer
date_range_from
string
date_range_to
string
source_eligibility_sql
string or null
variables
array of objects
variables[].name
string
variables[].variable_type
string
variables[].values
array of strings
variables[].default_values
array of strings
variables[].sql_definition
string
variables[].structured_value
object
variables[].structured_value.selected_label
string
variables[].structured_value.canonicalSourceIds
array of strings
variables[].structured_value.serviceIds
array of strings
variables[].structured_value.filters
array of objects
variables[].structured_value.filters[].label
string
variables[].structured_value.filters[].sql
string
variables[].allow_multiple_values
boolean
variables[].source_ids
array of strings
variables[].filters
array of objects
variables[].filters[].label
string
variables[].filters[].sql
string
variables[].selected_label
string
charts
array of objects
charts[].id
string
charts[].chart_type
string
charts[].name
string
charts[].x
integer
charts[].y
integer
charts[].w
integer
charts[].h
integer
sections
array of objects
sections[].id
string
sections[].name
string or null
sections[].y
integer
sections[].collapsed
boolean
has_overlaps
boolean
product
string
created_at
datetime
updated_at
datetime
url
string
team_id
string
team_name
string

Example cURL

Move charts
curl --request PUT \
  --url https://telemetry.betterstack.com/api/v4/dashboards/1234/layout \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "charts": [
    {
      "id": "18718",
      "x": 6,
      "y": 0
    },
    {
      "id": "18719",
      "x": 0,
      "y": 0,
      "w": 6,
      "h": 4
    }
  ]
}'