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

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

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

## Request

- Base URL: `https://contactcenterinsights.googleapis.com`
- URL: `https://contactcenterinsights.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}:queryMetrics`
- 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`

Query metrics.

## Path parameters

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

## Request body

- GoogleCloudContactcenterinsightsV1QueryMetricsRequest: The request for querying metrics.
  - `dimensions` GoogleCloudContactcenterinsightsV1Dimension[]: 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.
    - `agentDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionAgentDimensionMetadata: Metadata about the agent dimension.
      - `agentDeploymentDisplayName` string: Optional. The agent's deployment display name. Only applicable to automated agents. This will be populated for AGENT_DEPLOYMENT_ID dimensions.
      - `agentDeploymentId` string: Optional. The agent's deployment ID. Only applicable to automated agents. This will be populated for AGENT and AGENT_DEPLOYMENT_ID dimensions.
      - `agentDisplayName` string: Optional. The agent's name This will be populated for AGENT, AGENT_TEAM, AGENT_VERSION_ID, and AGENT_DEPLOYMENT_ID dimensions.
      - `agentId` string: Optional. A user-specified string representing the agent. This will be populated for AGENT, AGENT_TEAM, AGENT_VERSION_ID, and AGENT_DEPLOYMENT_ID dimensions.
      - `agentTeam` string: Optional. A user-specified string representing the agent's team.
      - `agentVersionDisplayName` string: Optional. The agent's version display name. Only applicable to automated agents. This will be populated for AGENT_VERSION_ID, and AGENT_DEPLOYMENT_ID dimensions.
      - `agentVersionId` string: Optional. The agent's version ID. Only applicable to automated agents. This will be populated for AGENT_VERSION_ID, and AGENT_DEPLOYMENT_ID dimensions.
    - `clientSentimentCategoryDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionClientSentimentCategoryDimensionMetadata: Metadata about the client sentiment category dimension.
      - `sentimentCategory` string: Optional. The client sentiment category.
    - `conversationProfileDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionConversationProfileDimensionMetadata: Metadata about the conversation profile dimension.
      - `conversationProfileId` string: Optional. The conversation profile ID.
    - `conversationalAgentsPlaybookDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionConversationalAgentsPlaybookDimensionMetadata: Metadata about the Conversational Agents playbook dimension.
      - `playbookDisplayName` string: Optional. The dialogflow playbook display name.
      - `playbookId` string: Optional. The dialogflow playbook ID.
    - `conversationalAgentsToolDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionConversationalAgentsToolDimensionMetadata: Metadata about the Conversational Agents tool dimension.
      - `toolDisplayName` string: Optional. The dialogflow tool display name.
      - `toolId` string: Optional. The dialogflow tool ID.
    - `dimensionKey` 'DIMENSION_KEY_UNSPECIFIED' | 'ISSUE' | 'ISSUE_NAME' | 'AGENT' | 'AGENT_TEAM' | 'QA_QUESTION_ID' | 'QA_QUESTION_ANSWER_VALUE' | 'QA_SCORECARD_ID' | 'CONVERSATION_PROFILE_ID' | 'MEDIUM' | 'CONVERSATIONAL_AGENTS_PLAYBOOK_ID' | 'CONVERSATIONAL_AGENTS_PLAYBOOK_NAME' | 'CONVERSATIONAL_AGENTS_TOOL_ID' | 'CONVERSATIONAL_AGENTS_TOOL_NAME' | 'CLIENT_SENTIMENT_CATEGORY' | 'AGENT_VERSION_ID' | 'AGENT_DEPLOYMENT_ID' | 'AGENT_ASSIST_SUPERVISOR_ID' | 'LABEL_KEY' | 'LABEL_VALUE' | 'LABEL_KEY_AND_VALUE' | 'LAST_TRANSFER_SUB_AGENT_NAME': The key of the dimension.
    - `issueDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionIssueDimensionMetadata: Metadata about the issue dimension.
      - `issueDisplayName` string: The issue display name.
      - `issueId` string: The issue ID.
      - `issueModelId` string: The parent issue model ID.
    - `labelDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionLabelDimensionMetadata: Metadata about conversation labels.
      - `labelKey` string: Optional. The label key.
      - `labelValue` string: Optional. The label value.
    - `mediumDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionMediumDimensionMetadata: Metadata about the conversation medium dimension.
      - `medium` string: Optional. The conversation medium. Currently supports : PHONE_CALL, CHAT.
    - `qaQuestionAnswerDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionQaQuestionAnswerDimensionMetadata: Metadata about the QA question-answer dimension. This is useful for showing the answer distribution for questions for a given scorecard.
      - `answerValue` string: Optional. The full body of the question.
      - `qaQuestionId` string: Optional. The QA question ID.
      - `qaScorecardId` string: Optional. The QA scorecard ID.
      - `questionBody` string: Optional. The full body of the question.
    - `qaQuestionDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionQaQuestionDimensionMetadata: Metadata about the QA question dimension.
      - `qaQuestionId` string: Optional. The QA question ID.
      - `qaScorecardId` string: Optional. The QA scorecard ID.
      - `questionBody` string: Optional. The full body of the question.
    - `qaScorecardDimensionMetadata` GoogleCloudContactcenterinsightsV1DimensionQaScorecardDimensionMetadata: Metadata about the QA scorecard dimension.
      - `qaScorecardId` string: Optional. The QA scorecard ID.
  - `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)).
  - `measureMask` string, google-fieldmask: 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 "conversation_measure.count".
  - `timeGranularity` 'TIME_GRANULARITY_UNSPECIFIED' | 'NONE' | 'DAILY' | 'HOURLY' | 'PER_MINUTE' | 'PER_5_MINUTES' | 'MONTHLY': The time granularity of each data point in the time series. Defaults to NONE if this field is unspecified.

## 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)
