Corsair
PluginsCal.com

Cal.com Webhooks

All available Cal.com webhook events

The Cal plugin includes webhook handlers for Cal.com booking lifecycle events.

New to Corsair? Learn about webhooks and hooks.

Full Implementation: See the Cal plugin source code.

Setup

app/api/webhook/route.ts
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();

    const result = await processWebhook(corsair, headers, body);
    return result.response;
}

Cal.com webhooks are identified by the x-cal-signature-256 header.

Available Webhooks

bookings.bookingCreated

Fires when a new booking is created.

Example:

corsair.ts
cal({
    webhookHooks: {
        "bookings.bookingCreated": async (event) => {
            console.log("New booking:", event.uid);
            // Send confirmation email, add to calendar, etc.
        },
    },
})

Key fields: uid, title, startTime, endTime, attendees, organizer, eventType, status


bookings.bookingCancelled

Fires when a booking is cancelled.

Example:

corsair.ts
cal({
    webhookHooks: {
        "bookings.bookingCancelled": async (event) => {
            console.log("Booking cancelled:", event.uid);
            // Send cancellation notification, free up resources, etc.
        },
    },
})

Key fields: uid, title, startTime, endTime, cancellationReason, organizer, attendees


bookings.bookingRescheduled

Fires when a booking is rescheduled to a new time.

Example:

corsair.ts
cal({
    webhookHooks: {
        "bookings.bookingRescheduled": async (event) => {
            console.log("Booking rescheduled:", event.uid);
            console.log("New time:", event.startTime);
        },
    },
})

Key fields: uid, title, startTime, endTime, rescheduleReason, organizer, attendees


bookings.meetingEnded

Fires when a meeting ends.

Example:

corsair.ts
cal({
    webhookHooks: {
        "bookings.meetingEnded": async (event) => {
            console.log("Meeting ended:", event.uid);
            // Log meeting duration, trigger follow-up, etc.
        },
    },
})

Key fields: uid, title, startTime, endTime, organizer, attendees


system.ping

Fires as a test to verify your webhook endpoint is reachable.

Example:

corsair.ts
cal({
    webhookHooks: {
        "system.ping": async (event) => {
            console.log("Webhook ping received");
        },
    },
})