Skip to main content
POST
Crear webhook
Crea un webhook para recibir eventos de telefonía como call.status.updated, call.completed y call.error. La URL debe aceptar peticiones HTTPS.
Incluye X-API-Key y el header X-Workspace-Id al crear el webhook. El servicio puede firmar cada evento con X-Supervisor-Signature si proporcionas un secret.

Crear un webhook

Respuesta 201 Created
Si no envías secret, generaremos uno aleatorio de 32 caracteres. Para asociar el webhook a un agente de voz agrega agentId en el cuerpo.

Suscribirse a eventos

Una vez creado el webhook tienes que registrar las suscripciones que definen qué eventos se entregarán. Usa el endpoint POST /v1/webhooks//subscriptions con las claves del catálogo de eventos (por ejemplo call.status.updated, call.completed, call.error).
Respuesta 201 Created
Puedes crear varias suscripciones por webhook, una por eventKey. Si envías una clave no registrada en el catálogo recibirás 400. Usa GET /v1/webhooks//subscriptions para listar las suscripciones activas.

Notificaciones que enviaremos

Publicaremos eventos a tu URL en formato JSON. Incluimos ejemplos típicos:

call.status.updated — registrada

call.status.updated — en curso

call.status.updated — finalizada

call.status.updated — error

Validación de firmas (opcional)

Si configuras secret, firmaremos cada notificación con HMAC-SHA256 en el header X-Supervisor-Signature usando el formato sha256=HEX.

Reintentos y respuestas

  • Esperamos 2xx de tu servidor. Si no, reintentaremos con backoff.
  • Responde 200 OK lo antes posible (procesa de forma asíncrona si es necesario).

Buenas prácticas

  • Usa colas para procesar eventos.
  • Idempotencia: guarda id del evento para evitar duplicados.
  • Verifica la firma si definiste secret.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-workspace-id
string<uuid>
required

Identificador del workspace multi-tenant.

Body

application/json
url
string<uri>
required

Debe ser https.

agentId
string<uuid> | null

Identificador del agente asociado cuando aplica.

description
string | null
Maximum string length: 500
isActive
boolean
default:true
headers
object
secret
string

Secreto HMAC opcional proporcionado por el cliente. Si se omite, el backend genera uno.

method
enum<string>
default:POST

Método HTTP para entregar eventos del webhook

Available options:
GET,
POST

Response

Created

id
string<uuid>
required
url
string<uri>
required

Debe ser https.

isActive
boolean
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
agentId
string<uuid> | null

Identificador del agente asociado cuando aplica.

description
string | null
Maximum string length: 500
method
enum<string>
default:POST

Método HTTP para entregar eventos del webhook

Available options:
GET,
POST
secretPreview
string | null

Vista previa enmascarada del secreto (prefix...suffix).

lastDeliveryAt
string<date-time> | null
headers
object

Headers permitidos (allowlist). Nunca incluir Authorization.

successCount
integer<int32>
Required range: x >= 0
failureCount
integer<int32>
Required range: x >= 0