Affinity Design
Agency Guide

Webhook Configuration

Configure incoming webhooks for post-call events, scheduling, Stripe, and platform integrations

Overview

The platform receives incoming webhooks from several external services to keep data in sync and trigger automated workflows. This page covers the available webhook endpoints, how to configure them, and security considerations.

Webhook Endpoints

EndpointSourcePurpose
/webhooks/elevenlabsElevenLabsPost-call events, transcript updates, recording status
/webhooks/cal-comCal.comBooking confirmations, cancellations, reschedules
/webhooks/stripeStripePayment events, invoice status, subscription changes
/webhooks/ghlGoHighLevelContact updates, pipeline changes
/webhooks/meta-leadgenMetaLead form submissions from Facebook/Instagram ads
/webhooks/recording-statusTwilioCall recording completion and availability
/integrations/cloudflare/pages-webhookCloudflarePages deployment success/failure notifications
/debug/client-reportClient Debug ReporterClient-submitted bug reports with screenshots, browser events, and metadata
/debug/screenshots/:tokenClient Debug ReporterServe compressed page screenshots (read-only, token-gated)

ElevenLabs Webhook

Receives post-call events from the voice AI platform:

  1. Configure the webhook URL in your ElevenLabs agent settings
  2. Set the callback URL to: https://YOUR_API_HOST/webhooks/elevenlabs
  3. The platform processes call outcomes, transcripts, and recording URLs

ElevenLabs webhooks may include sensitive call data. Ensure the endpoint is only accessible over HTTPS.

Cal.com Webhook

Syncs booking events with the platform:

  1. In Cal.com, go to Developer → Webhooks
  2. Add the endpoint: https://YOUR_API_HOST/webhooks/cal-com
  3. Subscribe to: BOOKING_CREATED, BOOKING_CANCELLED, BOOKING_RESCHEDULED
  4. Set the webhook secret for signature verification

The platform uses booking webhooks to:

  • Track booked appointments as conversions
  • Associate bookings with the originating call or campaign
  • Update agent metrics and conversion rates

Stripe Webhook

Essential for billing operations. See Billing Setup for the full configuration guide.

Key events to subscribe to:

  • invoice.created, invoice.finalized, invoice.paid, invoice.payment_failed
  • charge.succeeded, charge.refunded
  • customer.subscription.created, customer.subscription.updated, customer.subscription.deleted
  • product.created, price.created (for catalog sync)
# Webhook signing secret
STRIPE_WEBHOOK_SECRET=whsec_...

Meta Lead Gen Webhook

Receives lead form submissions from Meta Ads:

  1. Set META_WEBHOOK_VERIFY_TOKEN to a random value you control
  2. In the Meta app webhook settings, set the callback URL to:
https://YOUR_API_HOST/webhooks/meta-leadgen
  1. Subscribe the app to Page leadgen events
  2. In the admin, use Leads → Subscribe to activate lead form subscriptions for each Page

Production webhook POSTs require x-hub-signature-256 signed with META_WEBHOOK_APP_SECRET. Unsigned webhooks are only accepted in local development when no webhook app secret is configured.

GoHighLevel Webhook

Receives contact and pipeline updates from GHL:

  1. In GHL, configure the webhook in Settings → Integrations → Webhooks
  2. Point to: https://YOUR_API_HOST/webhooks/ghl
  3. The platform processes contact updates and syncs them with client records

Cloudflare Pages Webhook

Records deployment success/failure for bound websites:

CLOUDFLARE_PAGES_WEBHOOK_SECRET=your_shared_secret

Send the secret in one of these headers:

  • Authorization: Bearer <SECRET>
  • x-affinity-webhook-secret: <SECRET>
  • x-cloudflare-webhook-secret: <SECRET>

Security

All webhook endpoints implement verification:

WebhookVerification Method
StripeStripe-Signature header with HMAC
Metax-hub-signature-256 with app secret
Cal.comWebhook secret signature
ElevenLabsAPI key or signature header
CloudflareShared secret via header

Never disable webhook verification in production. Always use HTTPS endpoints and keep webhook secrets out of version control.

Troubleshooting

IssueResolution
Webhook returns 401Signature verification failed — check the webhook secret
Webhook returns 403Verify token doesn't match (Meta)
Events not processingCheck that the webhook is subscribed to the correct events
Duplicate processingEnsure the same webhook isn't registered multiple times
Stripe events delayedCheck Stripe Dashboard for delivery status and retry logs

On this page