---
title: "Send an event to a Loop (key in the URL)"
method: POST
path: "/webhooks/automations/{publicToken}/{key}"
tags: ["Loops"]
---

# Send an event to a Loop (key in the URL)

`POST /webhooks/automations/{publicToken}/{key}`

## Request

- Base URL: `https://api.reasonmachines.com`
- URL: `https://api.reasonmachines.com/webhooks/automations/{publicToken}/{key}`
- Auth: none required

Delivers an event to the Loop whose webhook this is. A Loop with a webhook wakes on each accepted event: the event opens a Session of its Reason, or continues the Session of earlier events with the same correlation key. The webhook URL and its key come back once, from the `createReasonLoop` (or `updateReasonLoop`) call that adds the webhook.

This form carries the key as the URL's last path segment, for a sender that only takes a URL. Prefer the bearer header or a signature where the sender allows one: a URL is easier to leak.

A retry with the same event id is answered 202 with `duplicate: true` and is not queued again. A paused or deleted Loop refuses events (409 `automation_disabled`).

<sub>Auth: the Loop's webhook key (bearer, body signature, or URL segment) only; API keys are not accepted</sub>

## Headers

- `X-Webhook-Correlation-Key` string
- `X-Webhook-Event-Id` string
- `X-Webhook-Event-Source` string
- `X-Signature-256` string

## Request body

- unknown

## Response `202`

Accepted, or a duplicate of an event already accepted.

- LoopWebhookAccepted
  - `accepted` true, required
  - `duplicate` boolean, required: True when an event with the same id already arrived: this one is not queued again, and the earlier event's ids are returned.
  - `event_id` string, required: The stored event.
  - `work_item_id` string, nullable, required: The unit of work its correlation key groups it into: one Session per work item.

## Other responses

- `400`: The body is not a JSON object (`invalid_json`, `invalid_payload`), or an id or correlation key is too long (`identifier_too_long`).
- `401`: No valid key or signature for this webhook (`unauthorized`); a signature that failed says so in `detail`.
- `409`: The Loop is paused or deleted (`automation_disabled`).
- `413`: The body is over 256 KiB (`payload_too_large`).
- `503`: Events are not being taken on this deployment right now; retry later.

## Changes

- **2026-10-26** `c250866428e0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ara/apis/reason-api/changes/webhooks/automations/:publicToken/:key/post.md)

---

[API](https://skmtc.dev/ara/apis/reason-api.md) - [All operations](https://skmtc.dev/ara/apis/reason-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ara/apis/reason-api/revisions/e97c8704807c?raw)
