v1

latestOpenAPI 3.1.02026-08-042453938.9 KB
Webhooks

Create a webhook

Create a new webhook endpoint to receive real-time event notifications. Requires a secret key (sk_).

Important: The secret is only returned once on creation. Save it immediately for HMAC signature verification. Public keys (pk_) cannot access this endpoint.

Signature verification:

const signature = crypto
  .createHmac('sha256', secret)
  .update(JSON.stringify(payload))
  .digest('hex');
// Compare with X-Drip-Signature header
post/v1/webhooks

Request body

urlstring uri required

HTTPS endpoint URL. Must be publicly accessible and return 200 OK within 30 seconds.

eventsstring[] required

Event types to subscribe to. Use ["*"] for all events.

descriptionstring

Optional description to help identify this webhook

Example request

{
  "url": "https://api.example.com/webhooks/drip",
  "events": [
    "charge.succeeded",
    "charge.failed",
    "customer.balance.low"
  ],
  "description": "Production billing notifications"
}

Response

Webhook created

idstring

Unique webhook identifier

urlstring uri

Your webhook endpoint

eventsstring[]

Subscribed event types

descriptionstring nullable

Optional description

isActiveboolean

Whether the webhook is active

secretstring

HMAC secret for signature verification. SAVE THIS - it will not be shown again!

createdAtstring date-time
updatedAtstring date-time
messagestring

Reminder to save the secret

Example response

{
  "id": "whk_abc123def456",
  "url": "https://api.example.com/webhooks/drip",
  "events": [
    "charge.succeeded",
    "charge.failed",
    "customer.balance.low"
  ],
  "description": "Production billing events",
  "isActive": true,
  "secret": "whsec_abcdef123456789...",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "message": "Save the secret - it will not be shown again!"
}