TheDocumentation Index
Fetch the complete documentation index at: https://agentrail.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
/event-subscriptions endpoints let you register a URL to receive AgentRail task lifecycle events as outbound HTTP POST requests. Webhook delivery is at-least-once with exponential backoff for up to 8 attempts. Your endpoint must deduplicate on X-AgentRail-Event-Id — this header remains stable across retries, while X-AgentRail-Delivery-Id changes on each attempt.
AgentRail signs every outbound delivery using HMAC-SHA256 over the raw request body with the subscription secret you provide at creation time. Always verify the X-AgentRail-Signature header before processing a delivery.
Required scopes:
webhooks:read (list), webhooks:write (create/delete)Create a subscription
POST /event-subscriptions
Headers
Unique key for safe retries. The same key plus the same body replays the original accepted result. Reusing the key with a different body returns
409 conflict. Must be 8–128 characters.Request body
Your HTTPS endpoint URL that will receive event deliveries.
Non-empty list of event types to subscribe to.Allowed values:
task.updated, task.reviewed, task.shipped, task.awaiting_userShared secret used to compute and verify the
X-AgentRail-Signature on each delivery. Must be 16–128 characters. Store this value securely — AgentRail never returns it after creation.Optional description for this subscription. Maximum 200 characters.
Optional filter set to narrow event delivery.
Example
Response
A201 response confirms the subscription was created.
The created subscription record.
List subscriptions
GET /event-subscriptions
webhooks:read.
Inbound delivery headers
AgentRail sends the following headers with every outbound webhook delivery:| Header | Description |
|---|---|
x-agentrail-subscription-id | The subscription that triggered this delivery. Pattern: evsub_[A-Za-z0-9]+. |
x-agentrail-event-id | Stable logical event ID. Deduplicate on this value. Pattern: evt_[A-Za-z0-9]+. |
x-agentrail-event-type | Event type, for example task.reviewed. |
x-agentrail-delivery-id | Unique delivery attempt ID. Changes on each retry. Pattern: dlv_[A-Za-z0-9]+. |
x-agentrail-delivery-attempt | Monotonic retry attempt number, starting from 1. |
x-agentrail-signature | HMAC-SHA256 signature of the raw request body. Format: sha256=<64 hex chars>. |
Verifying the signature
Compute an HMAC-SHA256 digest of the raw request body bytes using your subscription secret, then compare it to thesha256= portion of x-agentrail-signature. Do not parse the JSON body before computing the digest.
CLI alternative
You can also manage subscriptions with the AgentRail CLI:Error responses
| Status | Code | Meaning |
|---|---|---|
400 | validation_error | Request body failed validation. |
401 | unauthorized | Bearer token is missing or invalid. |
403 | insufficient_scope | Key does not have webhooks:write (create) or webhooks:read (list). |
409 | conflict | An active subscription already exists for this endpoint and filter set, or the Idempotency-Key was reused with a different body. |
.png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)