POST to that URL whenever the event occurs.
Subscribe to an event
Discover available events
Call
GET /events to list the event
types you can subscribe to.Create a subscription
Call
POST /events/subscription
with the event_name and your callback_url. The response includes a
secret — store it to verify future deliveries.Secret generation
Karat generates a unique signing secret when you create a subscription. The secret is returned only once in the create subscription response — store it securely so you can verify deliveries.Handshake verification
When creating a subscription, the API verifies ownership of the callback URL by performing a challenge-response handshake. Your server must handle this before the subscription is accepted. The API sends aPOST request to your callback_url with a JSON body:
200 and a JSON
body echoing the challenge:
400 error with one of these messages:
| Message | Cause |
|---|---|
Callback URL verification failed: could not reach the URL | The URL was unreachable, timed out, or the connection was refused |
Callback URL verification failed: received status {code} | Your server responded with a non-2xx status code |
Callback URL verification failed: invalid JSON response | The response body was not valid JSON |
Callback URL verification failed: challenge mismatch | The challenge value in the response did not match the one sent |
Event types
| Event | When it fires |
|---|---|
payout.updated | A payout’s status changes |
tax_form.created | A recipient completes a tax form |
Payload
Every delivery shares the same envelope —id, event, created_at,
subscription_id, and an event-specific data object.
payout.updated
tax_form.created
Verify webhook signatures
Every delivery is signed so you can confirm it came from Karat. Verify the signature before processing the payload. Each request includes these headers:| Header | Description |
|---|---|
X-Karat-Signature | The signature, in the format v1=<base64>. |
X-Karat-Webhook-Timestamp | Unix epoch seconds when the event was sent. |
X-Karat-Subscription-Id | The subscription the event belongs to — use it to look up the right secret. |
X-Karat-Webhook-Id | Unique delivery ID, for deduplication. |
timestamp + "." + raw_body, keyed with
your subscription secret, then base64-encoded:
Look up the secret
Use
X-Karat-Subscription-Id to find the secret you stored when creating
the subscription.Check the timestamp
Reject deliveries where
X-Karat-Webhook-Timestamp is outside a ±300 second
window to protect against replays.Recompute and compare
Recompute the signature from the raw request body and compare it to the
value in
X-Karat-Signature using a constant-time comparison.Delivery
- Deliveries are sent asynchronously and retried on failure.
- Always return a
2xxresponse quickly; do heavy processing out of band.
Manage subscriptions
- List your subscriptions with
GET /events/subscription. - Remove one with
DELETE /events/subscription/{subscription_id}.