curl -X PATCH \
'https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
<?php
$client = new \GuzzleHttp\Client();
$response = $client->patch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
],
]);
$data = json_decode($response->getBody());
{
"success": true,
"message": "Webhook habilitado",
"data": {
"id": "9fcafbf2-7593-44d6-8cd7-1b221beba62a",
"agent_id": "9fbef0b7-8d4e-4a08-9207-66c22155721d",
"name": "Meu Webhook",
"webhook_url": "https://example.com/webhook",
"events": ["event_phone_call_started", "event_phone_call_ended"],
"timeout": 30,
"max_retries": 3,
"enabled": true,
"created_at": "2025-09-03T23:19:51.000000Z",
"updated_at": "2025-09-03T23:50:15.000000Z",
"events_count": 2,
"status": "active"
}
}
Webhooks de Agente
Alternar Status do Webhook
Habilitar ou desabilitar um webhook
PATCH
/
api
/
v1
/
agents
/
{agent_id}
/
webhooks
/
{webhook_id}
/
toggle
curl -X PATCH \
'https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
<?php
$client = new \GuzzleHttp\Client();
$response = $client->patch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
],
]);
$data = json_decode($response->getBody());
{
"success": true,
"message": "Webhook habilitado",
"data": {
"id": "9fcafbf2-7593-44d6-8cd7-1b221beba62a",
"agent_id": "9fbef0b7-8d4e-4a08-9207-66c22155721d",
"name": "Meu Webhook",
"webhook_url": "https://example.com/webhook",
"events": ["event_phone_call_started", "event_phone_call_ended"],
"timeout": 30,
"max_retries": 3,
"enabled": true,
"created_at": "2025-09-03T23:19:51.000000Z",
"updated_at": "2025-09-03T23:50:15.000000Z",
"events_count": 2,
"status": "active"
}
}
Visão Geral
Alterna o status habilitado/desabilitado de um webhook. Isso é útil para parar temporariamente as notificações de webhook sem excluir a configuração.Endpoint
Requisição
curl -X PATCH \
'https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
<?php
$client = new \GuzzleHttp\Client();
$response = $client->patch('https://app.talkover.ai/api/v1/agents/9fbef0b7-8d4e-4a08-9207-66c22155721d/webhooks/9fcafbf2-7593-44d6-8cd7-1b221beba62a/toggle', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
],
]);
$data = json_decode($response->getBody());
Resposta
{
"success": true,
"message": "Webhook habilitado",
"data": {
"id": "9fcafbf2-7593-44d6-8cd7-1b221beba62a",
"agent_id": "9fbef0b7-8d4e-4a08-9207-66c22155721d",
"name": "Meu Webhook",
"webhook_url": "https://example.com/webhook",
"events": ["event_phone_call_started", "event_phone_call_ended"],
"timeout": 30,
"max_retries": 3,
"enabled": true,
"created_at": "2025-09-03T23:19:51.000000Z",
"updated_at": "2025-09-03T23:50:15.000000Z",
"events_count": 2,
"status": "active"
}
}
{
"success": true,
"message": "Webhook desabilitado",
"data": {
"id": "9fcafbf2-7593-44d6-8cd7-1b221beba62a",
"agent_id": "9fbef0b7-8d4e-4a08-9207-66c22155721d",
"name": "Meu Webhook",
"webhook_url": "https://example.com/webhook",
"events": ["event_phone_call_started", "event_phone_call_ended"],
"timeout": 30,
"max_retries": 3,
"enabled": false,
"created_at": "2025-09-03T23:19:51.000000Z",
"updated_at": "2025-09-03T23:50:15.000000Z",
"events_count": 2,
"status": "disabled"
}
}
Respostas de erro
{
"message": "Token Bearer ausente"
}
{
"success": false,
"message": "Agente não encontrado neste ambiente."
}
{
"success": false,
"message": "Webhook não encontrado."
}
Notas Importantes
- Este endpoint alterna o status atual habilitado/desabilitado do webhook
- Webhooks desabilitados não receberão nenhum evento até serem re-habilitados
- Operações de webhook limpam automaticamente o cache do agente para efeito imediato
- Use este endpoint para gerenciamento temporário de webhook sem perder a configuração
Endpoints relacionados
- Listar Webhooks do Agente - Obter todos os webhooks de um agente
- Criar Webhook - Configurar um novo webhook
- Obter Detalhes do Webhook - Recuperar informações específicas do webhook
- Atualizar Webhook - Modificar configuração do webhook
- Excluir Webhook - Remover configuração do webhook
- Testar Webhook - Enviar payload de teste para verificar conectividade
Esta página foi útil?