POST/webhooks

Create a webhook destination

Register an endpoint to receive signed event deliveries. Account-scoped; no program_id header.

Required Attributes

urlstringrequired

HTTPS URL to deliver events to

Example: "https://api.example.com/webhooks/ledgr"

namestring

Friendly name (auto-generated if omitted)

descriptionstring

Notes

event_typesarray

Event types to subscribe to; omit for all events

Example: ["transaction.posted","transaction.reversed"]

Request
POST/webhooks
curl --location 'https://api.ledgr.dev/v1/webhooks' \
--header 'Authorization: {api_key}' \
--header 'Content-Type: application/json' \
--data '{
  "url": "https://api.example.com/webhooks/ledgr",
  "name": "example_name",
  "description": "example_description",
  "event_types": [
    "transaction.posted",
    "transaction.reversed"
  ]
}'
Response

The created destination (secret shown once)

{
  "status": "success",
  "endpoint": {
    "url": "https://api.example.com/webhooks/ledgr",
    "name": "orders-listener",
    "secret": "whsec_...",
    "enabled": true,
    "endpoint_id": "whe_20a18ce0",
    "event_types": null
  }
}