openapi: 3.0.0
info:
title: LeanData BookIt ποΈ Availability ποΈ Availability ποΈ Availability API
description: Programmatic scheduling, availability lookup, and meeting management for the LeanData BookIt scheduling product. Power custom UIs with server-to-server access to availability, round-robin, and meeting CRUD.
version: 1.0.0
servers:
- url: https://api.leandata.com
tags:
- name: ποΈ Availability
description: '<p>The availability endpoints return meeting configuration and open time slots used to render booking pages or refresh availability. Depending on the request context (routing, direct link, or reschedule), the response includes meeting details, eligible hosts, and available time windows.</p>
<ul>
<li><p><strong>POST</strong> <code>/v1/scheduling/route-and-fetch-availability</code></p>
</li>
<li><p><strong>POST</strong> <code>/v1/scheduling/fetch-availability</code></p>
</li>
</ul>
'
paths:
/v1/scheduling/route-and-fetch-availability:
post:
tags:
- ποΈ Availability
summary: v1/scheduling/route-and-fetch-availability
description: '<p>Use this endpoint when you want LeanData BookIt to determine the correct routing outcome (who/what should be booked) and return the current availability of determined host.</p>
<p><strong>Common use cases:</strong></p>
<ul>
<li><p>First-time booking when routing is required</p>
</li>
<li><p>Agentic flows that need to decide <em>who</em> to book and <em>when</em></p>
</li>
<li><p>Generating a <code>token</code> that can be reused to refresh availability without re-running routing</p>
</li>
</ul>
<p><strong>Notes:</strong></p>
<ul>
<li>The response may include a <code>token</code> that can be passed to <strong>POST</strong> <code>/v1/scheduling/fetch-availability</code> to refetch availability without triggering routing again.</li>
</ul>
<hr />
<h2 id="π-pre-routing-requirements">π Pre-Routing Requirements</h2>
<p>Before sending form data to the BookIt API, ensure the following requirements are met:</p>
<h3 id="unique-bookit-log-id">Unique BookIt Log ID</h3>
<ul>
<li><p><strong>Requirement:</strong></p>
<ul>
<li>Each submission must have a unique BookIt Log ID. This Log ID must also be populated on the prospect''s Salesforce record.</li>
</ul>
</li>
<li><p><strong>Specifications</strong>:</p>
<ul>
<li><p><strong>Format</strong>: Universally Unique Identifier (UUID)</p>
</li>
<li><p><strong>Example</strong>: <code>c149cd78-377c-4549-ae62-3910ebe3b6ed</code></p>
</li>
<li><p><strong>Generation</strong>: Can be arbitrarily created by your system</p>
</li>
<li><p><strong>Integration</strong>: Must be populated on the prospect''s Salesforce record through your marketing automation platform, preferably simultaenously as your first BookIt API callout.</p>
<ul>
<li><p>βοΈ <strong>Note:</strong> if a prospect submits multiple times, each subsequent Log ID must replace the previous ID in Salesforce.</p>
</li>
<li><p>βοΈ<strong>If you are using Marketo as your Marketing Automation, please reach out to your LeanData team.</strong></p>
</li>
</ul>
</li>
</ul>
</li>
<li><p><strong>Best Practices</strong>:</p>
<ul>
<li><p>Use a reliable UUID generation method to ensure uniqueness</p>
</li>
<li><p>Validate the ID format before submission</p>
</li>
</ul>
</li>
</ul>
<hr />
<h2 id="request-body-parameters">Request Body Parameters</h2>
<ul>
<li><p><code>triggerNode</code> (required) β A <strong>string</strong> value that contains the name of your Trigger Node in the BookIt Flowbuilder. This value must exactly match the configured Trigger Node name in the LeanData application.</p>
<ul>
<li>β οΈ <strong>Note:</strong> Routing Links Trigger Nodes are <strong>not</strong> supported.</li>
</ul>
</li>
<li><p><code>uid</code> (required) β A <strong>string</strong> value that contains your <a href="https://bookit-api.leandata.com/#37d94fab-525c-42e3-bdb2-6cf656f8d7f0">BookIt Unique Log ID</a>.</p>
</li>
<li><p><code>prospect</code> (required) β An <strong>object</strong> that contains all prospect data required for routing and availability retrieval.</p>
<ul>
<li><p>β οΈ <strong>Important:</strong> The fields included inside the <code>prospect</code> object must <strong>exactly match</strong> the input field definitions returned by the <code>/v1/scheduling/retrieve-inputs</code> endpoint.</p>
</li>
<li><p>Field names are <strong>case-sensitive</strong> and must be passed exactly as returned in the <code>inputs[].name</code> response.</p>
</li>
<li><p>Field values must match the corresponding <code>inputs[].type</code> response.</p>
</li>
<li><p>Missing required fields may result in routing failure or incomplete availability results.</p>
</li>
</ul>
</li>
</ul>
<hr />
<h2 id="response-body-parameters">Response Body Parameters</h2>
<p>βοΈ<strong>Availability</strong> <strong>data is returned only when</strong> <strong><code>routing.responseType = "calendar"</code>****.</strong><br />If <code>responseType</code> is <code>"redirect"</code> or <code>"none"</code>, the <code>scheduling</code> object will be <code>null</code>, and no availability data will be returned. Always check <code>routing.responseType</code> before accessing scheduling data.</p>
<ul>
<li><p><code>routing</code> β An <strong>object</strong> that contains the routing outcome determined by the BookIt routing graph.</p>
<ul>
<li><p><code>responseType</code> β A <strong>string</strong> that indicates the routing outcome determined by the BookIt routing graph. Possible values are:</p>
<ul>
<li><p><code>"calendar"</code> β The routing graph reached a <strong>"Schedule"</strong> node. Encrypted scheduling parameters are returned in the <code>token</code> field.</p>
</li>
<li><p><code>"redirect"</code> β The routing graph reached a <strong>"Redirect to URL"</strong> node. A redirect URL is returned in the <code>redirect</code> field.</p>
</li>
<li><p><code>"none"</code> β The routing graph reached an <strong>"End of Flow"</strong> node. No scheduling or redirect data is returned. This can be used to trigger a fallback experience in your UI.</p>
</li>
</ul>
</li>
<li><p><code>token</code> <em>(optional)</em> β A <strong>string</strong> value that is used to refresh availability without re-running routing.</p>
<ul>
<li>Only present when <code>routing.responseType</code> is <code>"calendar"</code>.</li>
</ul>
</li>
<li><p><code>calendarLink</code> (<em>optional</em>) β A <strong>string</strong> containing the URL that renders the hosted LeanData BookIt scheduling page. Use this link if you prefer to leverage LeanDataβs native scheduling UI instead of building a custom booking experience using the <code>scheduling</code> object. Redirecting a user to this URL will load the full BookIt calendar experience.</p>
<ul>
<li>Only present when <code>routing.responseType</code> is <code>"calendar"</code>.</li>
</ul>
</li>
<li><p><code>redirect</code> <em>(optional)</em> β A <strong>string</strong> containing the URL configured in the <strong>"Redirect to URL"</strong> node of the BookIt routing graph.</p>
<ul>
<li><p>Only present when <code>responseType</code> is <code>"redirect"</code>.</p>
</li>
<li><p>Redirect users to this URL to continue the scheduling process as defined by your routing configuration.</p>
</li>
</ul>
</li>
</ul>
</li>
<li><p><code>scheduling</code> (<em>optional</em>) β An <strong>object</strong> (or <strong>null</strong>) that contains the full scheduling page configuration and availability data required to render a booking experience.</p>
<ul>
<li><p>Present only when <code>routing.responseType = "calendar"</code>.</p>
</li>
<li><p>Returns <code>null</code> when <code>responseType</code> is <code>"redirect"</code> or <code>"none"</code>.</p>
</li>
<li><p>β οΈ <strong>Note:</strong> All data in the <code>scheduling</code> object is sourced directly from the <strong>Meeting Type configuration</strong> in the LeanData application (and related LeanData configuration). Any updates or changes to this information must be made in LeanData. This data cannot be modified through the API.</p>
</li>
<li><p><code>meeting</code> β An <strong>object</strong> that contains metadata about the meeting type.</p>
<ul>
<li><p><code>name</code> β A <strong>string</strong> that contains the name of the meeting type.</p>
</li>
<li><p><code>duration</code> β An <strong>object</strong> that describes the meeting duration.</p>
<ul>
<li><p><code>unit</code> β A <strong>string</strong> that represents the time unit (e.g., <code>min</code>).</p>
</li>
<li><p><code>value</code> β A <strong>number</strong> that represents the duration value.</p>
</li>
</ul>
</li>
<li><p><code>formFields</code> β An <strong>array</strong> of form field objects that represent the input fields required to finalize the booking of the meeting. These form fields should appear on the final confirmation screen before the meeting is booked.</p>
<ul>
<li><p>β οΈ <strong>Important:</strong> You must send back values for <strong>all defined fields</strong> when booking a meeting.</p>
</li>
<li><p><code>name</code> β A <strong>string</strong> of the Field label.</p>
</li>
<li><p><code>type</code> β A <strong>string</strong> that represents the input type (e.g., <code>text</code>)</p>
</li>
<li><p><code>required</code> β A <strong>boolean</strong> that signifies whether a field is mandatory. This value is based on the settings defined in the Meeting Type configuration.</p>
</li>
</ul>
</li>
<li><p><code>description</code> β A <strong>string</strong> that contains the calendar event description</p>
</li>
<li><p><code>pageStyle</code> β An <strong>object</strong> that defines branding settings for the scheduling page. This is set in the LeanData application.</p>
<ul>
<li><p><code>styleColor</code> β A <strong>string</strong> representing the primary hex color code used to theme UI elements (e.g. buttons, highlights) on the scheduling page.</p>
</li>
<li><p><code>logo</code> β A <strong>string</strong> representing the URL of the company logo (uploaded in the LeanData application) to be displayed on the scheduling page. If empty, no logo was uploaded to the application.</p>
</li>
</ul>
</li>
</ul>
</li>
<li><p><code>pageInfo</code> β An <strong>object</strong> that contains general page metadata.</p>
<ul>
<li><p><code>displayAllPoolAvailability</code> β A <strong>boolean/null</strong> that indicates to show all availability for all pool members. If this value is <code>true</code>, then you will need to use the <code>/v1/round-robin-meeting</code> endpoint to book the meeting.</p>
</li>
<li><p><code>userIds</code> β An <strong>array</strong> that contains user IDs involved in the meeting (hosts or pool members). This array can be used to display representative names on the scheduling calendar.</p>
<ul>
<li><strong>Note:</strong> If the array is <strong>empty</strong>, it indicates that the meeting is being scheduled with a round robin pool, and the final rep has not yet been selected. The actual rep will be determined later based on the selected time slot, availability, and pool assignment logic.</li>
</ul>
</li>
<li><p><code>prefillFields</code> β An <strong>object</strong> that contains form submission data for the prospect, specifically their <code>"First Name"</code>, <code>"Last Name"</code>, and <code>"Email"</code>. These values can be used to pre-populate the prospect''s information before finalizing the meeting booking.</p>
<ul>
<li><strong>Note</strong>: to receive these pre-populated values, your Trigger Node form fields must be mapped to our default First Name, Last Name, Email variables.</li>
</ul>
</li>
</ul>
</li>
<li><p><code>availability</code> β An <strong>object</strong> that contains available time slots and a mapping of user indices to user IDs.</p>
<ul>
<li><p>βοΈ<strong>Note:</strong> If this object is empty, then this is an indicator that either the meeting type expired or there are no availability in the pool (e.g. all members are on vacations). In this scenario, please revert to your fallback experience.</p>
</li>
<li><p><code>indexToUserIdMap</code> β An <strong>object</strong> that maps numeric indices (used in <code>timeSlots.users</code>) to user IDs from the <code>userIdToInfoMap</code> object.</p>
</li>
<li><p><code>timeSlots</code> β An <strong>array</strong> of time slot objects that represent available meeting windows. You can use this data to render available times on your scheduling UI.</p>
<ul>
<li><p><code>start_time</code> β A <strong>number</strong> that represents the start time in Unix epoch milliseconds.</p>
</li>
<li><p><code>end_time</code> β A <strong>number</strong> that represents the end time in Unix epoch milliseconds.</p>
</li>
<li><p><code>users</code> β An <strong>array</strong> of <strong>numbers</strong> that reference user indices from <code>indexToUserIdMap</code>. These represent the users who are available during this time slot.</p>
<ul>
<li>βοΈ<strong>Note:</strong> You''ll need to use the corresponding user IDs (from <code>indexToUserIdMap</code>) as part of the request payload when booking the meeting.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p><code>userIdToInfoMap</code> β An <strong>object</strong> that maps user IDs to user-specific details used for scheduling.</p>
<ul>
<li><p>βοΈ<strong>Note:</strong> The information in <code>userIdToInfoMap</code> is <em><strong>not required</strong></em> to build the core calendar UI. It is provided as supplementary context.</p>
</li>
<li><p><code>[userId]</code> β An <strong>object</strong> where each key is a user ID and each value is a user object.</p>
<ul>
<li><p><code>FirstName</code> β A <strong>string</strong> that represents the user''s first name.</p>
</li>
<li><p><code>LastName</code> β A <strong>string</strong> that represents the user''s last name.</p>
</li>
<li><p><code>Email</code> β A <strong>string</strong> that represents the user''s email address.</p>
</li>
<li><p><code>TimeZoneSidKey</code> β A <strong>string</strong> that represents the user''s primary time zone, using the <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List">IANA Time Zone Database</a> format. (e.g. <code>America/Los_Angeles</code>)</p>
</li>
<li><p><code>ConferenceLink</code> β A <strong>string</strong> that represents the user''s conferencing URL</p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
'
requestBody:
content:
application/json:
schema:
type: object
example:
triggerNode: New Webform Prospect
uid: 3ac6f6f3-2bbd-4401-ab12-0ee9a654b6d1
prospect:
Company: LeanData
NumEmployees: '500'
PhoneNumber: +1(669) 600-5676
ld_bookit_log_id: 3ac6f6f3-2bbd-4401-ab12-0ee9a654b6d1
FirstName: John
LastName: Doe
Email: johndoe@test.com
responses:
'200':
description: Successful response
content:
application/json: {}
/v1/scheduling/fetch-availability:
post:
tags:
- ποΈ Availability
summary: v1/scheduling/fetch-availability
description: '<p>Use this endpoint to:</p>
<ul>
<li><p><strong>refresh times after routing</strong>, using the <code>token</code> returned by <code>v1/scheduling/route-and-fetch-availability</code> to refetch availability without re-running routing</p>
</li>
<li><p>fetch availability for <strong>single-meeting-type BookIt Links only</strong> by passing the <code>linkId</code></p>
<ul>
<li>β οΈ Multi-Meeting Type Links, Routing Links, Dynamic Links, and BookIt Invites/Embedded Meeting Invites Links <strong>are not supported</strong> by this endpoint.</li>
</ul>
</li>
<li><p><strong>reschedule flow:</strong> pass <code>meetingId</code> to fetch availability for rescheduling an existing meeting</p>
</li>
</ul>
<hr />
<h2 id="request-body-parameters">Request Body Parameters</h2>
<p>βοΈ <strong>Important:</strong> The request body must include <strong>exactly one</strong> of the following parameters:</p>
<ul>
<li><p><code>token</code> β A <strong>string</strong> value returned by the <code>/v1/scheduling/route-and-fetch-availability</code> endpoint.</p>
<ul>
<li><p>Use this parameter to <strong>refresh availability after routing</strong> <em><strong>and</strong></em> <strong>before a meeting has been booked.</strong> This token represents the previously computed routing + scheduling context.</p>
</li>
<li><p>β οΈ The <code>token</code> is valid <strong>only until a meeting is successfully booked</strong> for that routed outcome.</p>
<ul>
<li><p>If a meeting has already been created, the token can no longer be used.</p>
</li>
<li><p>For rescheduling a booked meeting, use <code>meetingId</code> instead.</p>
</li>
</ul>
</li>
<li><p>When <code>token</code> is provided, <code>linkId</code> and <code>meetingId</code> must not be included.</p>
</li>
</ul>
</li>
<li><p><code>linkId</code> β A <strong>string</strong> that represents the ID of a <strong>single-meeting-type BookIt Link</strong>.</p>
<ul>
<li><p>Use this parameter to fetch availability for standalone BookIt Links.</p>
<ul>
<li>β οΈ Multi-Meeting Type Links, Routing Links, Dynamic Links, and BookIt Invites/Embedded Meeting Invites are <strong>not supported</strong> by this endpoint.</li>
</ul>
</li>
<li><p>This value is derived from the BookIt Link URL and corresponds to the path segment immediately following <code>/l/</code>. For example, given the BookIt Link <code>https://leandata.my.leandata.com/l/Lw5mjKK</code>, the linkId is <code>Lw5mjKK</code>.</p>
</li>
<li><p>When <code>linkId</code> is provided, <code>token</code> and <code>meetingId</code> must not be included.</p>
</li>
</ul>
</li>
<li><p><code>meetingId</code> β A <strong>string</strong> that represents the ID of an existing scheduled meeting.</p>
<ul>
<li><p>Use this parameter to fetch updated availability <strong>after a meeting has already been booked</strong>, for use in a reschedule flow.</p>
</li>
<li><p>This returns updated availability for the meetingβs associated meeting type and host(s).</p>
</li>
<li><p>When <code>meetingId</code> is provided, <code>token</code> and <code>linkId</code> must not be included.</p>
</li>
</ul>
</li>
</ul>
<hr />
<h2 id="response-body-parameters">Response Body Parameters</h2>
<p>The response structure varies depending on whether the request used <code>token</code>, <code>linkId</code>, or <code>meetingId</code>.</p>
<h3 id="top-level-properties">Top-Level Properties</h3>
<div class="click-to-expand-wrapper is-table-wrapper"><table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
<th>When Returned</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>calendarEvent</code></td>
<td>object</td>
<td>Details of the existing scheduled event (id, title, scheduledTime, attendees, status, organizer).</td>
<td><strong>Reschedule flow only</strong> (<code>meetingId</code>)</td>
</tr>
<tr>
<td><code>meeting</code></td>
<td>object</td>
<td>Meeting metadata (name, duration, required form fields, styling, etc.).</td>
<td>All flows</td>
</tr>
<tr>
<td><code>pageInfo</code></td>
<td>object</td>
<td>Page-level metadata including hosts and booking behavior flags.</td>
<td>All flows</td>
</tr>
<tr>
<td><code>userIdToInfoMap</code></td>
<td>object</td>
<td>Map of user ID β user scheduling metadata (name, email, timezone, phone, conference link).</td>
<td>All flows</td>
</tr>
<tr>
<td><code>availability</code></td>
<td>object</td>
<td>Available time slots and host index mapping.</td>
<td>All flows</td>
</tr>
</tbody>
</table>
</div><h3 id="pageinfo-properties"><code>pageInfo</code> Properties</h3>
<div class="click-to-expand-wrapper is-table-wrapper"><table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>displayAllPoolAvailability</code></td>
<td>boolean or <code>null</code></td>
<td>β οΈ Always check <code>displayAllPoolAvailability</code> before booking. <br />If <code>true</code>, use <strong>POST</strong> <code>/v1/round-robin-meeting</code> booking endpoint. <br />If <code>false</code>, use <strong>POST</strong> <code>/v1/meeting</code> booking endpoint</td>
</tr>
<tr>
<td><code>userIds</code></td>
<td>string[]</td>
<td>Represents <strong>defined hosts</strong> for the meeting. If <code>userIds</code> is empty, this indicates a pooled availability where the host has not been selected. In this case, the selected time slot determines the host assignment.</td>
</tr>
<tr>
<td><code>nonSFDCUserIds</code></td>
<td>string[]</td>
<td>IDs for non-SFDC users included in scheduling (group links only).</td>
</tr>
<tr>
<td><code>prefillFields</code></td>
<td>object</td>
<td>Prospect values used to pre-populate the booking form (First Name, Email, etc.).</td>
</tr>
</tbody>
</table>
</div><h3 id="meeting-object"><code>meeting</code> Object</h3>
<div class="click-to-expand-wrapper is-table-wrapper"><table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>string</td>
<td>Display name of the meeting type.</td>
</tr>
<tr>
<td><code>duration</code></td>
<td>object</td>
<td>Duration metadata (<code>unit</code>, <code>value</code>).</td>
</tr>
<tr>
<td><code>formFields</code></td>
<td>object[]</td>
<td>Fields required to book the meeting.</td>
</tr>
<tr>
<td><code>description</code></td>
<td>string</td>
<td>Meeting description shown to the prospect.</td>
</tr>
<tr>
<td><code>redirectURL</code></td>
<td>string</td>
<td>Post-booking redirect URL (may be empty).</td>
</tr>
<tr>
<td><code>internalName</code></td>
<td>string</td>
<td>Internal meeting type identifier.</td>
</tr>
<tr>
<td><code>pageStyle</code></td>
<td>object</td>
<td>Styling metadata (e.g., <code>styleColor</code>).</td>
</tr>
<tr>
<td><code>logo</code></td>
<td>string</td>
<td>URL or base64 logo string</td>
</tr>
</tbody>
</table>
</div><h3 id="availability-object"><code>availability</code> Object</h3>
<div class="click-to-expand-wrapper is-table-wrapper"><table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>indexToUserIdMap</code></td>
<td>object</td>
<td>Maps numeric index β user ID.</td>
</tr>
<tr>
<td><code>timeSlots</code></td>
<td>object[]</td>
<td>List of available time windows.</td>
</tr>
</tbody>
</table>
</div><h3 id="timeslots-structure"><code>timeSlots</code> Structure</h3>
<div class="click-to-expand-wrapper is-table-wrapper"><table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>start_time</code></td>
<td>number</td>
<td>Start time (Unix timestamp in milliseconds).</td>
</tr>
<tr>
<td><code>end_time</code></td>
<td>number</td>
<td>End time (Unix timestamp in milliseconds).</td>
</tr>
<tr>
<td><code>users</code></td>
<td>number[]</td>
<td>Array of indices referencing <code>indexToUserIdMap</code>.</td>
</tr>
</tbody>
</table>
</div>'
requestBody:
content:
application/json:
schema:
type: object
example:
token: /31AvS7OmROG0U3f1iR1cg/ouvG3T57T0674o0FfVNEDe1oTP0eMWylkgnOmZ7erwPy5Llz+7tYkxuJbyff9PUYdVgKrPk8hkkWlyj6vqa1/Hi3b/ISC9VT2CbG0/vShqEBzU+4MuQv5+0+xCMdnR6i3MK4uwlMK9p7lST6y1FZydHE+VsFj9eZPOxWTKB0lZ5IbFZNJbuvAiA+EJKCPdXw24Z1myG/371ckdjrgwDhFYjGdfXqRRbOQbnyWmXqgjKndHhcwuM4Zn0Qq45+BUnnjKZjyG32qEJaJWLlGQozGQQukcUqupMCzSIyuUgrqpWqFALGbwjf+sYWarqrw/+zKf2n9Jt14/anXkxw1mDWjTVAfnX3PH+XJwIbb/A6mWHe1AjTBtol1M+/6qCWZQwSLrBOiQuO7ySw+Y+F+Y1cfceorE1S6NajM/i7483q5RyMJFsugpiX//KCwBPUIBcP0zola1Uk2KgKc7K03Cq787j5Rlf9yBLs8Z5o2BgT1bY/DqUrTmgOpbIbExnZRX+vltzDQEmIqxsB1kAoC9BbXlWyRsgefyL2Z7nKPeKDxu0FCPO69vMt9AIcmK4TOZQ==
responses:
'200':
description: Successful response
content:
application/json: {}