LogoLogo
Log in
  • Introduction
    • Welcome
    • Quick Start
      • Sign up for a Cal.com account
      • Complete your onboarding
      • Self-hosting
        • Installation
          • Ultimate
          • Platform
            • Get access to the API
            • API submodule
        • Install apps
          • Google
          • Microsoft
          • Zoom
          • Daily
          • HubSpot
          • Stripe
          • Sendgrid
          • Twilio
        • E2E testing
        • Upgrading
        • Docker
        • Vercel
        • Database migrations
        • SSO setup
  • Core Features
    • Event types
      • Secret events
      • Location of the event
      • Availability schedule
      • Multiple durations
      • Event buffer
      • Custom time-slot intervals
      • Custom event name in the booking
      • Minimum notice
      • Booking frequency
      • Limit future bookings
      • Add events to calendar
      • Additional inputs
      • Requires confirmation
      • Hide notes in calendar
      • Require additional notes
      • Booking success URL
      • Single use private links
      • Offer seats
      • Recurring events
      • Disable guests
    • Bookings
      • Paid bookings
    • Availability
      • Multiple time slots per day
      • Date overrides
      • Multiple schedules
    • App Store
      • Apps
        • Calendar apps
        • Video apps
        • Payment apps
        • Workflow apps
        • Analytics apps
        • Web3 apps
        • Miscellaneous apps
    • Webhooks
    • Embed
      • Install with JavaScript
      • Install with React
      • Set up your embed
    • New Docs Embed
      • Adding embed to your webpage
      • Embed Snippet Generator
      • Embed events
      • Embed instructions
      • Adding slots to your email
    • Dynamic group links
    • Customization
    • i18n Internationalization
  • Enterprise Features
    • Teams
      • Team workflows
      • Round-robin scheduling
      • Collective events
      • Advanced routing forms
    • Workflows
    • API
      • Quick start
        • Testing API locally
        • Hosted API through Cal.com
      • Authentication
      • Errors
      • Rate limits
      • Versioning
      • Types
      • API reference
        • Attendees
        • Availabilities
        • Booking References
        • Bookings
        • Custom inputs
        • Destination calendars
        • Event types
        • Memberships
        • Payments
        • Schedules
        • Selected calendars
        • Teams
        • Users
        • Webhooks
    • Admin
  • Knowledgebase
    • Glossary
  • How To Guides
    • Acquire and manage a license key
    • Adding your first app
    • Creating a secret event type
    • Creating your first event type
    • How to add a location to your event type
    • How to add custom CSS
    • How to build an app
      • Build a greeter app
    • How to connect apple calendar with calcom
    • How to troubleshoot symbolic link issues on Windows
    • How to set buffer time
    • How to set up requires confirmation
    • How to set time-slot intervals
    • How to set up an event type to receive payments
    • How to test API in a local instance
    • How to use open-source scheduling infrastructure with HubSpot
    • How to white label the self hosted instance
    • Setting up your availability
      • Adding date override
    • Quick actions using command bar
Powered by GitBook
LogoLogo

Solutions

  • Individual
  • Teams
  • Ultimate
  • Platform

Follow us

  • Twitter
  • LinkedIn

Copyright 2023 Cal.com, Inc. All rights reserved.

On this page
  • Creating a webhook subscription
  • Verifying the authenticity of the received payload
  • Adding a custom payload template

Was this helpful?

  1. Core Features

Webhooks

PreviousMiscellaneous appsNextEmbed

Last updated 2 years ago

Was this helpful?

Webhooks offer a great way to automate the flow with other apps when invitees schedule, cancel or reschedule events, or when the meeting ends. The webhook subscription allows you to listen to specific trigger events, such as when a booking has been scheduled, for example. You can always listen to the webhook by providing a custom subscriber URL with your own development work. However, if you wish to trigger automations without any development work, you can use the which connects Cal.com to your apps.

Creating a webhook subscription

To create a new webhook subscription, visit /settings/developer/webhooks and proceed to enter the following details:

  1. Subscriber URL: The listener URL where the payload will be sent to, when an event trigger is triggered.

  2. Event triggers: You can decide which triggers specifically to listen to. Currently, we offer listening to Booking Cancelled, Booking Created, Booking Rescheduled and Meeting Ended.

  3. Secret: You can provide a secret key with this webhook and then on the subscriber URL when receiving a payload to confirm if the payload is authentic or adulterated. You can leave it blank, if you don't wish to secure the webhook with a secret key.

  4. Custom Payload: You have the option to you receive when a subscribed event is triggered.

Verifying the authenticity of the received payload

  1. Simply add a new secret key to your webhook and save.

  2. Wait for the webhook to be triggered (event created, cancelled, rescheduled, or meeting ended)

  3. Use the secret key to create an hmac, and update that with the webhook payload received to create an SHA256.

  4. Compare the hash received in the header of the webhook (X-Cal-Signature-256) with the one created using the secret key and the body of the payload. If they don't match, the received payload was adulterated and cannot be trusted.

Adding a custom payload template

Customizable webhooks are a great way reduce the development effort and in many cases remove the need for a developer to build an additional integration service.

An example of a custom payload template is provided here:

{
    "content": "A new event has been scheduled",
    "type": "{{type}}",
    "name": "{{title}}",
    "organizer": "{{organizer.name}}",
    "booker": "{{attendees.0.name}}"
}

where {{type}} represents the event type slug and {{title}} represents the title of the event type. Note that the variables should be added with a double parenthesis as shown above. Here’s a breakdown of the payload that you would receive via an incoming webhook, with an exhaustive list of all the supported variables provided below:

Webhook variable list

Variable
Type
Description

triggerEvent

String

The name of the trigger event [BOOKING_CREATED, BOOKING_RESHEDULED, BOOKING_CANCELLED, MEETING_ENDED]

createdAt

Datetime

The Time of the webhook

type

String

The event type slug

title

String

The event type name

startTime

Datetime

The event's start time

endTime

Datetime

The event's end time

description

String

The event's description as described in the event type settings

location

String

Location of the event

organizer

Person

The organizer of the event

attendees

Person[]

The event booker & any guests

uid

String

The UID of the booking

rescheduleUid

String

The UID for rescheduling

cancellationReason

String

Reason for cancellation

rejectionReason

String

Reason for rejection

team?.name

String

Name of the team booked

team?.members

String[]

Members of the team booked

metadata

JSON

Contains a metadata of the booking, including the meeting URL (videoCallUrl) in case of Google Meet and Cal Video

Person Structure

Variable
Type
Description

name

String

Name of the individual

email

Email

Email of the individual

timezone

String

Timezone of the individual ("America/New_York", "Asia/Kolkata", etc.)

language?.locale

String

Locale of the individual ("en", "fr", etc.)

integration with Zapier
verify it
customize the payload
Creating a webhook