Create Webhook

Create a new webhook endpoint to receive real-time notifications about events.

Endpoint

POST /api/webhooks

Request Body

ParameterTypeRequiredDescription
urlstringYesWebhook endpoint URL
eventsarrayYesArray of event types to subscribe to
descriptionstringNoWebhook description

Response

Returns the created webhook object.
{
  "id": "wh_123456789",
  "url": "https://your-app.com/webhooks",
  "events": ["payment.completed", "invoice.paid"],
  "description": "Payment notifications",
  "status": "active",
  "created_at": "2023-01-01T00:00:00Z"
}