Webhooks

Configure HTTP endpoints to receive real-time notifications when events occur in your AS2 partners.

POST /api/v1/webhooks/configure

Configure the webhook for a specific partner.

Request Body
CampoTipoRequeridoDescripción
partner_idintegerPartner for which the webhook is configured
webhook_urlstringWebhook target URL
webhook_secretstringShared secret used to validate deliveries
webhook_enabledbooleanEnable or disable the webhook
webhook_eventsarraySubscribed events

Legacy aliases also accepted: webhook_activo, webhook_eventos.

Available events
  • message.received
  • message.sent
  • mdn.received
  • send.error
Python example
response = requests.post(
    f"{BASE_URL}/webhooks/configure",
    headers=headers,
    json={
        "partner_id": 123,
        "webhook_url": "https://myapp.com/webhook/as2",
        "webhook_secret": "my_secret",
        "webhook_enabled": True,
        "webhook_events": ["message.received", "mdn.received"]
    }
)
Response
{
  "status": "success",
  "msg": "Webhook configured"
}

Read and test

POST /api/v1/webhooks/get

Get the persisted webhook configuration for a partner.

CampoTipoRequerido
partner_idinteger
POST /api/v1/webhooks/test

Trigger a test delivery using the first configured event for the partner, or message.received if no explicit event is configured.

CampoTipoRequerido
partner_idinteger
Response
{
  "status": "success",
  "http_code": 200,
  "requested_event_name": "mensaje.recibido",
  "event_name": "mensaje.recibido",
  "event": "message.received"
}
POST /api/v1/webhooks/logs

List webhook delivery logs for a partner.

CampoTipoDescripción
partner_idintegerRequired
limitintegerLimit, default 50
offsetintegerOffset
Real error cases
  • {"status":"error","msg":"Campo requerido: socio_id"} if the partner identifier is missing.
  • {"status":"error","msg":"Socio no encontrado"} if the partner does not exist in the current site.
  • {"status":"error","msg":"Webhook no activo"} if you try to test a disabled webhook.