> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-content-gov.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Coaching Rules API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/agent-ai/api-list)</Badge>

Creates one or more coaching rules for a specified Agent AI stream. Coaching rules help monitor agent behavior based on utterance patterns or GenAI-based triggers and perform actions such as displaying hints or notifying managers.

| **METHOD** | **POST** |
| :- | :- |
| Endpoint | `https://{{host}}/agentai/api/v1/public/{{streamid}}/acrules` |
| Content Type | `application/json` |
| Authorization | `auth: {{JWT}}` — See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token). |

## Header Parameters

| Header | Type | Required | Description |
| - | - | - | - |
| `auth` | String | Yes | JWT token used for authentication. |
| `accountid` | String | Yes | Unique account identifier. |

## Path Parameters

| Parameter | Description | Type |
| :- | :- | :- |
| `host` | Environment URL. For example, `https://platform.kore.ai/` | String, required |
| `streamId` | `botId` or `streamId`. Retrieve this from the [App Settings](/ai-for-service/app-settings) page. | String, required |

## Sample Request

```bash expandable=true theme={null}
curl --location --max-time 15 'https://{{host}}/agentai/api/v1/public/{{streamid}}/acrules' \
--header 'auth: {{JWT_TOKEN}}` \
--header 'accountid: {{accountId}}' \
--header 'Content-Type: application/json' \
--data-raw '[
  {
    "name": "",
    "description": "",
    "triggers": [
      {
        "type": "utterance",
        "by": "agent",
        "operator": "and",
        "when": {
          "addUtterances": [
            { "utterance": "" },
            { "utterance": "" }
          ],
          "utteranceCount": 1
        },
        "frequency": {
          "nOccurrences": 1,
          "duration": "anyTime"
        }
      },
      {
        "type": "genai",
        "by": "agent",
        "operator": "and",
        "triggerDesc": "",
        "frequency": {
          "nOccurrences": 1,
          "duration": "anyTime"
        }
      }
    ],
    "actions": [
      {
        "type": "hint",
        "expression": "critical",
        "message": {
          "useGenAIForTitle": false,
          "useGenAIForBody": false,
          "title": "",
          "body": "",
          "titleDesc": "",
          "bodyDesc": "",
          "postAction": "auto_close",
          "time": 5
        },
        "adherence": {
          "adType": "ack",
          "addUtterances": [],
          "ackText": "Ok, Got it"
        }
      },
      {
        "type": "email_manager",
        "emails": ["john.doe@example.com"],
        "when": "immediately",
        "message": {
          "title": "",
          "body": ""
        }
      }
    ],
    "assignees": [],
    "isActive": true,
    "channels": ["chat", "voice"],
    "tags": ["insurance", "security", "compliance", "PII"]
  }
]'
```

## Body Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `name` | String | Yes | Name of the coaching rule. |
| `description` | String | No | Description of the coaching rule. |
| `triggers` | Array | Yes | List of trigger conditions that activate the coaching rule. |
| `actions` | Array | Yes | List of actions executed when the rule is triggered. |
| `assignees` | Array | No | List of users assigned to the coaching rule. |
| `isActive` | Boolean | No | Indicates whether the coaching rule is active. |
| `channels` | Array | No | Channels where the coaching rule applies. |
| `tags` | Array | No | Tags associated with the coaching rule. |
| `by` | String | Yes | Conversation participant evaluated by the trigger, such as `agent` or `customer`. |
| `type` | String | Yes | Trigger type. Supported values include `utterance` and `genai`. |
| `operator` | String | No | Logical operator used to evaluate multiple trigger conditions. |
| `when` | Object | No | Configuration for utterance-based trigger matching. |
| `triggerDesc` | String | No | Natural language description used by GenAI-based triggers. |
| `frequency` | Object | No | Defines occurrence and duration requirements for the trigger. |
| `addUtterances` | Array | No | List of utterances used for matching. |
| `utteranceCount` | Integer | No | Number of matching utterances required. |
| `nOccurrences` | Integer | No | Number of occurrences required before triggering the rule. |
| `duration` | String | No | Time window used for evaluating occurrences. |
| `type` | String | Yes | Action type. Examples include `hint` and `email_manager`. |
| `expression` | String | No | Severity level associated with a hint action. |
| `message` | Object | No | Message configuration for the action. |
| `adherence` | Object | No | Adherence settings for hint actions. |
| `emails` | Array | No | Email recipients for notification actions. |
| `when` | String | No | Specifies when the action is executed. |
| `useGenAIForTitle` | Boolean | No | Generates the title using GenAI. |
| `useGenAIForBody` | Boolean | No | Generates the message body using GenAI. |
| `title` | String | No | Title displayed in the action. |
| `body` | String | No | Body content displayed in the action. |
| `titleDesc` | String | No | Description used to generate the title. |
| `bodyDesc` | String | No | Description used to generate the body. |
| `postAction` | String | No | Action performed after the message is acknowledged. |
| `time` | Integer | No | Display duration, in seconds. |
| `adType` | String | No | Adherence type. |
| `addUtterances` | Array | No | Additional utterances used for adherence evaluation. |
| `ackText` | String | No | Acknowledgment text displayed to the agent. |

## Sample Response

```json expandable=true theme={null}
[
  {
    "name": "",
    "description": "",
    "tags": [
      "insurance",
      "security",
      "compliance",
      "PII"
    ],
    "channels": [
      "chat",
      "voice"
    ],
    "isActive": true,
    "botId": "st-6165d5c2-171a-54cc-ba5f-48*********e",
    "accountId": "6a5a0e195*********34415e",
    "createdOn": "2026-08-06T04:45:23.582Z",
    "triggers": [
      {
        "_id": "aat-614678e4-9b4f-5b3a-************68cd8",
        "type": "utterance",
        "by": "agent",
        "when": {
          "utteranceCount": 2
        },
        "frequency": {
          "nOccurrences": 1,
          "duration": "anyTime"
        },
        "operator": "and",
        "conditions": {
          "value": []
        },
        "default": false
      },
      {
        "_id": "aat-efb90370-3509************553053",
        "type": "genai",
        "by": "agent",
        "frequency": {
          "nOccurrences": 1,
          "duration": "anyTime"
        },
        "operator": "and",
        "conditions": {
          "value": []
        },
        "default": false,
        "triggerDesc": ""
      }
    ],
    "actions": [
      {
        "_id": "aat-65af99a0-f5eb************52ee986",
        "type": "hint",
        "expression": "critical",
        "message": {
          "title": "",
          "body": "",
          "titleDesc": "",
          "bodyDesc": "",
          "useGenAIForTitle": false,
          "useGenAIForBody": false,
          "postAction": "auto_close",
          "time": 5
        },
        "emails": [],
        "adherence": {
          "adType": "ack",
          "ackText": "Ok, Got it"
        },
        "default": false
      },
      {
        "_id": "aat-7b62a************a040df87b94",
        "type": "email_manager",
        "message": {
          "title": "",
          "body": ""
        },
        "emails": [
          "john.doe@example.com"
        ],
        "when": "immediately",
        "default": false
      }
    ],
    "assignees": [],
    "status": "ACTIVE",
    "state": "configured",
    "default": false,
    "deletable": true,
    "refId": "c966171-d************1c4715c",
    "lModOn": "2026-08-06T08:08:49.709Z",
    "_id": "acr-d618e************984-128ff14b35c5"
  }
]
```

## Response Parameters

| Parameter | Type | Description |
| - | - | - |
| `name` | String | Name of the rule or configuration. |
| `description` | String | Description of the rule. |
| `tags` | Array | Tags associated with the rule for categorization and filtering. |
| `channels` | Array | Channels where the rule is applicable, such as `chat` or `voice`. |
| `isActive` | Boolean | Indicates whether the rule is currently active. |
| `botId` | String | Unique identifier of the bot associated with the rule. |
| `accountId` | String | Unique identifier of the account that owns the rule. |
| `createdOn` | String (ISO 8601) | Date and time when the rule was created. |
| `triggers` | Array | List of trigger conditions that initiate the configured actions. |
| `type` | String | Type of trigger or action. |
| `by` | String | Entity that generates the trigger, such as `agent`. |
| `when` | String | Conditions that determine when a trigger or action is executed. The structure varies by trigger or action type. |
| `utteranceCount` | Integer | Number of utterances required before the trigger is activated. |
| `frequency` | Object | Frequency settings that control trigger execution. |
| `nOccurrences` | Integer | Number of times the trigger can occur. |
| `duration` | String | Time period during which the trigger frequency is evaluated. |
| `operator` | String | Logical operator used to evaluate conditions. |
| `conditions` | Object | Collection of conditions associated with the trigger. |
| `value` | Array | Values used to evaluate the configured conditions. |
| `triggerDesc` | String | Description of the trigger. Available for specific trigger types. |
| `actions` | Array | List of actions executed when trigger conditions are met. |
| `expression` | String | Expression used to evaluate or categorize the action. Available for specific action types. |
| `message` | Object | Message configuration associated with the action. |
| `title` | String | Title of the message. |
| `body` | String | Body content of the message. |
| `titleDesc` | String | Description of the message title. |
| `bodyDesc` | String | Description of the message body. |
| `useGenAIForTitle` | Boolean | Indicates whether generative AI is used to generate the message title. |
| `useGenAIForBody` | Boolean | Indicates whether generative AI is used to generate the message body. |
| `postAction` | String | Action performed after the message is displayed. |
| `time` | Integer | Duration, in seconds, for displaying the message. |
| `emails` | Array | Email addresses associated with the action. |
| `adherence` | Object | Adherence settings for the action. |
| `adType` | String | Adherence type. |
| `ackText` | String | Acknowledgment text displayed to the user. |
| `assignees` | Array | List of users assigned to the rule. |
| `status` | String | Current status of the rule. |
| `state` | String | Configuration state of the rule. |
| `default` | Boolean | Indicates whether the configuration is a default system configuration. |
| `deletable` | Boolean | Indicates whether the rule can be deleted. |
| `refId` | String | Reference identifier of the rule. |
| `lModOn` | String (ISO 8601) | Date and time when the rule was last modified. |
| `_id` | String | Unique identifier of the rule. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.