Referencia de la API

Webhooks

Webhooks firmados que reciben eventos de campañas y llamadas.

GET /v1/webhooks

Result webhooks of my organization

Solo para usuarios con sesión iniciada (sin API key) · Rol: viewer o superior

Any signed-in member (not an API key). The https endpoints that receive the organization's events, oldest first. The secret is never listed. 401 when the token is missing, expired or invalid; 503 until webhooks are deployed.

Respuestas

  • 200 Successful Response · WebhookList
    NombreTipoRequeridoDescripción
    itemsWebhookResponse[]sí
    items[].activebooleansí
    items[].created_atstring (date-time)sí
    items[].descriptionstringsí
    items[].eventsstring[]sí
    items[].idstring (uuid)sí
    items[].updated_atstring (date-time)sí
    items[].urlstringsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none). · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/webhooks

Add a result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

An `admin` or above (not an API key). `url` must be https, with a public host. `events` are among the events of the catalog marked `webhook` (`campaign.started`, `campaign.completed`, `campaign.attempt.completed`, `call.result`, `call.analyzed`; `packages/contracts/events/catalog.json`). Each delivery is a POST with the event as JSON, signed in `X-eco-Signature` (`v1=` plus the hex HMAC-SHA256 of `{X-eco-Timestamp}.{body}` with the secret; every `X-eco-*` header also goes as `X-Froneus-*`, its name before the rename), and carries the event data: ids, outcome, duration and attempt number (and the last 4 digits of the phone) for campaign events, the extracted result or the analysis for call events. A failed delivery is retried with backoff and is dead after 8 attempts. The `secret` is returned in this response only. An organization has at most 10. 401 when the token is missing, expired or invalid; 403 below `admin`; 409 at the limit; 422 when the body is invalid; 503 until webhooks are deployed.

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
descriptionstring
eventsstring[]sí
urlstringsí

Respuestas

  • 201 Successful Response · WebhookWithSecretResponse
    NombreTipoRequeridoDescripción
    activebooleansí
    created_atstring (date-time)sí
    descriptionstringsí
    eventsstring[]sí
    idstring (uuid)sí
    secretstringsíShown once. Sign check: HMAC-SHA256 of `timestamp.body`.
    updated_atstring (date-time)sí
    urlstringsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this operation needs. · ErrorResponse
  • 409 The organization has 10 webhooks already. · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/webhooks/{webhook_id}

One result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: viewer o superior

Any signed-in member (not an API key). 401 when the token is missing, expired or invalid; 404 when it is not the organization's; 503 until webhooks are deployed.

Parámetros

NombreEnTipoRequeridoDescripción
webhook_idpathstring (uuid)sí

Respuestas

  • 200 Successful Response · WebhookResponse
    NombreTipoRequeridoDescripción
    activebooleansí
    created_atstring (date-time)sí
    descriptionstringsí
    eventsstring[]sí
    idstring (uuid)sí
    updated_atstring (date-time)sí
    urlstringsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none). · ErrorResponse
  • 404 No such webhook in the caller's tenant. · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

PATCH /v1/webhooks/{webhook_id}

Change a result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

An `admin` or above (not an API key). Only the fields sent change; `active: false` pauses it, and nothing is queued for it meanwhile. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 422 when the body is invalid; 503 until webhooks are deployed.

Parámetros

NombreEnTipoRequeridoDescripción
webhook_idpathstring (uuid)sí

Cuerpo de la solicitud

NombreTipoRequeridoDescripción
activeboolean | null
descriptionstring | null
eventsstring[] | null
urlstring | null

Respuestas

  • 200 Successful Response · WebhookResponse
    NombreTipoRequeridoDescripción
    activebooleansí
    created_atstring (date-time)sí
    descriptionstringsí
    eventsstring[]sí
    idstring (uuid)sí
    updated_atstring (date-time)sí
    urlstringsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this operation needs. · ErrorResponse
  • 404 No such webhook in the caller's tenant. · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

DELETE /v1/webhooks/{webhook_id}

Remove a result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

An `admin` or above (not an API key). Its delivery log goes with it. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 503 until webhooks are deployed.

Parámetros

NombreEnTipoRequeridoDescripción
webhook_idpathstring (uuid)sí

Respuestas

  • 204 Successful Response
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this operation needs. · ErrorResponse
  • 404 No such webhook in the caller's tenant. · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

GET /v1/webhooks/{webhook_id}/deliveries

Delivery log of a result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: viewer o superior

Any signed-in member (not an API key). Newest first. `status` keeps `pending`, `delivered` or `dead`. Pass `next_cursor` of a page as `cursor` to get the next one; `limit` is at most 200 (default 100). 401 when the token is missing, expired or invalid; 404 when it is not the organization's; 422 when a parameter is out of range or the cursor is not one we issued; 503 until webhooks are deployed.

Parámetros

NombreEnTipoRequeridoDescripción
webhook_idpathstring (uuid)sí
statusquerystring | null
limitqueryinteger
cursorquerystring | null

Respuestas

  • 200 Successful Response · WebhookDeliveryList
    NombreTipoRequeridoDescripción
    itemsWebhookDeliveryResponse[]sí
    items[].attemptsintegersí
    items[].created_atstring (date-time)sí
    items[].delivered_atstring (date-time) | nullsí
    items[].event_idstring (uuid)sí
    items[].event_typestringsí
    items[].idstring (uuid)sí
    items[].last_errorstring | nullsí
    items[].last_statusinteger | nullsí
    items[].next_attempt_atstring (date-time) | nullsí
    items[].statusstringsí (pending, delivered, dead)
    next_cursorstring | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one in `x-min-role`, a suspended organization, or an API key without the operation's `x-api-key-scope` (any key, if the operation has none). · ErrorResponse
  • 404 No such webhook in the caller's tenant. · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/webhooks/{webhook_id}/rotate-secret

Rotate the secret of a result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

An `admin` or above (not an API key). The old secret stops working at once; the new one is in this response only. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 503 until webhooks are deployed.

Parámetros

NombreEnTipoRequeridoDescripción
webhook_idpathstring (uuid)sí

Respuestas

  • 200 Successful Response · WebhookWithSecretResponse
    NombreTipoRequeridoDescripción
    activebooleansí
    created_atstring (date-time)sí
    descriptionstringsí
    eventsstring[]sí
    idstring (uuid)sí
    secretstringsíShown once. Sign check: HMAC-SHA256 of `timestamp.body`.
    updated_atstring (date-time)sí
    urlstringsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this operation needs. · ErrorResponse
  • 404 No such webhook in the caller's tenant. · ErrorResponse
  • 503 Webhooks are not available yet. · ErrorResponse
  • default Default Response · ErrorResponse

POST /v1/webhooks/{webhook_id}/test

Send a test event to a result webhook

Solo para usuarios con sesión iniciada (sin API key) · Rol: admin o superior

An `admin` or above (not an API key). Sends a signed `webhook.test` event now, outside the queue, and says what came back: `ok`, the HTTP `status_code`, an `error` class and the `duration_ms`. The response body of your endpoint is never returned. 401 when the token is missing, expired or invalid; 403 below `admin`; 404 when it is not the organization's; 429 when the organization sends too many tests, with `Retry-After` (at most 20 per minute per organization, `TOOL_TESTS_PER_MINUTE`, shared by tool and webhook tests and counted across replicas when Redis is set); 503 until webhooks are deployed or when the rate limiter is unavailable.

Parámetros

NombreEnTipoRequeridoDescripción
webhook_idpathstring (uuid)sí

Respuestas

  • 200 Successful Response · WebhookTestResponse
    NombreTipoRequeridoDescripción
    duration_msintegersí
    errorstring | nullsí
    okbooleansí
    status_codeinteger | nullsí
  • 401 Missing, expired or invalid token. · ErrorResponse
  • 403 Role below the one this operation needs. · ErrorResponse
  • 404 No such webhook in the caller's tenant. · ErrorResponse
  • 429 Too many tests; see `Retry-After`. · ErrorResponse
  • 503 Webhooks are not deployed, or the rate limiter is unavailable. · ErrorResponse
  • default Default Response · ErrorResponse