BOOKING_CREATED, BOOKING_CANCELLED) via HTTP POST to a subscriber URL you register through their API.
How it works
- You call the Cal.com webhooks API to register a subscription, passing your Nango webhook URL and a
payloadTemplatethat embeds the Nango connection ID as a static field. - When an event occurs, Cal.com sends a signed POST request to Nango with an
x-cal-signature-256header. - Nango verifies the signature and resolves
nangoConnectionId— first from the?nangoConnectionId=query parameter on the webhook URL, then from thenangoConnectionIdfield in the payload body. - Nango routes the event to that connection’s webhook script and forwards the full payload to your app.
Setup
1. Get your webhook URL and set a webhook secret
Copy the webhook URL from your Cal.com (OAuth) integration page in the Nango dashboard, under the Webhook URL section. This is the HTTPS URL you will pass assubscriberUrl when creating a webhook subscription.
Generate a random secret string and paste it into the Webhook Secret field on the same page. Nango will use this secret — shared across all connections for this integration — to verify the x-cal-signature-256 signature on every incoming Cal.com event.
2. Register the webhook subscription
Create a webhook subscription for each new Cal.com connection. You can automate this with a post-connection-creation script:- <NANGO-SECRET-KEY> — your Nango secret key
- <ORG-ID> — your Cal.com organization ID
- <CONNECTION-ID> — the Nango connection ID for this Cal.com account
- <REPLACE_WITH_NANGO_WEBHOOK_URL> — your Nango webhook URL from the dashboard (step 1)
- <YOUR-WEBHOOK-SECRET> — the webhook secret configured on your Cal.com (OAuth) integration in Nango
There are two ways to pass
nangoConnectionId to Nango:- Query parameter: append
?nangoConnectionId=<CONNECTION-ID>to the Nango webhook URL you register assubscriberUrl. This avoids embedding the ID in the payload template entirely. - Payload body (fallback): include a
"nangoConnectionId":"<CONNECTION-ID>"field in thepayloadTemplate, as shown above.
3. Remove the webhook on connection deletion
If a connection is deleted in Nango but the Cal.com subscription remains active, Cal.com will continue sending events until the subscription is removed. To clean up immediately, call the Cal.com delete webhook endpoint in apre-connection-deletion script using the webhook ID stored in step 2: