Webhooks
Webhooks let you receive HTTP POST notifications when events occur in your Heffl workspace. Instead of polling the API, your server gets notified in real time when leads are created, deals change stage, invoices are paid, and more.Setup
- Go to Settings > Developer in your Heffl workspace
- Click Add Webhook Endpoint
- Enter your endpoint URL (must be HTTPS in production)
- Select the events you want to subscribe to
- Save — you’ll receive a signing secret starting with
whsec_
API endpoints
POST /webhookscreates a webhook subscription and returns the one-time signingsecretGET /webhookslists subscriptions with cursor paginationGET /webhooks/{id}returns a single subscriptionDELETE /webhooks/{id}deletes a subscription
Payload format
Every webhook delivery sends a JSON POST request with this structure:Request headers
Every webhook request includes these headers:Verifying signatures
Every webhook is signed using HMAC-SHA256 following the Standard Webhooks specification. Always verify signatures to ensure the request came from Heffl.How it works
- The signed content is:
{webhook-id}.{webhook-timestamp}.{request-body} - The signature is computed using HMAC-SHA256 with your signing secret
- The signature header format is:
v1,{base64-encoded-signature}
Node.js verification example
Python verification example
Retry policy
If your endpoint fails to respond with a2xx status within 20 seconds, Heffl retries delivery with exponential backoff:
After 10 failed attempts, the delivery is marked as permanently failed.
Retry behavior by status code
Best practices
- Respond quickly. Return a
200status immediately and process the event asynchronously. The delivery timeout is 20 seconds. - Use idempotency. The
webhook-idheader is unique per delivery. Store it to detect and skip duplicate deliveries. - Verify signatures. Always validate the
webhook-signatureheader to ensure the request is authentic. - Check timestamps. Reject requests with timestamps older than 5 minutes to prevent replay attacks.
- Use HTTPS. Always use HTTPS endpoints in production. HTTP endpoints will generate warnings.
- Handle gracefully. If you receive an event type you don’t recognize, return
200and ignore it — new events may be added.
Secret rotation
Heffl supports rotating webhook secrets without downtime. During rotation, signatures are generated with both the old and new secrets (space-separated in thewebhook-signature header). Your verification code should check if any of the signatures is valid.