Setting Up Webhooks
Webhooks let AskBiz send real-time event notifications to any URL — your own server, a serverless function, or a no-code tool. Here is how to set them up.
What webhooks are and when to use them
A webhook is an HTTP POST request that AskBiz sends to a URL you specify whenever a specific event occurs. Unlike polling (where your system repeatedly asks AskBiz 'has anything changed?'), webhooks are push-based — AskBiz contacts you the moment something happens. Use webhooks when you need real-time event delivery and you have a server or serverless function that can receive and process HTTP requests. If you do not have a developer resource, use Zapier instead — it handles the webhook reception for you.
Supported webhook events
AskBiz currently supports the following webhook events: anomaly.detected (a metric anomaly has been identified), alert.threshold_crossed (a configured metric threshold has been crossed), sync.completed (a data source sync has finished — includes source name and sync status), sync.failed (a data source sync has failed — includes error details), churn.risk_customer_identified (a customer has entered the high-risk segment), and report.generated (a scheduled report has been generated and is ready). New events are added regularly — see the API changelog for updates.
Creating a webhook endpoint
Go to Settings → API → Webhooks → Add Endpoint. Enter the HTTPS URL where AskBiz should send events (must be HTTPS — HTTP endpoints are rejected). Select the event types you want to receive. Click Save. AskBiz will send a test ping to verify the URL is reachable — your endpoint must return a 200 OK HTTP response within 5 seconds. If the ping fails, check that your server is publicly accessible and not behind a firewall or VPN that blocks external requests.
Verifying webhook signatures
Each webhook request includes an X-AskBiz-Signature header containing an HMAC-SHA256 signature of the request body, signed with your webhook secret (found in Settings → API → Webhooks). Always verify this signature before processing the event — it ensures the request genuinely came from AskBiz and has not been tampered with. To verify: compute HMAC-SHA256(secret, request_body) and compare it to the value in the header. If they do not match, reject the request with a 401 response. Code examples for Node.js, Python, and PHP are available in the developer documentation.
Handling failures and retries
If your endpoint returns a non-200 response or times out, AskBiz retries the webhook with exponential backoff: after 1 minute, 5 minutes, 30 minutes, 2 hours, and 8 hours. After five failed attempts, the event is marked as failed and no further retries occur. Failed events are visible in Settings → API → Webhooks → Event Log, where you can manually replay them. To avoid missed events during planned downtime, temporarily disable the webhook endpoint — AskBiz will queue events for up to 24 hours.