Saltar al contenido

Send a running run's event to a webhook endpoint

Módulo Platform

POST/automation-runs/{id}/webhook-deliveriesautomationRuns.deliverWebhook

The call_webhook action (ADR 0047): during a run, its owner queues a delivery of the run's event to one of the org's webhook endpoints through `app.queue_automation_webhook`; the webhook dispatcher signs and retries it like every webhook. Needs org.automations.write, org.webhooks.manage and the webhooks plan feature. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requiere la capacidad org.automations.write.
  • Alcances de OAuth: org.
  • Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
  • Estados de error: 400, 401, 404, 409, 422, 429. Los errores son detalles de problema RFC 9457.

Parámetros de ruta y de consulta

automationRuns.deliverWebhook: Parámetros de ruta y de consulta
CampoTipoObligatorioDescripción
idstring (uuid)SíIdentifier of the automation run.

Cuerpo de la solicitud: AutomationWebhookRequest

automationRuns.deliverWebhook: AutomationWebhookRequest
CampoTipoObligatorioDescripción
webhook_endpoint_idstring (uuid)SíIdentifier of the the org's webhook endpoint.
{
  "webhook_endpoint_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Respuesta 201: AutomationWebhookResult

automationRuns.deliverWebhook: AutomationWebhookResult
CampoTipoObligatorioDescripción
webhook_delivery_idstring (uuid)SíIdentifier of the webhook delivery queued.
{
  "webhook_delivery_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Ejemplos de código

curl -X POST "$XOS_BASE_URL/automation-runs/0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f/webhook-deliveries" \
  -H "Authorization: Bearer $XOS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"webhook_endpoint_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'
const { data } = await xos.automationRuns.deliverWebhook("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {
    "webhook_endpoint_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
  });
response = xos.automation_runs.deliver_webhook("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {"webhook_endpoint_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"})
xos automation-runs deliver-webhook 0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f --data '{"webhook_endpoint_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'