- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/projects.locations.authorizedViewSets.authorizedViews/queryMetrics#try-it)

Query metrics.

### HTTP request

`POST https://{endpoint}/v1/{location=projects/*/locations/*/authorizedViewSets/*/authorizedViews/*}:queryMetrics`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest#rest_endpoints).

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `location` | `string` Required. The location of the data. "projects/{project}/locations/{location}" |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "filter": string, "timeGranularity": enum (`https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/TimeGranularity`), "dimensions": [ { object (`https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/Dimension`) } ], "measureMask": string } ``` |

| Fields ||
|---|---|
| `filter` | `string` Required. Filter to select a subset of conversations to compute the metrics. Must specify a window of the conversation create time to compute the metrics. The returned metrics will be from the range \[DATE(starting create time), DATE(ending create time)). |
| `timeGranularity` | ``enum (`https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/TimeGranularity`)`` The time granularity of each data point in the time series. Defaults to NONE if this field is unspecified. |
| `dimensions[]` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/v1/Dimension`)`` The dimensions that determine the grouping key for the query. Defaults to no dimension if this field is unspecified. If a dimension is specified, its key must also be specified. Each dimension's key must be unique. If a time granularity is also specified, metric values in the dimension will be bucketed by this granularity. Up to one dimension is supported for now. |
| `measureMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Measures to return. Defaults to all measures if this field is unspecified. A valid mask should traverse from the `measure` field from the response. For example, a path from a measure mask to get the conversation count is "conversationMeasure.count". This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/gemini-enterprise-cx/insights/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permissions on the `location` resource:

- `contactcenterinsights.authorizedConversations.list`
- `contactcenterinsights.conversations.list`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).