---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}:generativeInsights"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}:generativeInsights"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}:generativeInsights

`POST /v1/projects/{projectsId}/locations/{locationsId}:generativeInsights`

## Request

- Base URL: `https://contactcenterinsights.googleapis.com`
- URL: `https://contactcenterinsights.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}:generativeInsights`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-platform`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Natural language based Insights which powers the next generation of dashboards in Insights. Next generation of QueryMetrics.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required

## Request body

- GoogleCloudContactcenterinsightsV1GenerativeInsightsRequest: The request for generative insights.
  - `chart` string: The full name of the chart resource this request corresponds to. Format: projects/{project}/locations/{location}/dashboards/{dashboard}/charts/{chart}
  - `comparisonFilter` string: Optional. Filter for the data that can be specified in addition to the natural language query. This `filter` is specifically used for charts where comparisons are possible. For example, "compare to last month" or "compare to previous quarter".
  - `filter` string: Filter for the data that can be specified in addition to the natural language query. Users are encouraged to use this field to populate time-windows.
  - `naturalLanguageQuery` string: The natural language query specified by the user. If this field is specified, `sql_query` will be ignored.
  - `revisionId` string: Optional. The revision id that maps to the state of the chart state revision. When specified, the backend will reload the chart with the sql and visual spec from that revision.
  - `sessionId` string: Optional. The session id of the conversation. If the session id is not specified, backend will generate a random session id. If the session id is specified, will associate user-provided user_query with the provided session id.
  - `sqlComparisonKey` string: Optional. For charts with comparison, this key will determine the metric that will be compared between the current and another dataset.
  - `sqlQuery` string: Optional. The SQL query specified by the user. This query must be in BigQuery SQL dialect. The `filter` field will also be ignored, as it is assumed that any filtering is already included in the SQL query.
  - `timeZone` string: Optional. The time zone name from the [IANA Time Zone Database](https://www.iana.org/time-zones) (for example, `"America/Los_Angeles"`) used to group daily time-series results. If empty, or if the name is well-formed but not known to the server, `UTC` is used. Malformed values are rejected with `INVALID_ARGUMENT`.
  - `userProvidedChartSpec` object: Optional. The user provided chart spec for the chart. This will be used to override the visual spec generated by the LLM.

## Response `200`

Successful response

- GoogleLongrunningOperation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` GoogleRpcStatus: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

---

[API](https://skmtc.dev/google/apis/contactcenterinsights.md) - [All operations](https://skmtc.dev/google/apis/contactcenterinsights/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/contactcenterinsights/revisions/895c3ce55ea0?raw)
