# Update a dashboard

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

[endpoint]
base_url = "https://telemetry.betterstack.com"
path = "/api/v2/dashboards/{id}"
method = "PATCH"

[[path_param]]
name = "id"
description = "The unique identifier of the dashboard to update."
required = true
type = "string"

[[body_param]]
name = "name"
description = "A new name for the dashboard."
required = false
type = "string"

[[body_param]]
name = "dashboard_group_id"
description = "A new dashboard group ID. Use `0` or `null` to remove from a group."
required = false
type = "integer"

[[body_param]]
name = "refresh_interval"
description = "A new refresh interval in seconds."
required = false
type = "integer"

[[body_param]]
name = "date_range_from"
description = "A new start for the dashboard's date range."
required = false
type = "string"

[[body_param]]
name = "date_range_to"
description = "A new end for the dashboard's date range."
required = false
type = "string"

[[body_param]]
name = "source_eligibility_sql"
description = "A new SQL filter for source eligibility."
required = false
type = "string"

[[body_param]]
name = "variables"
description = "An array of variable objects to replace the existing custom variables."
required = false
type = "array"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = "The dashboard was updated successfully."
body = '''
{
  "data": {
    "id": "12345",
    "type": "dashboard",
    "attributes": {
      "team_id": 123,
      "team_name": "My Team",
      "name": "Updated API Dashboard",
      "dashboard_group_id": null,
      "refresh_interval": 120,
      "date_range_from": "now-3h",
      "date_range_to": "now",
      "source_eligibility_sql": null,
      "created_at": "2026-03-25T10:00:00.000Z",
      "updated_at": "2026-03-25T10:05:00.000Z",
      "variables": [
        {
          "name": "time",
          "variable_type": "datetime",
          "values": [],
          "default_values": []
        },
        {
          "name": "start_time",
          "variable_type": "datetime",
          "values": [],
          "default_values": []
        },
        {
          "name": "end_time",
          "variable_type": "datetime",
          "values": [],
          "default_values": []
        },
        {
          "name": "source",
          "variable_type": "source",
          "values": [],
          "default_values": []
        },
        {
          "name": "environment",
          "variable_type": "string",
          "values": ["staging"],
          "default_values": ["staging"]
        }
      ],
      "charts": [],
      "sections": [],
      "has_overlaps": false
    }
  }
}
'''
[[response]]
status = 404
description = "A dashboard with the specified ID was not found."

[[response]]
status = 422
description = "Validation failed due to invalid parameters (e.g., empty name)."
body = '''
{
  "errors": "Sorry, some values are incorrect",
  "invalid_values": {
    "name": ["can't be blank"]
  }
}
'''
[/responses]

[info]
When updating `variables`, the entire array of custom variables will be replaced with the one you provide. System variables `time`, `start_time`, `end_time`, and `source` are preserved.
[/info]

## Example request

```shell
[label cURL]
curl --request PATCH \
  --url https://telemetry.betterstack.com/api/v2/dashboards/1234 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Updated API Dashboard",
    "refresh_interval": 120,
    "variables": [
      {
        "name": "environment",
        "variable_type": "string",
        "values": ["staging"],
        "default_values": ["staging"]
      }
    ]
  }'
```
