---
title: "PATCH /projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}"
method: PATCH
path: "/projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}"
---

# PATCH /projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}

`PATCH /projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}`

## Request

- Base URL: `https://api.caveman.so/api/v1`
- URL: `https://api.caveman.so/api/v1/projects/{projectId}/dashboards/{dashboardId}/charts/{chartId}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/api/v1/oauth/authorize`
    - Token URL: `/api/v1/oauth/token` scopes: `dashboard:write`
  - HTTP bearer
  - API key in cookie `cave_access`
  - API key in cookie `__Secure-cave_identity.session_token`

PATCH /api/v1/projects/{projectId}/dashboards/{dashboardId}/charts/{chartId} on the Caveman Cloud control plane. Requires the dashboard:write scope. Exposed to autonomous agents as the update_chart action of the caveman_dashboards_write tool (write access). Create, clone, rename and delete project dashboards, and add, change or remove one chart at a time. Every saved chart must compile; verify it with charts.query first.

## Request body

- object
  - `chart` object, required
    - `id` string
    - `title` string
    - `type` 'timeseries' | 'toplist' | 'bignumber'
    - `source` 'requests' | 'spans' | 'tools' | 'evals'
    - `preset` string, nullable
    - `measures` object[]
      - `label` string
      - `field` string
      - `agg` 'count' | 'sum' | 'avg' | 'min' | 'max' | 'count_distinct' | 'percentile'
      - `p` number
      - `expr` string
    - `filters` object
      - `row` string
      - `trace` string
    - `group_by` string
    - `options` object
      - `unit` 'duration' | 'cost' | 'count' | 'percent' | 'bytes'
      - `viz` 'line' | 'bar'
      - `stacked` boolean
      - `interval` 'auto' | 'hour' | 'day' | 'week'
      - `sort` 'value_desc' | 'value_asc' | 'name_asc' | 'name_desc'
      - `limit` integer
    - `layout` object
      - `w` unknown, required
      - `h` unknown, required
    - `section_id` string, nullable

## Response `2XX`

Successful response. Exact status depends on synchronous or durable delivery outcome.

## Other responses

- `4XX`: Structured failure. `error.code` is stable; `error.request_id` is echoed in the x-cave-request-id header.
- `5XX`: Structured failure. `error.code` is stable; `error.request_id` is echoed in the x-cave-request-id header.

---

[API](https://skmtc.dev/caveman/apis/caveman-cloud-api.md) - [All operations](https://skmtc.dev/caveman/apis/caveman-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/caveman/apis/caveman-cloud-api/revisions/508312d01cfc?raw)
