Skip to main content
POST
/
v1
/
webhook_endpoints
Create a WebhookEndpoint
curl --request POST \
  --url https://api.leanrails.com/v1/webhook_endpoints \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --data '
{
  "url": "<string>",
  "enabled_events": [
    "<string>"
  ],
  "description": "<string>"
}
'
{
  "id": "we_xxx",
  "object": "webhook_endpoint",
  "url": "https://example.com/webhook",
  "enabled_events": [
    "payment_intent.succeeded"
  ],
  "status": "enabled",
  "created": 1234567890,
  "livemode": false,
  "merchant_id": "mer_xxx",
  "secret": "whsec_xxx",
  "description": "<string>"
}

Authorizations

Authorization
string
header
required

Use your secret API key as the username with an empty password.

Headers

Idempotency-Key
string
required

Unique key to ensure idempotent requests.

Maximum string length: 255
X-API-Version
string

Override the API version for this request.

Body

application/json
url
string<uri>
required

The URL to receive webhook events.

enabled_events
string[]
required

The list of event types to subscribe to.

Minimum array length: 1
description
string

Response

The created WebhookEndpoint (includes the secret in plaintext).

id
string
required
Example:

"we_xxx"

object
enum<string>
required
Available options:
webhook_endpoint
url
string<uri>
required
Example:

"https://example.com/webhook"

enabled_events
string[]
required
Example:
["payment_intent.succeeded"]
status
enum<string>
required
Available options:
enabled,
disabled
created
integer
required
Example:

1234567890

livemode
boolean
required
Example:

false

merchant_id
string
Example:

"mer_xxx"

secret
string

The signing secret. Only returned in full on creation; masked on retrieval.

Example:

"whsec_xxx"

description
string | null