> ## 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.

# Create booking

> Books one or several TidyCal time slots.

`tidyCal.createBooking` books one time slot or a package of time slots.

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

export default automation("Create TidyCal booking", () => {
  onDashboardRun({ title: "Create TidyCal booking" })
  tidyCal.createBooking({
    bookingTypeId: 123,
    startsAt: "2026-08-28T18:00:00Z",
    name: "Ada Lovelace",
    email: "ada@example.com",
    timezone: "America/Los_Angeles",
    bookingQuestions: [
      { bookingTypeQuestionId: 456, answer: "Analytical engines" },
    ],
  })
})
```

Provide either `startsAt` for one booking or `bookings: [{ startsAt }]` for a package. `name`, `email`, and `timezone` are always required. A question answer can be a string or an array of strings.

The action returns one booking for a single request or an array for a package. TidyCal returns `409` when a slot is unavailable, a duplicate was submitted within five minutes, or another request held the slot lock. Check availability immediately before booking, but still handle conflicts because availability can change.
