curl -X POST "https://app.talkover.ai/api/v1/agents/agent-uuid/end-call" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{ "call_sid": "call-uuid-123" }'
await fetch('https://app.talkover.ai/api/v1/agents/agent-uuid/end-call', {
method: 'POST',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ call_sid: 'call-uuid-123' })
});
{
"success": true,
"data": {
"id": "call-uuid-123",
"status": "completed",
"ended_at": "2024-01-15T11:35:42Z",
"ended_reason": "ended_by_api"
}
}
Fazer Chamada
Encerrar Chamada
Desligar uma chamada ativa realizada por um agente
POST
/
api
/
v1
/
agents
/
{agent_id}
/
end-call
curl -X POST "https://app.talkover.ai/api/v1/agents/agent-uuid/end-call" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{ "call_sid": "call-uuid-123" }'
await fetch('https://app.talkover.ai/api/v1/agents/agent-uuid/end-call', {
method: 'POST',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ call_sid: 'call-uuid-123' })
});
{
"success": true,
"data": {
"id": "call-uuid-123",
"status": "completed",
"ended_at": "2024-01-15T11:35:42Z",
"ended_reason": "ended_by_api"
}
}
Encerrar Chamada
Desliga uma chamada ativa realizada por um agente específico. Use isto para paradas de emergência, cancelamentos solicitados pelo usuário ou para impor lógica de timeout customizada a partir da sua aplicação.Endpoint
POST /api/v1/agents/{agent_id}/end-call
Parâmetros de caminho
string
obrigatório
UUID do agente que possui a chamada.
Cabeçalhos da requisição
string
obrigatório
Token Bearer. Formato:
Bearer talq_your_environment_token_herestring
obrigatório
Deve ser definido como
application/jsonCorpo da requisição
string
obrigatório
Identificador da chamada a desligar. Use o
id retornado por Realizar uma Chamada.Exemplos
curl -X POST "https://app.talkover.ai/api/v1/agents/agent-uuid/end-call" \
-H "Authorization: Bearer talq_your_environment_token_here" \
-H "Content-Type: application/json" \
-d '{ "call_sid": "call-uuid-123" }'
await fetch('https://app.talkover.ai/api/v1/agents/agent-uuid/end-call', {
method: 'POST',
headers: {
'Authorization': 'Bearer talq_your_environment_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({ call_sid: 'call-uuid-123' })
});
Resposta
{
"success": true,
"data": {
"id": "call-uuid-123",
"status": "completed",
"ended_at": "2024-01-15T11:35:42Z",
"ended_reason": "ended_by_api"
}
}
Respostas de erro
404 — Chamada Não Encontrada
{
"success": false,
"message": "Call not found for this agent"
}
409 — Chamada Já Encerrada
{
"success": false,
"message": "Call is not active",
"code": "CALL_NOT_ACTIVE"
}
Observações
- A propagação do hangup é assíncrona. O status da chamada muda para
completedlogo após este endpoint retornar. - O
ended_reasonseráended_by_apipara diferenciar de hangups naturais. - Eventos de webhook
event_phone_call_endedserão disparados normalmente.
Esta página foi útil?