/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
string
required
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
string
required
Your HTTPS endpoint URL that will receive event deliveries.
string[]
required
Non-empty list of event types to subscribe to.Allowed values:
task.updated, task.reviewed, task.shipped, task.awaiting_userstring
required
Shared 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.string
Optional description for this subscription. Maximum 200 characters.
object
Optional filter set to narrow event delivery.
Example
Response
A201 response confirms the subscription was created.
object
required
The created subscription record.
List subscriptions
GET /event-subscriptions
webhooks:read.
Inbound delivery headers
AgentRail sends the following headers with every outbound webhook delivery: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.
.png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)