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

# Update event type availability schedule

> Replace a Calendly event type's host availability rules.

`calendly.updateEventTypeAvailabilitySchedule` replaces the host availability rules used by an event type.

```ts automations/update-calendly-event-availability.automation.ts theme={null}
import { automation, onDashboardRun, sendEmail } from "automate.ax"
import { calendly } from "automate.ax/calendly"

export default automation("Update Calendly event availability", () => {
  onDashboardRun({ title: "Update event availability" })
  const schedule = calendly.updateEventTypeAvailabilitySchedule({
    eventType: "https://api.calendly.com/event_types/event-type-id",
    availabilityRule: {
      timezone: "America/Los_Angeles",
      rules: [
        {
          type: "wday",
          wday: "monday",
          intervals: [{ from: "09:00", to: "17:00" }],
        },
      ],
    },
  })
  sendEmail({ subject: "Availability updated", text: schedule.eventType })
})
```

Pass the complete event type URI and an `availabilityRule` with a timezone. `availabilitySetting` defaults to Calendly's `host` setting. The supplied rules replace the current rules.
