---
title: "POST /v1/{+parent}/charts"
method: POST
path: "/v1/{+parent}/charts"
tags: ["projects"]
---

# POST /v1/{+parent}/charts

`POST /v1/{+parent}/charts`

Creates a Chart.

## Path parameters

- `parent` string, required

## Query parameters

- `chartId` string

## Request body

- GoogleCloudContactcenterinsightsV1Chart — Configurable dashboard's widget that displays data as a chart.
  - `chartType` 'CHART_TYPE_UNSPECIFIED' | 'SYSTEM_DEFINED' | 'USER_DEFINED' — Output only. Chart type.
  - `action` GoogleCloudContactcenterinsightsV1ChartAction — The action to be taken when the chart is clicked.
    - `redirectAction` GoogleCloudContactcenterinsightsV1RedirectAction — The redirect action to be taken when the chart is clicked.
      - `relativePath` string — The relative path to redirect to.
      - `queryParams` object — The query params to be added to the redirect path.
    - `conversationFilter` string — The conversation filter string.
  - `description` string — Chart description
  - `filter` string — Filter applied to all charts in the container. Should support scope later.
  - `dateRangeConfig` GoogleCloudContactcenterinsightsV1DateRangeConfig — Date range configuration for dashboard charts.
    - `relativeDateRange` GoogleCloudContactcenterinsightsV1DateRangeConfigRelativeDateRange — Relative date range configuration.
      - `quantity` string, int64 — Required. The quantity of units in the past.
      - `unit` 'TIME_UNIT_UNSPECIFIED' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR' — Required. The unit of time.
    - `absoluteDateRange` GoogleCloudContactcenterinsightsV1QueryInterval — A time window for querying conversations.
      - `startTime` string, google-datetime — Required. The start time of the time window.
      - `endTime` string, google-datetime — Required. The end time of the time window.
  - `chartVisualizationType` 'CHART_VISUALIZATION_TYPE_UNSPECIFIED' | 'BAR' | 'LINE' | 'AREA' | 'PIE' | 'SCATTER' | 'TABLE' | 'SCORE_CARD' | 'SUNBURST' | 'GAUGE' | 'SANKEY' — Chart visualization type.
  - `createTime` string, google-datetime — Output only. Chart create time.
  - `updateTime` string, google-datetime — Output only. Chart last update time.
  - `dataSource` GoogleCloudContactcenterinsightsV1ChartDataSource — The request data for visualizing the dataset in the chart.
    - `generativeInsights` GoogleCloudContactcenterinsightsV1GenerativeInsights — Request that use natural language query to generate the chart.
      - `chartSpec` object — Chart spec for the chart.
      - `chartConversations` GoogleCloudContactcenterinsightsV1GenerativeInsightsChartConversation[] — Output only. The chart conversations used to generate the chart.
        - `conversationId` string — The conversation id of the chart.
        - `createTime` string, google-datetime — The create time of the conversation.
        - `messages` GoogleCloudContactcenterinsightsV1GenerativeInsightsChartConversationMessage[] — Ordered list of messages, including user inputs and system responses.
          - `createTime` string, google-datetime — For user messages, this is the time at which the system received the message. For system messages, this is the time at which the system generated the message.
          - `userMessage` GoogleCloudContactcenterinsightsV1GenerativeInsightsChartConversationMessageUserMessage — The user message.
            - `text` string — A message from the user that is interacting with the system.
          - `messageId` string — The message id of the message.
          - `systemMessage` GoogleCloudContactcenterinsightsV1GenerativeInsightsChartConversationMessageSystemMessage — A message from the system in response to the user. This message can also be a message from the user as historical context for multiturn conversations with the system.
            - `textOutput` GoogleCloudContactcenterinsightsV1GenerativeInsightsChartConversationMessageSystemMessageTextOutput — A text output message from the system.
              - …
            - `generatedSqlQuery` string — Raw SQL from LLM, before templatization
            - `chartSpec` object — Chart spec from LLM
        - `updateTime` string, google-datetime — The update time of the conversation.
      - `chartCheckpoint` GoogleCloudContactcenterinsightsV1GenerativeInsightsChartCheckpoint — The current chart checkpoint state.
        - `sessionId` string — The session id of the chart.
        - `revisionId` string — The revision id of the chart.
      - `request` object
      - `sqlQuery` string — SQL query used to generate the chart.
      - `sqlComparisonKey` string — Optional. For charts with comparison, this key will determine the metric that will be compared between the current and another dataset.
    - `queryMetrics` GoogleCloudContactcenterinsightsV1QueryMetrics — Request data that use the existing QueryMetrics.
      - `request` object
  - `displayName` string — User provided display name of the chart.
  - `name` string — Identifier. Chart resource name. Format: projects/{project}/locations/{location}/dashboards/{dashboard}/charts/{chart}
  - `height` integer — The height of the chart in grid units.
  - `width` integer — The width of the chart in grid units.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/contactcenterinsights.md) · [All operations](https://skmtc.net/google/apis/contactcenterinsights/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/contactcenterinsights/revisions/e071ddf4dfc3/schema)
