Skip to content

Send a running run's event to a webhook endpoint

Platform module

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`.

  • Requires the capability org.automations.write.
  • OAuth scopes: org.
  • Send an Idempotency-Key header. A replay with the same key returns the original response.
  • Error statuses: 400, 401, 404, 409, 422, 429. Errors are RFC 9457 problem details.

Path and query parameters

automationRuns.deliverWebhook: Path and query parameters
FieldTypeRequiredDescription
idstring (uuid)YesIdentifier of the automation run.

Request body: AutomationWebhookRequest

automationRuns.deliverWebhook: AutomationWebhookRequest
FieldTypeRequiredDescription
webhook_endpoint_idstring (uuid)YesIdentifier of the the org's webhook endpoint.
{
  "webhook_endpoint_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Response 201: AutomationWebhookResult

automationRuns.deliverWebhook: AutomationWebhookResult
FieldTypeRequiredDescription
webhook_delivery_idstring (uuid)YesIdentifier of the webhook delivery queued.
{
  "webhook_delivery_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Code samples

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"}'