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

# POST /v1/projects/{projectsId}/locations/{locationsId}/analysisRules

`POST /v1/projects/{projectsId}/locations/{locationsId}/analysisRules`

## Request

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

Creates a analysis rule.

## Path parameters

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

## Request body

- GoogleCloudContactcenterinsightsV1AnalysisRule: The CCAI Insights project wide analysis rule. This rule will be applied to all conversations that match the filter defined in the rule. For a conversation matches the filter, the annotators specified in the rule will be run. If a conversation matches multiple rules, a union of all the annotators will be run. One project can have multiple analysis rules.
  - `active` boolean: If true, apply this rule to conversations. Otherwise, this rule is inactive and saved as a draft.
  - `analysisPercentage` number, double: Percentage of conversations that we should apply this analysis setting automatically, between [0, 1]. For example, 0.1 means 10%. Conversations are sampled in a determenestic way. The original runtime_percentage & upload percentage will be replaced by defining filters on the conversation.
  - `annotatorSelector` GoogleCloudContactcenterinsightsV1AnnotatorSelector: Selector of all available annotators and phrase matchers to run.
    - `issueModels` string[]: The issue model to run. If not provided, the most recently deployed topic model will be used. The provided issue model will only be used for inference if the issue model is deployed and if run_issue_model_annotator is set to true. If more than one issue model is provided, only the first provided issue model will be used for inference.
    - `phraseMatchers` string[]: The list of phrase matchers to run. If not provided, all active phrase matchers will be used. If inactive phrase matchers are provided, they will not be used. Phrase matchers will be run only if run_phrase_matcher_annotator is set to true. Format: projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}
    - `qaConfig` GoogleCloudContactcenterinsightsV1AnnotatorSelectorQaConfig: Configuration for the QA feature.
      - `scorecardList` GoogleCloudContactcenterinsightsV1AnnotatorSelectorQaConfigScorecardList: Container for a list of scorecards.
        - `qaScorecardRevisions` string[]: List of QaScorecardRevisions.
    - `runAutoLabelingAnnotator` boolean: Optional. Whether to run the auto-labeling annotator. If true, the auto-labeling annotator will be run. This is a non-billable operation designed for fixing or backfilling custom labels.
    - `runEntityAnnotator` boolean: Whether to run the entity annotator.
    - `runIntentAnnotator` boolean: Whether to run the intent annotator.
    - `runInterruptionAnnotator` boolean: Whether to run the interruption annotator.
    - `runIssueModelAnnotator` boolean: Whether to run the issue model annotator. A model should have already been deployed for this to take effect.
    - `runPhraseMatcherAnnotator` boolean: Whether to run the active phrase matcher annotator(s).
    - `runQaAnnotator` boolean: Whether to run the QA annotator.
    - `runSentimentAnnotator` boolean: Whether to run the sentiment annotator.
    - `runSilenceAnnotator` boolean: Whether to run the silence annotator.
    - `runSummarizationAnnotator` boolean: Whether to run the summarization annotator.
    - `summarizationConfig` GoogleCloudContactcenterinsightsV1AnnotatorSelectorSummarizationConfig: Configuration for summarization.
      - `conversationProfile` string: Resource name of the Dialogflow conversation profile. Format: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}
      - `generator` string: The resource name of the existing created generator. Format: projects//locations//generators/
      - `summarizationModel` 'SUMMARIZATION_MODEL_UNSPECIFIED' | 'BASELINE_MODEL' | 'BASELINE_MODEL_V2_0': Default summarization model to be used.
  - `conversationFilter` string: Filter for the conversations that should apply this analysis rule. An empty filter means this analysis rule applies to all conversations. Refer to https://cloud.google.com/contact-center/insights/docs/filtering for details.
  - `createTime` string, google-datetime: Output only. The time at which this analysis rule was created.
  - `displayName` string: Display Name of the analysis rule.
  - `name` string: Identifier. The resource name of the analysis rule. Format: projects/{project}/locations/{location}/analysisRules/{analysis_rule}
  - `satisfiesPzi` boolean: Output only. Whether this resource is zone isolated.
  - `satisfiesPzs` boolean: Output only. Whether this resource is zone separated.
  - `updateTime` string, google-datetime: Output only. The most recent time at which this analysis rule was updated.

## Response `200`

Successful response

- GoogleCloudContactcenterinsightsV1AnalysisRule: The CCAI Insights project wide analysis rule. This rule will be applied to all conversations that match the filter defined in the rule. For a conversation matches the filter, the annotators specified in the rule will be run. If a conversation matches multiple rules, a union of all the annotators will be run. One project can have multiple analysis rules.
  - `active` boolean: If true, apply this rule to conversations. Otherwise, this rule is inactive and saved as a draft.
  - `analysisPercentage` number, double: Percentage of conversations that we should apply this analysis setting automatically, between [0, 1]. For example, 0.1 means 10%. Conversations are sampled in a determenestic way. The original runtime_percentage & upload percentage will be replaced by defining filters on the conversation.
  - `annotatorSelector` GoogleCloudContactcenterinsightsV1AnnotatorSelector: Selector of all available annotators and phrase matchers to run.
    - `issueModels` string[]: The issue model to run. If not provided, the most recently deployed topic model will be used. The provided issue model will only be used for inference if the issue model is deployed and if run_issue_model_annotator is set to true. If more than one issue model is provided, only the first provided issue model will be used for inference.
    - `phraseMatchers` string[]: The list of phrase matchers to run. If not provided, all active phrase matchers will be used. If inactive phrase matchers are provided, they will not be used. Phrase matchers will be run only if run_phrase_matcher_annotator is set to true. Format: projects/{project}/locations/{location}/phraseMatchers/{phrase_matcher}
    - `qaConfig` GoogleCloudContactcenterinsightsV1AnnotatorSelectorQaConfig: Configuration for the QA feature.
      - `scorecardList` GoogleCloudContactcenterinsightsV1AnnotatorSelectorQaConfigScorecardList: Container for a list of scorecards.
        - `qaScorecardRevisions` string[]: List of QaScorecardRevisions.
    - `runAutoLabelingAnnotator` boolean: Optional. Whether to run the auto-labeling annotator. If true, the auto-labeling annotator will be run. This is a non-billable operation designed for fixing or backfilling custom labels.
    - `runEntityAnnotator` boolean: Whether to run the entity annotator.
    - `runIntentAnnotator` boolean: Whether to run the intent annotator.
    - `runInterruptionAnnotator` boolean: Whether to run the interruption annotator.
    - `runIssueModelAnnotator` boolean: Whether to run the issue model annotator. A model should have already been deployed for this to take effect.
    - `runPhraseMatcherAnnotator` boolean: Whether to run the active phrase matcher annotator(s).
    - `runQaAnnotator` boolean: Whether to run the QA annotator.
    - `runSentimentAnnotator` boolean: Whether to run the sentiment annotator.
    - `runSilenceAnnotator` boolean: Whether to run the silence annotator.
    - `runSummarizationAnnotator` boolean: Whether to run the summarization annotator.
    - `summarizationConfig` GoogleCloudContactcenterinsightsV1AnnotatorSelectorSummarizationConfig: Configuration for summarization.
      - `conversationProfile` string: Resource name of the Dialogflow conversation profile. Format: projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}
      - `generator` string: The resource name of the existing created generator. Format: projects//locations//generators/
      - `summarizationModel` 'SUMMARIZATION_MODEL_UNSPECIFIED' | 'BASELINE_MODEL' | 'BASELINE_MODEL_V2_0': Default summarization model to be used.
  - `conversationFilter` string: Filter for the conversations that should apply this analysis rule. An empty filter means this analysis rule applies to all conversations. Refer to https://cloud.google.com/contact-center/insights/docs/filtering for details.
  - `createTime` string, google-datetime: Output only. The time at which this analysis rule was created.
  - `displayName` string: Display Name of the analysis rule.
  - `name` string: Identifier. The resource name of the analysis rule. Format: projects/{project}/locations/{location}/analysisRules/{analysis_rule}
  - `satisfiesPzi` boolean: Output only. Whether this resource is zone isolated.
  - `satisfiesPzs` boolean: Output only. Whether this resource is zone separated.
  - `updateTime` string, google-datetime: Output only. The most recent time at which this analysis rule was updated.

---

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