Skip to main content

Webhooks

Webhooks allow you to receive real-time HTTP notifications when events occur in ZenFlow.

Webhooks Guide

Check the complete guide to see all available events, sample payloads, and how to verify signatures.

Endpoints

MethodEndpointDescription
POST/webhooksSubscribe to events
GET/webhooksList active subscriptions

Subscribe to Events

To receive notifications, create a webhook specifying your URL and the events you’re interested in:
POST /api/v1/webhooks
{
  "name": "My notifications",
  "url": "https://your-server.com/webhooks/zenflow",
  "events": ["order/created", "order/completed", "stock/updated"]
}

Available Events

CategoryEvents
Ordersorder/created, order/updated, order/cancelled, order/completed
Productsproduct/created, product/updated, product/deleted
Stockstock/updated, stock/low_alert, stock/movement_created
Flowsflow/started, flow/completed, flow/cancelled
Save the secret returned in the response. You’ll need it to verify signatures. It won’t be shown again.

Response

{
  "success": true,
  "data": {
    "id": "wh_abc123",
    "name": "My notifications",
    "url": "https://your-server.com/webhooks/zenflow",
    "events": ["order/created", "order/completed", "stock/updated"],
    "secret": "whsec_xxxxxxxxxxxxxxxx",
    "active": true,
    "created_at": "2024-01-15T10:30:00Z"
  }
}