Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/cal-com

src/cancel-booking.js

18 lines · 858 B · JavaScript
import { cancelBooking } from './cal-com.js'

/**
 * Cancel a Cal.com booking by UID.
 * Requires `dryRun: true` to preview or `confirm: true` to write.
 * @param {Object} input
 * @param {string} input.bookingUid Booking UID to cancel (`uid` accepted as alias).
 * @param {boolean} [input.dryRun] Return the request preview without cancelling.
 * @param {boolean} [input.confirm] Required for the live write.
 * @returns {Promise<Record<string, unknown>>} Cancellation result payload or dry-run preview.
 * @example
 * import cancelBooking from 'kody:@kody/cal-com/cancel-booking'
 * const preview = await cancelBooking({ bookingUid: 'abc123', dryRun: true })
 * // => { dryRun: true, method: 'POST', path: '/v2/bookings/abc123/cancel', body: {} }
 */
export default async function cancelBookingEntrypoint(input = {}) {
	return await cancelBooking(input)
}