Documentation Index
Fetch the complete documentation index at: https://docs.brale.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart: receive your first webhook
1. Create an HTTPS webhook endpoint
Create a route in your application that can receive Brale webhook deliveries. Example endpoint:2. Get an access token with webhook scopes
Your OAuth application or API credential needs webhook scopes (these are provisioned by default when you make a credential set).| Scope | Required for |
|---|---|
webhooks:read | List event types, list subscriptions, inspect delivery logs |
webhooks:write | Create, update, and archive webhook subscriptions |
webhooks:read and webhooks:write.
3. Discover available event types
4. Create a webhook subscription
Create a subscription for your endpoint and event types.sharedSecretis returned only once.- Store it immediately in a secrets manager or encrypted environment variable.
- Do not log it.
- Do not expose it to browsers or client-side code.
- If you lose it, archive the subscription and create a new one.
5. Verify incoming webhooks
Every webhook includes:- Header names may appear with different capitalization depending on your framework/server. Treat them as case-insensitive.
- The
Idempotency-Keyyou send to the management API is not the same concept as theidempotency-keyheader Brale sends with each webhook delivery. Use the webhook eventidand/or the webhookidempotency-keyheader for deduplication.
- Read the exact raw request body bytes.
- Decode
sharedSecretfrom Base64URL to raw bytes. - Compute HMAC-SHA256 over the raw request body.
- Encode the digest as lowercase hex.
- Compare to
x-request-signature-sha-256using constant-time comparison. - Only then parse and process the JSON payload.
6. Return 2xx quickly
Return any2xx response after verification and safe receipt.
If processing takes longer, acknowledge quickly and process asynchronously.
7. Deduplicate events
Webhook deliveries are at-least-once. Your endpoint may receive the same event more than once. Deduplicate using:- The envelope
id - The
idempotency-keyheader