Skip to main content
Back to API List Notifies Agent AI when a conversation terminates, triggering configured post-conversation actions such as cleanup and state reset. Invoke this API only once at the final termination of the call — whether it ends normally or unexpectedly — to ensure accurate event handling and prevent duplicate processing.

API Details

FieldValue
MethodPOST
Endpointhttps://{{host}}/agentai/api/v1/hooks/{{botId}}
Content Typeapplication/json
Authorizationauth: {{JWT}} — See How to generate the JWT Token

Path Parameters

ParameterRequiredDescription
hostYesThe environment URL. For example, https://platform.kore.ai.
botIdYesAI Agent ID or Stream ID. Available on the General Settings page of the AI Agent.

Sample Request

curl --location 'https://{{host}}/agentai/api/v1/hooks/st-56fbfece-0293-55a3-9154-7e3e19xxxxxx' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
    "botId": "st-56fbfece-0293-55a3-9154-7e3e19xxxxxx",
    "conversationId": "atesta-mlxxxxxx",
    "events": [{
        "name": "END_OF_CONVERSATION",
        "reason": "agent_initiated",
        "language": "en",
        "experience": "voice",
        "participant": {
            "identity": "agent1",
            "name": "Agent AI",
            "type": "agent",
            "customFields": {
                "agentEmail": "qqqqqq",
                "queueId": "1694",
                "queueName": "queue11"
            }
        }
    }]
}'

Body Parameters

ParameterRequiredDescription
conversationIdYesUnique identifier of the conversation.
botIdYesUnique identifier of the bot.
eventsYesList of events to trigger.
events[].nameYesName of the event. For example, "END_OF_CONVERSATION".
events[].reasonYesReason for ending the conversation. For example, agent_initiated.
events[].languageYesLanguage of the conversation. For example, en.
events[].experienceYesInteraction type. For example, voice or chat.
events[].participantYesParticipant details associated with the event.
events[].participant.identityYesUnique participant identifier.
events[].participant.nameYesDisplay name of the participant.
events[].participant.typeYesParticipant type. For example, agent.
events[].participant.customFieldsNoCustom metadata associated with the participant.
events[].participant.customFields.agentEmailNoAgent email identifier.
events[].participant.customFields.queueIdNoQueue identifier.
events[].participant.customFields.queueNameNoQueue name.

Sample Response

{
    "STATUS": "OK"
}