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

# O365 Bookings

> Book an appointment in Microsoft Bookings through Microsoft Graph.

## Overview

Tool name: `O365 Bookings | Booking | Pro`

Use this tool to book an appointment in Microsoft Bookings through Microsoft Graph. 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                                                                                                                                                                                                   |
| ----: | ---------------------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `140` | MS Booking Business ID | string | Yes      | none    | Microsoft Bookings business ID. This should match the connected integration's synced `bookingBusinessId`.                                                                                                      |
| `141` | MS Service ID          | string | Yes      | none    | Microsoft Bookings service ID to book. This should exist in the integration's synced `services` list.                                                                                                          |
| `142` | MS Staff Member ID     | string | Yes      | none    | Staff selector. Use a staff member ID/email for single-staff booking, `auto` for random assignment across synced staff, or `least` to choose the candidate with the most available slots in the fetched range. |

***

## Staff Assignment Modes

Input `142` supports four modes:

| Value       | Behavior                                                                                                                                                                                                                                                                                |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Staff UUID  | Uses that exact Microsoft Bookings staff member.                                                                                                                                                                                                                                        |
| Staff email | Resolves the email to a synced staff member ID, then uses that staff member.                                                                                                                                                                                                            |
| `auto`      | Shows pooled availability across synced staff. When the user selects a slot, randomly chooses one available staff member for that slot.                                                                                                                                                 |
| `least`     | Shows pooled availability across synced staff. When the user selects a slot, chooses the available staff member who appears in the most available slots across the fetched range. This approximates least booked using availability data already loaded at call start. Ties are random. |

For `auto` and `least`, staff members come from the Microsoft Bookings integration's synced `integrations_teams.config.staffMembers` payload. The selected business and service should match the synced `bookingBusinessId` and `services`.

***

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

Single-staff mode fetches availability for the configured staff member only.

`auto` and `least` fetch availability for synced eligible staff members and merge the results into one public list of slots. A public slot is shown only when at least one staff member is available. Internally, the tool keeps a hidden slot-to-staff map so the final booking can be created with one concrete `staffMemberIds` value.

***

## 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                   | O365 business/service/staff 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                     | Microsoft Bookings appointment ID.                      |
| `{{calendar.booking_link}}`         | Booking success                     | Online meeting or join link when Microsoft returns one. |

O365 also maintains selected staff details in calendar state after auto-assignment: booking staff ID, display name, and email. These are primarily for reporting/debugging unless surfaced by a script.

***

## Cancellation Behavior

If the user cancels during the same call, the flow uses the Microsoft Bookings 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 booking flow completed successfully.
