--- title: "AI Agent Event" slug: "ai-agent-event" updated: 2025-09-18T22:06:04Z published: 2025-09-18T22:06:04Z canonical: "developer.comm100.com/ai-agent-event" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # AI Agent Event ## Event - `Event` - Event Management - `GET aiagent/aiAgents/{aiAgentId}/eventWhenStartingAChat` - [Get Starting Chat Event](/docs/ai-agent-event#get-starting-chat-event) - `GET aiagent/aiAgents/{aiAgentId}/eventWhenNoAnswer` - [Get No Answer Event](/docs/ai-agent-event#get-no-answer-event) - `GET aiagent/aiAgents/{aiAgentId}/eventWhenFinishingAnAnswer` - [Get Finishing Answer Event](/docs/ai-agent-event#get-finishing-answer-event) - `PUT aiagent/aiAgents/{aiAgentId}/eventWhenStartingAChat` - [Update Starting Chat Event](/docs/ai-agent-event#update-starting-chat-event) - `PUT aiagent/aiAgents/{aiAgentId}/eventWhenNoAnswer` - [Update No Answer Event](/docs/ai-agent-event#update-no-answer-event) - `PUT aiagent/aiAgents/{aiAgentId}/eventWhenFinishingAnAnswer` - [Update Finishing Answer Event](/docs/ai-agent-event#update-finishing-answer-event) ### Event JSON Format Event is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `aiAgentId` | guid | Id of the AI agent. | | `type` | enum | Allowed values are `workflow`, `naturalLanguage`. | | `workflow` | object | Chatbot response workflow. | | `instructions` | string | Instructions for the event. | | `functionIds` | guid array | Array of function IDs used in this event. | | `functions` | [Function](https://developer.comm100.com/docs/ai-agent-function) Array | Array of functions used in this event. | ### Get Starting Chat Event `GET aiagent/aiAgents/{aiAgentId}/eventWhenStartingAChat` #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `siteId` | integer | query | yes | Site Id. | | `aiAgentId` | guid | path | yes | Id of the AI agent. | #### Response: [Event](/docs/ai-agent-event#event-json-format) #### Example Sample Request: ``` curl https://api11.comm100.io/aiagent/aiAgents/e8397b4f-63fa-4d43-9967-99f390f93d98/eventWhenStartingAChat?siteId=10000 \ -X GET \ -H 'Authorization: Bearer {access_token}' ``` Response: HTTP/1.1 200 OK ``` { "aiAgentId": "e8397b4f-63fa-4d43-9967-99f390f93d98", "type": "workflow", "workflow": { "id": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActions": [ { "id": "4fd6679c-e94b-4337-a976-5c7bb70e6d6e", "type": "chatbotActionSendMessage", "xPosition": 150, "yPosition": 50, "chatbotResponseId": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActionSendMessage": { "chatbotActionId": "4fd6679c-e94b-4337-a976-5c7bb70e6d6e", "nextActionId": "00000000-0000-0000-0000-000000000000", "typingDelay": 1.00, "message": "Hi there! I'm AI agent, here to help answer your questions.", "chatbotActionSendMessageLinks": [] } }, { "id": "fcafba38-e35d-418f-a235-fe81506bcc09", "type": "chatbotActionStart", "xPosition": 24, "yPosition": 50, "chatbotResponseId": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActionStart": { "chatbotActionId": "fcafba38-e35d-418f-a235-fe81506bcc09", "nextActionId": "4fd6679c-e94b-4337-a976-5c7bb70e6d6e" } } ] }, "instructions": "", "functionIds": [] } ``` ### Get No Answer Event `GET aiagent/aiAgents/{aiAgentId}/eventWhenNoAnswer` #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `siteId` | integer | query | yes | Site Id. | | `aiAgentId` | guid | path | yes | Id of the AI agent. | #### Response: [Event](/docs/ai-agent-event#event-json-format) #### Example Sample Request: ``` curl https://api11.comm100.io/aiagent/aiAgents/e8397b4f-63fa-4d43-9967-99f390f93d98/eventWhenNoAnswer?siteId=10000 \ -X GET \ -H 'Authorization: Bearer {access_token}' ``` Response: HTTP/1.1 200 OK ``` { "aiAgentId": "e8397b4f-63fa-4d43-9967-99f390f93d98", "type": "workflow", "workflow": { "id": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActions": [] }, "instructions": "", "functionIds": [], "functions": [] } ``` ### Get Finishing Answer Event `GET aiagent/aiAgents/{aiAgentId}/eventWhenFinishingAnAnswer` #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `siteId` | integer | query | yes | Site Id. | | `aiAgentId` | guid | path | yes | Id of the AI agent. | #### Response: [Event](/docs/ai-agent-event#event-json-format) #### Example Sample Request: ``` curl https://api11.comm100.io/aiagent/aiAgents/3f6a7b71-00ba-491f-8e74-ce0ca169b02e/eventWhenFinishingAnAnswer?siteId=10000 \ -X GET \ -H 'Authorization: Bearer {access_token} ``` Response: HTTP/1.1 200 OK ``` { "aiAgentId": "3f6a7b71-00ba-491f-8e74-ce0ca169b02e", "type": "workflow", "workflow": { "id": "3a5db478-f1ed-446d-bebd-2a77a8bbcd6d", "chatbotActions": [] }, "instructions": "", "functionIds": [], "functions": [] } ``` ### Update Starting Chat Event `PUT aiagent/aiAgents/{aiAgentId}/eventWhenStartingAChat` #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `siteId` | integer | query | yes | Site Id. | | `aiAgentId` | guid | path | yes | Id of the AI agent. | | `type` | enum | body | yes | Allowed values are `workflow`, `naturalLanguage`. | | `workflow` | object | body | no | Chatbot response workflow. | | `instructions` | string | body | no | Instructions for the event. | | `functionIds` | guid array | body | no | Array of function IDs to use in this event. | #### Response: [Event](/docs/ai-agent-event#event-json-format) #### Example Sample Request: ``` curl https://api11.comm100.io/aiagent/aiAgents/e8397b4f-63fa-4d43-9967-99f390f93d98/eventWhenStartingAChat?siteId=10000 \ -X PUT \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"aiAgentId":"e8397b4f-63fa-4d43-9967-99f390f93d98","type":"workflow","workflow":{"id":"093c4061-67f7-45f8-8849-27fab8007ec4","chatbotActions":[{"id":"fcafba38-e35d-418f-a235-fe81506bcc09","type":"chatbotActionStart","xPosition":24,"yPosition":50,"chatbotResponseId":"093c4061-67f7-45f8-8849-27fab8007ec4","chatbotActionStart":{"chatbotActionId":"fcafba38-e35d-418f-a235-fe81506bcc09","nextActionId":"4fd6679c-e94b-4337-a976-5c7bb70e6d6e"},"extendData":null},{"id":"4fd6679c-e94b-4337-a976-5c7bb70e6d6e","type":"chatbotActionSendMessage","xPosition":150,"yPosition":50,"chatbotResponseId":"093c4061-67f7-45f8-8849-27fab8007ec4","chatbotActionSendMessage":{"chatbotActionId":"4fd6679c-e94b-4337-a976-5c7bb70e6d6e","nextActionId":"00000000-0000-0000-0000-000000000000","typingDelay":1,"message":"Hi there! I am AI agent, here to help answer your questions.","chatbotActionSendMessageLinks":[]},"isError":false,"extendData":{"actionTitle":true,"links":true,"linkTo":true,"defaultOpenIn":"sideWindow","defaultLinkToType":"webview","htmlInput":{"dynamicInfo":true},"maxLinkCount":10}}]},"functionIds":[],"instructions":""}' ``` Response: HTTP/1.1 200 OK ``` { "aiAgentId": "e8397b4f-63fa-4d43-9967-99f390f93d98", "type": "workflow", "workflow": { "id": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActions": [ { "id": "4fd6679c-e94b-4337-a976-5c7bb70e6d6e", "type": "chatbotActionSendMessage", "xPosition": 150, "yPosition": 50, "chatbotResponseId": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActionSendMessage": { "chatbotActionId": "4fd6679c-e94b-4337-a976-5c7bb70e6d6e", "nextActionId": "00000000-0000-0000-0000-000000000000", "typingDelay": 1.00, "message": "Hi there! I'm AI agent, here to help answer your questions.", "chatbotActionSendMessageLinks": [] } }, { "id": "fcafba38-e35d-418f-a235-fe81506bcc09", "type": "chatbotActionStart", "xPosition": 24, "yPosition": 50, "chatbotResponseId": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActionStart": { "chatbotActionId": "fcafba38-e35d-418f-a235-fe81506bcc09", "nextActionId": "4fd6679c-e94b-4337-a976-5c7bb70e6d6e" } } ] }, "instructions": "", "functionIds": [] } ``` ### Update No Answer Event `PUT aiagent/aiAgents/{aiAgentId}/eventWhenNoAnswer` #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `siteId` | integer | query | yes | Site Id. | | `aiAgentId` | guid | path | yes | Id of the AI agent. | | `type` | enum | body | yes | Allowed values are `workflow`, `naturalLanguage`. | | `workflow` | object | body | no | Chatbot response workflow. | | `instructions` | string | body | no | Instructions for the event. | | `functionIds` | guid array | body | no | Array of function IDs to use in this event. | #### Response: [Event](/docs/ai-agent-event#event-json-format) #### Example Sample Request: ``` curl https://api11.comm100.io/aiagent/aiAgents/e8397b4f-63fa-4d43-9967-99f390f93d98/eventWhenNoAnswer?siteId=10000 \ -X PUT \ -H 'Authorization : Bearer { access_token }' \ -H 'Content-Type: application/json' \ -D '{"aiAgentId":"e8397b4f-63fa-4d43-9967-99f390f93d98","type":"workflow","workflow":{"id":"093c4061-67f7-45f8-8849-27fab8007ec4","chatbotActions":[]},"instructions":"","functionIds":[]}' ``` Response: HTTP/1.1 200 OK ``` { "aiAgentId": "e8397b4f-63fa-4d43-9967-99f390f93d98", "type": "workflow", "workflow": { "id": "093c4061-67f7-45f8-8849-27fab8007ec4", "chatbotActions": [] }, "instructions": "", "functionIds": [], "functions": [] } ``` ### Update Finishing Answer Event `PUT aiagent/aiAgents/{aiAgentId}/eventWhenFinishingAnAnswer` #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `siteId` | integer | query | yes | Site Id. | | `aiAgentId` | guid | path | yes | Id of the AI agent. | | `type` | enum | body | yes | Allowed values are `workflow`, `naturalLanguage`. | | `workflow` | object | body | no | Chatbot response workflow. | | `instructions` | string | body | no | Instructions for the event. | | `functionIds` | guid array | body | no | Array of function IDs to use in this event. | #### Response: [Event](/docs/ai-agent-event#event-json-format) #### Example Sample Request: ``` curl https://api11.comm100.io/aiagent/aiAgents/3f6a7b71-00ba-491f-8e74-ce0ca169b02e/eventWhenFinishingAnAnswer?siteId=10000 \ -X PUT \ -H 'Authorization : Bearer { access_token }' \ -H 'Content-Type: application/json' \ -D '{"aiAgentId":"3f6a7b71-00ba-491f-8e74-ce0ca169b02e","type":"workflow","workflow":{"id":"3a5db478-f1ed-446d-bebd-2a77a8bbcd6d","chatbotActions":[]},"instructions":"","functionIds":[]}' ``` Response: HTTP/1.1 200 OK ``` { "aiAgentId": "3f6a7b71-00ba-491f-8e74-ce0ca169b02e", "type": "workflow", "workflow": { "id": "3a5db478-f1ed-446d-bebd-2a77a8bbcd6d", "chatbotActions": [] }, "instructions": "", "functionIds": [], "functions": [] } ```