Skip to content

Get a widget's chart data ​

GET/api/v2/workspaces/{slug}/dashboards/{dashboard_id}/widgets/{pk}/chart/

A widget is one chart on a dashboard. Get the data it displays, computed from the current work items in the dashboard's projects. The dashboard's filter and the widget's own filter both apply. The response shape depends on the chart type; see Chart types.

No query parameter is required. A chart type reads only the parameters listed for it below and ignores the rest. Any other parameter, including filters, pql_filters or x_axis_property, is ignored too: the chart always uses the widget's saved settings. To change them, update the widget.

Chart typepagecolumn_pagerow_idsPage size
BAR_CHART, LINE_CHART, AREA_CHARTyesconfig.max_rows (default 20) buckets
TABLE_CHARTyesyesyesconfig.max_rows (10) rows, config.max_columns (20) columns
WORK_ITEMS_TABLE, ASSIGNED_WORK_ITEMS_TABLEyesconfig.max_rows (10) work items
WORK_ITEMS_STATISTICSyesconfig.max_rows (10) groups
WORK_ITEM_TYPE_PROGRESSyesconfig.max_rows (6) parent work items
WORK_ITEMS_SMART_COUNTER, WORK_ITEMS_SMART_GAUGEyesconfig.rows_to_show (6) groups
PIE_CHART, DONUT_CHART, NUMBERNot paginated
CYCLE_PROGRESS_BAR, ACTIVE_CYCLE_PROGRESS_BAR, INTAKE_*Not paginated

To load more columns of a TABLE_CHART for the rows already on screen:

  1. GET …/chart/ returns row page 1 and column page 1.
  2. GET …/chart/?page=2 returns the next rows, with column page 1.
  3. GET …/chart/?page=2&column_page=2&row_ids=["backlog","started"] returns column page 2 for those rows. URL-encode row_ids: row_ids=%5B%22backlog%22%2C%22started%22%5D.

Path parameters ​

slug:requiredstring

The workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.

dashboard_id:requiredstring (uuid)

The dashboard the widget is on.

pk:requiredstring (uuid)

The widget ID. A widget on a different dashboard returns 404.

Query parameters ​

page:optionalinteger

Which page of rows, buckets, groups or counters to return. Default 1. The page size is the chart's own config setting, not a query parameter. A page past the last one returns the last page, so read page and total_pages in the response. Below 1, or not an integer, returns 400 on a chart type that reads it.

column_page:optionalinteger

TABLE_CHART only. Which page of columns to return. Default 1; the page size is config.max_columns. A page past the last returns the last column page.

row_ids:optionalstring (JSON array)

TABLE_CHART only. The data[].group_by_id values of the rows already on screen, for example ["backlog","started"]. Include null for the "no value" row. The response then has exactly these rows, in this order, for the requested column_page, without ranking the rows again. Row pagination fields are approximate in that case (next_page is null and total_count is the number of IDs sent), so keep the ones from the earlier response.

Valid JSON that isn't an array returns 400. A value that isn't valid JSON is ignored.

Scopes ​

workspaces.dashboards.widgets:read, or the broad read scope.

Errors ​

StatusCodeCause
400invalid_requestA page, column_page or row_ids value is invalid, or the widget's saved settings don't fit its chart type (for example a widget saved half-configured in the app). errors[] names the field.
401unauthorizedMissing or invalid credentials.
402payment_requiredDashboards, or this chart type, aren't included in the workspace's plan, or you aren't a member of the workspace.
403forbiddenGuests can't use dashboards, or your token lacks the scope.
404not_foundThe dashboard or widget doesn't exist, or you can't see the dashboard.
406not_acceptableThe Accept header asks for a representation the API can't produce.
429rate_limitedThrottled. Wait for the Retry-After header's seconds before retrying.
Get a widget's chart data
bash
curl -X GET \
  "https://api.plane.so/api/v2/workspaces/my-team/dashboards/05186e3b-94a3-49b0-8403-9307d292daea/widgets/0bda418f-3e9a-47bd-8e70-faa04e1f9540/chart/" \
  -H "X-Api-Key: $PLANE_API_KEY"
Response200
json
{
  "schema": {
    "state_group": {
      "started": {
        "id": "started",
        "name": "Started"
      },
      "backlog": {
        "id": "backlog",
        "name": "Backlog"
      },
      "completed": {
        "id": "completed",
        "name": "Completed"
      },
      "unstarted": {
        "id": "unstarted",
        "name": "Unstarted"
      },
      "cancelled": {
        "id": "cancelled",
        "name": "Cancelled"
      }
    },
    "priority": {
      "none": {
        "id": "none",
        "name": "None"
      },
      "high": {
        "id": "high",
        "name": "High"
      },
      "medium": {
        "id": "medium",
        "name": "Medium"
      },
      "urgent": {
        "id": "urgent",
        "name": "Urgent"
      }
    }
  },
  "total_count": 4,
  "total_pages": 1,
  "page": 1,
  "per_page": 20,
  "next_page": null,
  "prev_page": null,
  "data": [
    {
      "key": "none",
      "count": 16,
      "groups": {
        "backlog": 5,
        "started": 9,
        "unstarted": 2
      },
      "projects": {}
    },
    {
      "key": "high",
      "count": 2,
      "groups": {
        "completed": 2
      },
      "projects": {}
    },
    {
      "key": "medium",
      "count": 2,
      "groups": {
        "cancelled": 1,
        "started": 1
      },
      "projects": {}
    },
    {
      "key": "urgent",
      "count": 2,
      "groups": {
        "started": 2
      },
      "projects": {}
    }
  ],
  "x_axis_schema_key": "priority",
  "group_by_schema_key": "state_group",
  "group_keys": ["started", "backlog", "completed", "unstarted", "cancelled"]
}
Response200
json
{
  "schema": {},
  "value": 22,
  "y_axis_metric": "WORK_ITEM_COUNT"
}
Response400
json
{
  "type": "invalid_request",
  "code": "invalid_request",
  "detail": "One or more fields failed validation.",
  "errors": [
    {
      "field": "page",
      "code": "invalid",
      "message": "Input should be greater than or equal to 1"
    }
  ]
}