---
title: "POST /datainsights/v1.1/reports/{report_id}/charts"
method: POST
path: "/datainsights/v1.1/reports/{report_id}/charts"
tags: ["Reports"]
---

# POST /datainsights/v1.1/reports/{report_id}/charts

`POST /datainsights/v1.1/reports/{report_id}/charts`

## Path parameters

- `report_id` integer, required

## Headers

- `X-PROPERTY-ID` integer, required

## Request body

- Chart
  - `id` integer, required — Chart Id
  - `datasource_id` integer, required — ID of the datasource
  - `datasource_kind` 'report' | 'stock_report', required — Datasource Kind
  - `datasource_title` string — Title of the datasource
  - `datasource_description` string — Description of the datasource
  - `title` string, required — Chart title
  - `kind` 'line' | 'bar' | 'area' | 'pie' | 'donut' | 'sunburst' | 'treemap' | 'geomap' | 'heatmap' | 'combo', required — Kind of chart
  - `settings` ChartSettings
    - `legend` boolean — Toggle to show/hide legend
    - `toolbox` boolean — Toggle to show/hide the toolbox
    - `metrics` ChartSettingsMetrics[] — List of CDFs with metrics and vertical axis to represent data.
      - `cdf` ReportCDF, required
        - `type` 'default' | 'custom' — Report cdf type
        - `column` string, required — Report cdf name
        - `multi_level_id` 1 | 2 | 3 | 4 — Multi-level where CDF is located
      - `metric` 'sum' | 'mean' | 'max' | 'min' | 'count' | 'std' | 'var' — Chart metric. Not required for dynamic cdfs
      - `kind` 'line' | 'bar' | 'area', required — Kind of chart
      - `axis` 'left' | 'right', required — Left or right vertical axis
    - `stack` 'normalized' | 'standard' — Stack option of Chart kind bar
  - `categories` string — List of CDFs in group rows or group columns (or the text string "Periods" for period comparison reports) to categorize data. Categories are represented horizontally (x-axis) on most charts
  - `metrics` ReportColumns[] — List of CDFs with metrics to represent data. Metrics will be represented vertically (y-axis) on most charts.
    - `cdf` ReportCDF, required
      - `type` 'default' | 'custom' — Report cdf type
      - `column` string, required — Report cdf name
      - `multi_level_id` 1 | 2 | 3 | 4 — Multi-level where CDF is located
    - `metrics` string[] — Report column metrics
  - `user_id` integer, required — User id
  - `created_at` string — Created At Time
  - `updated_at` string — Updated At Time

## Response `201`

Created

- Chart
  - `id` integer, required — Chart Id
  - `datasource_id` integer, required — ID of the datasource
  - `datasource_kind` 'report' | 'stock_report', required — Datasource Kind
  - `datasource_title` string — Title of the datasource
  - `datasource_description` string — Description of the datasource
  - `title` string, required — Chart title
  - `kind` 'line' | 'bar' | 'area' | 'pie' | 'donut' | 'sunburst' | 'treemap' | 'geomap' | 'heatmap' | 'combo', required — Kind of chart
  - `settings` ChartSettings
    - `legend` boolean — Toggle to show/hide legend
    - `toolbox` boolean — Toggle to show/hide the toolbox
    - `metrics` ChartSettingsMetrics[] — List of CDFs with metrics and vertical axis to represent data.
      - `cdf` ReportCDF, required
        - `type` 'default' | 'custom' — Report cdf type
        - `column` string, required — Report cdf name
        - `multi_level_id` 1 | 2 | 3 | 4 — Multi-level where CDF is located
      - `metric` 'sum' | 'mean' | 'max' | 'min' | 'count' | 'std' | 'var' — Chart metric. Not required for dynamic cdfs
      - `kind` 'line' | 'bar' | 'area', required — Kind of chart
      - `axis` 'left' | 'right', required — Left or right vertical axis
    - `stack` 'normalized' | 'standard' — Stack option of Chart kind bar
  - `categories` string — List of CDFs in group rows or group columns (or the text string "Periods" for period comparison reports) to categorize data. Categories are represented horizontally (x-axis) on most charts
  - `metrics` ReportColumns[] — List of CDFs with metrics to represent data. Metrics will be represented vertically (y-axis) on most charts.
    - `cdf` ReportCDF, required
      - `type` 'default' | 'custom' — Report cdf type
      - `column` string, required — Report cdf name
      - `multi_level_id` 1 | 2 | 3 | 4 — Multi-level where CDF is located
    - `metrics` string[] — Report column metrics
  - `user_id` integer, required — User id
  - `created_at` string — Created At Time
  - `updated_at` string — Updated At Time

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.dev/cloudbeds/apis/cloudbeds-api.md) · [All operations](https://skmtc.dev/cloudbeds/apis/cloudbeds-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cloudbeds/cloudbeds-api/revisions/2faa857793e8/schema)
