Webhook map
bookingsbookingCancelled(bookings.bookingCancelled)bookingCreated(bookings.bookingCreated)bookingRescheduled(bookings.bookingRescheduled)meetingEnded(bookings.meetingEnded)
systemping(system.ping)
HTTP handler 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;
}
Events
Bookings
Booking Cancelled
bookings.bookingCancelled
A booking was cancelled
Payload
| Name | Type | Required | Description |
|---|---|---|---|
triggerEvent | BOOKING_CANCELLED | Yes | — |
createdAt | string | Yes | — |
payload | object | Yes | — |
payload full type
payload full type
{
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
Response data full type
Response data full type
{
triggerEvent: BOOKING_CANCELLED,
createdAt: string,
payload: {
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
}
webhookHooks example
cal({
webhookHooks: {
bookings: {
bookingCancelled: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Booking Created
bookings.bookingCreated
A new booking was created
Payload
| Name | Type | Required | Description |
|---|---|---|---|
triggerEvent | BOOKING_CREATED | Yes | — |
createdAt | string | Yes | — |
payload | object | Yes | — |
payload full type
payload full type
{
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
Response data full type
Response data full type
{
triggerEvent: BOOKING_CREATED,
createdAt: string,
payload: {
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
}
webhookHooks example
cal({
webhookHooks: {
bookings: {
bookingCreated: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Booking Rescheduled
bookings.bookingRescheduled
A booking was rescheduled
Payload
| Name | Type | Required | Description |
|---|---|---|---|
triggerEvent | BOOKING_RESCHEDULED | Yes | — |
createdAt | string | Yes | — |
payload | object | Yes | — |
payload full type
payload full type
{
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
Response data full type
Response data full type
{
triggerEvent: BOOKING_RESCHEDULED,
createdAt: string,
payload: {
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
}
webhookHooks example
cal({
webhookHooks: {
bookings: {
bookingRescheduled: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
Meeting Ended
bookings.meetingEnded
A meeting ended
Payload
| Name | Type | Required | Description |
|---|---|---|---|
triggerEvent | MEETING_ENDED | Yes | — |
createdAt | string | Yes | — |
payload | object | Yes | — |
payload full type
payload full type
{
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
Response data full type
Response data full type
{
triggerEvent: MEETING_ENDED,
createdAt: string,
payload: {
bookingId?: number,
uid: string,
title?: string,
description?: string | null,
status?: string,
startTime?: string,
endTime?: string,
length?: number,
eventTypeId?: number,
meetingUrl?: string | null,
location?: string | null,
cancellationReason?: string | null,
reschedulingReason?: string | null,
rescheduledFromUid?: string | null,
attendees?: {
name: string,
email: string,
timeZone?: string,
language?: {
},
absent?: boolean
}[],
hosts?: {
id: number,
name: string,
email?: string,
username?: string,
timeZone?: string
}[],
metadata?: {
} | null
}
}
webhookHooks example
cal({
webhookHooks: {
bookings: {
meetingEnded: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})
System
Ping
system.ping
Ping test to verify webhook endpoint
Payload
| Name | Type | Required | Description |
|---|---|---|---|
triggerEvent | PING | Yes | — |
createdAt | string | No | — |
payload | object | No | — |
payload full type
payload full type
{
}
Response data full type
Response data full type
{
triggerEvent: PING,
createdAt?: string,
payload?: {
}
}
webhookHooks example
cal({
webhookHooks: {
system: {
ping: {
before(ctx, args) {
return { ctx, args };
},
after(ctx, response) {
},
},
},
},
})