Skip to content

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/endpoints
typescript
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/:id
typescript
const endpoint = await iof.webhooks.getEndpoint("we_abc");

Update Endpoint

http
PATCH /v1/webhooks/endpoints/:id
typescript
const endpoint = await iof.webhooks.updateEndpoint("we_abc", {
  events: ["contract.*", "kyc.*", "compliance.*"],
});

Delete Endpoint

http
DELETE /v1/webhooks/endpoints/:id
typescript
await iof.webhooks.deleteEndpoint("we_abc");

List Events

http
GET /v1/webhooks/events
typescript
const events = await iof.webhooks.listEvents({
  endpointId: "we_abc",
  status: "failed",
  limit: 50,
});

Retry Event

http
POST /v1/webhooks/events/:id/retry
typescript
await iof.webhooks.retryEvent("evt_xyz");

Event Types

Contract Events

  • contract.created
  • contract.updated
  • contract.activated
  • contract.matured
  • contract.closed

KYC Events

  • kyc.submitted
  • kyc.verified
  • kyc.rejected
  • kyc.expired

Compliance Events

  • compliance.check.completed
  • compliance.alert.triggered

Billing Events

  • billing.invoice.created
  • billing.invoice.paid

Delivery Status

StatusDescription
pendingAwaiting delivery
deliveredSuccessfully delivered
failedDelivery failed
retryingRetry in progress

Retry Policy

AttemptDelay
1Immediate
21 minute
35 minutes
430 minutes
52 hours

Security

See Webhook Security for signature verification.

Next Steps

Licensed under the Apache License 2.0