Update a chart

Updates an existing chart by its ID. You only need to provide the fields you want to change.

When updating queries, the entire array will be replaced with the one you provide. Partial updates to queries are not supported.

PATCH https://telemetry.betterstack.com/api/v2/dashboards/{dashboard_id}/charts/{id}

URL parameters

dashboard_id
required integer
id
required integer

Headers

Authorization
required string

Body parameters

name
string
chart_type
string
queries
array
x
integer
y
integer
w
integer
h
integer
200

Response body

{
  "data": {
    "id": "567",
    "type": "chart",
    "attributes": {
      "name": "Updated Chart Name",
      "x": 6,
      "y": 0
    }
  }
}
404

Example Request

cURL
curl --request PATCH \
  --url https://telemetry.betterstack.com/api/v2/dashboards/1234/charts/567 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Updated Chart Name",
    "x": 6,
    "y": 0,
    "queries": [
      {
        "query_type": "sql_expression",
        "sql_query": "SELECT {{time}}, sum(value) FROM metrics GROUP BY time"
      }
    ]
  }'