Call Commands
Gather using AI
Gather parameters defined in the request payload using a voice assistant.
You can pass parameters described as a JSON Schema object and the voice assistant will attempt to gather these informations.
Expected Webhooks:
- call.ai_gather.ended
- call.conversation.ended
- call.ai_gather.partial_results (if send_partial_results is set to true)
- call.ai_gather.message_history_updated (if send_message_history_updates is set to true)
post/calls/{call_control_id}/actions/gather_using_ai
Path parameters
call_control_idstring required
Unique identifier and token for controlling the call
Request body
Example request
{
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"greeting": "Hello, can you tell me your age and where you live?",
"message_history": [
{
"content": "Hello, what's your name?",
"role": "assistant"
},
{
"content": "Hello, I'm John.",
"role": "user"
}
],
"parameters": {
"properties": {
"age": {
"description": "The age of the customer.",
"type": "integer"
},
"location": {
"description": "The location of the customer.",
"type": "string"
}
},
"required": [
"age",
"location"
],
"type": "object"
},
"send_message_history_updates": true,
"send_partial_results": true,
"user_response_timeout_ms": 5000,
"voice": "Telnyx.KokoroTTS.af"
}Response
Successful response upon making a call control command that includes conversation_id.
Example response
{
"data": {
"conversation_id": "d7e9c1d4-8b2a-4b8f-b3a7-9a671c9e9b0a",
"result": "ok"
}
}