Call Commands
Answer call
Answer an incoming call. You must issue this command before executing subsequent commands on an incoming call.
Expected Webhooks:
- call.answered
- call.hold and call.unhold if the call is held/unheld
- call.deepfake_detection.result if deepfake_detection was enabled
- call.deepfake_detection.error if deepfake_detection was enabled and an error occurred
- streaming.started, streaming.stopped or streaming.failed if stream_url was set
When the record parameter is set to record-from-answer, the response will include a recording_id field.
post/calls/{call_control_id}/actions/answer
Path parameters
call_control_idstring required
Unique identifier and token for controlling the call
Request body
Example request
{
"assistant": {
"greeting": "Hi, I'm your assistant. How can I help?",
"id": "asst_123",
"tools": [
{
"hangup": {},
"type": "hangup"
}
]
},
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"deepfake_detection": {
"enabled": true,
"rtp_timeout": 30,
"timeout": 15
},
"send_silence_when_idle": true,
"webhook_url": "https://www.example.com/server-b/",
"webhook_url_method": "POST"
}Response
Successful response upon making a call control command that includes recording_id.
Example response
{
"data": {
"recording_id": "d7e9c1d4-8b2a-4b8f-b3a7-9a671c9e9b0a",
"result": "ok"
}
}