Webhooks Rail
Event notification and webhook management endpoints.
Overview
The Webhooks rail provides:
- Webhook endpoint management
- Event delivery
- Retry handling
- Delivery logs
Endpoints
Create Endpoint
http
POST /v1/webhooks/endpointstypescript
const endpoint = await iof.webhooks.createEndpoint({
url: "https://yourapp.com/webhooks",
events: ["contract.*", "kyc.verified"],
secret: "whsec_...", // Optional, auto-generated if not provided
});Response:
json
{
"id": "we_abc",
"url": "https://yourapp.com/webhooks",
"events": ["contract.*", "kyc.verified"],
"secret": "whsec_abc123...",
"status": "active",
"createdAt": "2024-01-15T10:30:00Z"
}Get Endpoint
http
GET /v1/webhooks/endpoints/:idtypescript
const endpoint = await iof.webhooks.getEndpoint("we_abc");Update Endpoint
http
PATCH /v1/webhooks/endpoints/:idtypescript
const endpoint = await iof.webhooks.updateEndpoint("we_abc", {
events: ["contract.*", "kyc.*", "compliance.*"],
});Delete Endpoint
http
DELETE /v1/webhooks/endpoints/:idtypescript
await iof.webhooks.deleteEndpoint("we_abc");List Events
http
GET /v1/webhooks/eventstypescript
const events = await iof.webhooks.listEvents({
endpointId: "we_abc",
status: "failed",
limit: 50,
});Retry Event
http
POST /v1/webhooks/events/:id/retrytypescript
await iof.webhooks.retryEvent("evt_xyz");Event Types
Contract Events
contract.createdcontract.updatedcontract.activatedcontract.maturedcontract.closed
KYC Events
kyc.submittedkyc.verifiedkyc.rejectedkyc.expired
Compliance Events
compliance.check.completedcompliance.alert.triggered
Billing Events
billing.invoice.createdbilling.invoice.paid
Delivery Status
| Status | Description |
|---|---|
pending | Awaiting delivery |
delivered | Successfully delivered |
failed | Delivery failed |
retrying | Retry in progress |
Retry Policy
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
Security
See Webhook Security for signature verification.
Next Steps
- Search Rail - Full-text search
- Security Guide - Signature verification