# REST / Generic Webhook

Use an agent-bound credential with `events:write`.

`POST /v1/events/webhook`

Required headers:
- `Authorization: Bearer <agent-key>`
- `Idempotency-Key: <stable-delivery-id>`
- `Content-Type: application/json`

Example body:

```json
{
  "sourceSystem": "my-agent",
  "deliveryId": "order-0001",
  "environment": "sandbox",
  "intent": {"status":"OBSERVED","id":"intent-0001","type":"purchase","reference":"order-0001"},
  "action": {"type":"purchase","target":"supplier","resourceId":"order-0001","actorAccount":null},
  "economicEffect": {"kind":"non_monetary","status":"PENDING","amount":null,"fromAccount":null,"toAccount":null,"settlementId":null},
  "outcome": {"status":"PENDING","type":"order-created","reference":"order-0001"},
  "occurredAt": "2026-09-20T08:00:00.000Z"
}
```

MachinaLedger derives the verified organization, agent and credential authority from the bearer token. Do not put secrets in the event body.

Exact retries are idempotent. Reusing an Idempotency-Key with different content fails closed.
