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

# Set Booking Hours and Rules from the CLI or API

> Read and change the Cal.com booking rules used by a voice widget or phone line.

# Set Booking Hours and Rules from the CLI or API

Booking rules control how far ahead someone must book, the buffers before and
after a meeting, the working hours and time zone, and meeting reminders. These
rules live on the Cal.com event type that the deployment books. Erdo keeps no
copy, so every booking surface follows the rules Cal.com holds.

If the working-hours schedule is shared with other event types, Erdo gives this
event type its own copy before changing it. The other event types keep their
hours. This page applies to Cal.com only. For Google Calendar or Calendly,
change the rules in that provider. You need organization admin access.

## CLI

Read a widget's rules by public key or name:

```bash theme={null}
erdo voice widgets booking-rules get "Lobby concierge"
```

Set weekday hours and a time zone:

```bash theme={null}
erdo voice widgets booking-rules set vw_abc \
  --hours "Mon-Fri 10:00-17:30" \
  --time-zone America/New_York
```

Read or change a phone line by its voice agent slug:

```bash theme={null}
erdo voice agents booking-rules get front-desk
erdo voice agents booking-rules set front-desk --minimum-notice 24h
```

You can repeat `--hours`. You can also set `--buffer-before`,
`--buffer-after`, and `--reminders on` or `off`. A set command prints the
rules read back from Cal.com.

## REST API

Use your API key. The widget target can be its public
key or name; the phone-line target is the agent slug.

```bash theme={null}
curl "https://api.erdo.ai/v1/voice/widgets/vw_abc/booking-rules" \
  -H "Authorization: Bearer $ERDO_API_KEY"

curl -X PUT "https://api.erdo.ai/v1/voice/agents/front-desk/booking-rules" \
  -H "Authorization: Bearer $ERDO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"minimum_notice_minutes":1440,"working_hours":{"time_zone":"America/New_York","windows":[{"days":["Monday","Tuesday","Wednesday","Thursday","Friday"],"start_time":"10:00","end_time":"17:30"}]},"meeting_reminders":true}'
```

The REST response contains the deployment, provider, event type, and the rules
Cal.com currently holds. Omitted fields in a `PUT` stay unchanged, and working
hours sent without a `time_zone` keep the zone they are in today.

## MCP

The MCP tools are `erdo_get_voice_booking_rules` and
`erdo_set_voice_booking_rules`.

## If it refuses

* `404`: no widget or phone line by that name in your organization.
* `403`: your account can't change this organization's voice settings.
* `400` with code `invalid_argument`: a value is wrong, and the message says
  which.
* `400` with code `failed_precondition`: the deployment has no Cal.com event
  type yet, its calendar is Google Calendar or Calendly (change the rules
  there), the calendar needs reconnecting, or the phone line books through a
  website widget that shares its agent. The message names that widget; use its
  booking rules instead.

A widget whose own booking is off but whose phone line books shows the line's
rules, with `deployment.books_through_agent` set to the line's slug.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.