How it works
- You register an HTTPS endpoint (your server URL)
- You choose which event types to subscribe to
- AgentRef sends a signed
POSTrequest to your URL every time a matching event fires - Your server responds with a
2xxstatus to acknowledge receipt - If delivery fails, AgentRef retries automatically on an exponential backoff schedule
Webhook envelope
Every webhook delivery shares the same outer envelope regardless of event type:| Field | Description |
|---|---|
id | Unique message ID. Use this for idempotency. |
type | Event type string, e.g. conversion.created |
schemaVersion | Always 2 for current payloads |
createdAt | ISO 8601 timestamp when the event was created |
merchantId | Your merchant ID |
programId | Program ID the event belongs to (omitted for merchant-scoped events) |
environment | production, preview, or development |
data | Event-specific payload (see Events) |
Registering a webhook endpoint
- Dashboard
- API
- Go to Settings → Webhooks in your dashboard
- Click Add endpoint
- Enter your endpoint URL and a descriptive name
- Select the event types you want to receive
- Optionally scope the endpoint to a specific program
- Click Create – your signing secret is shown once; copy it now
Event type filtering
You must subscribe to at least one event type per endpoint. You can subscribe to any subset of the 13 available events. Only events in your subscription list will be delivered to that endpoint. To update subscriptions on an existing endpoint:cURL
Program scoping
By default, a webhook endpoint receives events from all your programs. If you have multiple programs and want to isolate events, you can scope an endpoint to a specific program by passingprogramId when creating or updating the endpoint.
A scoped endpoint only receives events where programId matches. Unscoped endpoints receive events from every program.
cURL
Endpoint requirements
- HTTPS only – HTTP endpoints are rejected in production (localhost HTTP is allowed during development)
- Respond within 30 seconds – requests that time out are treated as failed deliveries
- Return a 2xx status – any non-2xx response triggers a retry, including 3xx redirects
- No authentication required on your side – verify the request using the signature instead
Managing endpoints via API
| Method | Path | Scope required | Description |
|---|---|---|---|
GET | /api/v1/webhooks | webhooks:read | List all endpoints |
POST | /api/v1/webhooks | webhooks:write | Create an endpoint |
GET | /api/v1/webhooks/{id} | webhooks:read | Get a single endpoint |
PATCH | /api/v1/webhooks/{id} | webhooks:write | Update name, URL, or subscriptions |
DELETE | /api/v1/webhooks/{id} | webhooks:write | Disable an endpoint |
POST | /api/v1/webhooks/{id}/rotate-secret | webhooks:write | Rotate the signing secret |
Deleting an endpoint marks it as
disabled. Disabled endpoints stop receiving deliveries and cannot be re-enabled via API – create a new endpoint instead.Next steps
Signature Verification
Verify incoming requests are genuinely from AgentRef
Events Reference
Full payload examples for all 13 event types
Retry & Delivery
Understand retries, idempotency, and failure handling
Testing
Test your endpoint locally before going to production