Skip to main content
POST
/
v1
/
webhooks
Create a webhook
curl --request POST \
  --url https://api.ledger.so/v1/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://example.com/webhooks/ledger",
  "events": [
    "customer.created",
    "transaction.completed",
    "card.issued"
  ]
}
'
{
  "ok": true,
  "data": {
    "id": "whk_bcd890",
    "url": "https://example.com/webhooks/ledger",
    "events": [
      "customer.created",
      "transaction.completed",
      "card.issued"
    ],
    "status": "active",
    "secret": "whsec_a1b2c3d4e5f6g7h8i9j0",
    "createdAt": "2025-01-15T15:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

API key passed as a Bearer token. Format: ld_<env>_<prefix>_<secret> where <env> is test or live.

Headers

Idempotency-Key
string

Unique key to ensure idempotent request processing. Reusing a key for a different route or method returns 409 Conflict.

Example:

"idk_a1b2c3d4-e5f6-7890-abcd-ef1234567890"

Body

application/json
url
string<uri>
required

The URL to receive webhook events. Must be HTTPS.

Example:

"https://example.com/webhooks/ledger"

events
string[]
required

List of event types to subscribe to.

Example:
["customer.created", "transaction.completed"]

Response

Webhook created successfully

ok
boolean
required

Indicates the request was successful.

data
object