import type { NextApiRequest } from "next"; import handleCancelBooking from "@calcom/features/bookings/lib/handleCancelBooking"; import { defaultResponder } from "@calcom/lib/server"; import { schemaBookingCancelParams } from "@calcom/prisma/zod-utils"; import { schemaQueryIdParseInt } from "~/lib/validations/shared/queryIdTransformParseInt"; /** * @swagger * /bookings/{id}/cancel: * delete: * summary: Booking cancellation * operationId: cancelBookingById * * parameters: * - in: path * name: id * schema: * type: integer * required: true * description: ID of the booking to cancel * - in: query * name: apiKey * required: true * schema: * type: string * description: Your API key * - in: query * name: allRemainingBookings * required: false * schema: * type: boolean * description: Delete all remaining bookings * - in: query * name: reason * required: false * schema: * type: string * description: The reason for cancellation of the booking * tags: * - bookings * responses: * 200: * description: OK, booking cancelled successfully * 400: * description: | * Bad request *
Message | *Cause | *
Booking not found | *The provided id didn't correspond to any existing booking. | *
Cannot cancel past events | *The provided id matched an existing booking with a past startDate. | *
User not found | *The userId did not matched an existing user. | *