> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Cancel booking

> Cancels one TidyCal booking.

`tidyCal.cancelBooking` cancels a booking and can record a reason.

```ts automations/cancel-tidycal-booking.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { tidyCal } from "automate.ax/tidycal"

export default automation("Cancel TidyCal booking", () => {
  onDashboardRun({ title: "Cancel TidyCal booking" })
  tidyCal.cancelBooking({
    bookingId: 123,
    reason: "Client requested a different time",
  })
})
```

`reason` is optional. The action returns the cancelled booking. TidyCal rejects an already-cancelled booking, so do not use this action as an idempotent state setter.
