v1.0

Webhooks

Webhook subscription endpoints

Subscribe to real-time events from SmartMCA.

List Subscriptions

GET /api/public/v1/webhooks

Required Scope: webhooks:read

Get Subscription

GET /api/public/v1/webhooks/:id

Required Scope: webhooks:read

Create Subscription

POST /api/public/v1/webhooks

Required Scope: webhooks:write

{
  "url": "https://your-server.com/webhooks",
  "events": ["deal.funded", "payment.completed"],
  "description": "Production webhook"
}

Response includes the signing secret (shown only once):

{
  "data": {
    "id": "clx...",
    "url": "https://your-server.com/webhooks",
    "events": ["deal.funded", "payment.completed"],
    "secret": "whsec_abc123...",
    "status": "active"
  }
}

Update Subscription

PATCH /api/public/v1/webhooks/:id

Required Scope: webhooks:write

{
  "events": ["deal.funded", "deal.paid_off"],
  "status": "paused"
}

Delete Subscription

DELETE /api/public/v1/webhooks/:id

Required Scope: webhooks:write

List Deliveries

GET /api/public/v1/webhooks/:id/deliveries?page=1&limit=20

Required Scope: webhooks:read

Available Events

EventDescription
deal.createdNew deal created
deal.updatedDeal updated
deal.status_changedDeal status changed
deal.fundedDeal funded
deal.paid_offDeal fully paid
application.createdNew application submitted
application.updatedApplication updated
application.stage_changedApplication stage changed
application.status_changedApplication status changed
merchant.createdNew merchant created
merchant.updatedMerchant updated
payment.createdPayment recorded
payment.completedPayment completed
payment.failedPayment failed
document.uploadedDocument uploaded

See the Webhooks Guide for verification and handling details.