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

# Rex Booking

> Create a Rex calendar event.

## Overview

Tool name: `Rex | Book Time in Calendar | Pro`

Use this tool to create a Rex calendar event. See [Calendar Booking Overview](/tools/calendar/overview) for how availability and booking work across providers.

***

## Provider Settings

|    ID | Setting           | Type              | Required | Default                 | What it does                                                                                                     |
| ----: | ----------------- | ----------------- | -------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `160` | calendar\_id      | string            | No       | team config             | Rex calendar ID. If left blank, the tool falls back to team config.                                              |
| `161` | user\_ids         | array/tags        | No       | team config             | Rex user IDs for availability and booking. Can be entered as tags or comma-separated values.                     |
| `162` | contact\_id       | string            | Yes      | none                    | Rex contact ID to attach to the booking.                                                                         |
| `163` | title             | string            | Yes      | none                    | Appointment title for the Rex calendar event.                                                                    |
| `164` | description       | text              | No       | empty                   | Description written to the Rex event.                                                                            |
| `165` | location          | string            | No       | empty                   | Location text written to `event_location.description`.                                                           |
| `166` | duration\_minutes | integer, minutes  | No       | `30`                    | Appointment duration.                                                                                            |
| `167` | business\_days    | array             | No       | provider/config default | Business days to offer, using ISO weekday numbers where Monday is `1` and Sunday is `7`. Example: `[1,2,3,4,5]`. |
| `168` | business\_hours   | time range object | No       | provider/config default | Business hours window to offer. Example: `[0900,1730]`.                                                          |

***

## Common Settings

|  ID | Setting                               | Type    | Required | Default | What it does                                                                                            |
| --: | ------------------------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------- |
| `0` | Number of Weeks                       | integer | No       | `4`     | Weeks to check availability. Tool definition range is `1-8`.                                            |
| `1` | SMS Message                           | text    | No       | empty   | Custom SMS confirmation message. Written to `{{sms.message}}`.                                          |
| `3` | Booking Purpose                       | text    | No       | empty   | Purpose of the appointment. Written to `{{calendar.purpose}}`.                                          |
| `5` | Check Timezone Before Booking         | boolean | No       | `false` | Whether the flow verifies the user's timezone before booking. Written to `{{timezone.check_timezone}}`. |
| `6` | Send SMS Confirmation                 | boolean | No       | `true`  | Whether to send an SMS confirmation after booking. Written to `{{calendar.sms_flag}}`.                  |
| `7` | Booking Window Start Offset (Minutes) | integer | No       | `15`    | Availability starts this many minutes after call start.                                                 |

***

## Availability Behavior

Rex availability is calculated from the configured calendar, users, business days, business hours, and duration. The flow checks the user's selected time against the loaded availability, then creates a Rex event attached to the configured contact.

***

## Global Variables Written or Maintained

| Variable                            | When set                            | Meaning                                                                |
| ----------------------------------- | ----------------------------------- | ---------------------------------------------------------------------- |
| `{{calendar.purpose}}`              | Tool entry                          | Booking purpose configured on the tool.                                |
| `{{sms.message}}`                   | Tool entry                          | Custom SMS confirmation message.                                       |
| `{{timezone.check_timezone}}`       | Tool entry                          | Timezone verification flag.                                            |
| `{{calendar.sms_flag}}`             | Tool entry                          | SMS confirmation flag.                                                 |
| `{{calendar.event_id}}`             | Availability load                   | Rex calendar or integration identifier.                                |
| `{{calendar.availability_spoken}}`  | Availability check                  | Spoken availability response.                                          |
| `{{calendar.booking_time_raw}}`     | Slot validation and booking success | Exact selected slot in ISO date-time format.                           |
| `{{calendar.booking_time_spoken}}`  | Booking success                     | Spoken confirmation time.                                              |
| `{{calendar.booking_time_written}}` | Booking success                     | Written confirmation time.                                             |
| `{{calendar.booking_id}}`           | Booking success                     | Rex event ID.                                                          |
| `{{calendar.booking_link}}`         | Booking success                     | Link returned by provider logic when available. Usually empty for Rex. |

***

## Cancellation Behavior

If the user cancels during the same call, the flow uses the Rex cancellation path where supported. A successful cancellation clears the stored booking ID, booking link, and stored booking time values.

Output variable `result` is boolean `true` when the appointment was booked successfully.
