Skip to main content
The /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_user
string
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

A 201 response confirms the subscription was created.
object
required
The created subscription record.

List subscriptions

GET /event-subscriptions

Returns an array of subscription records in the same shape as the create response. Requires 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 the sha256= portion of x-agentrail-signature. Do not parse the JSON body before computing the digest.
Always verify the signature before processing a delivery. Reject any delivery where the signature does not match. Respond with 410 to tell AgentRail to disable the subscription if your endpoint is being retired.

CLI alternative

You can also manage subscriptions with the AgentRail CLI:

Error responses