LeanData One Time Routing API

This section describes the endpoints used to trigger 1x Routing for creating a custom orchestration experience, as well as to retrieve the status of the resulting job. When invoked, the 1x Routing endpoint returns basic job metadata—including the jobId—which can be used to check the job’s status. orchestration/v1/one-time-routing — Use this endpoint to invoke 1x routing for a particular SFDC org orchestration/v1/one-time-routing/:jobId — Use this endpoint to retrieve the job status of a 1x routing for a particular SFDC org ❗️ Important: The API does not validate FlowBuilder graphs before triggering routing. If you invoke 1x Routing to an invalid or misconfigured graph, the request will still be processed—but routing will fail silently. No error response will be returned from the API.✅ To avoid unexpected behavior, please ensure the graph is valid and functioning as expected within the LeanData application before using it in API-triggered routing.

OpenAPI Specification

leandata-one-time-routing-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: LeanData BookIt 🗓️ Availability 🗓️ Availability One Time Routing 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: One Time Routing
  description: '<p>This section describes the endpoints used to trigger 1x Routing for creating a custom orchestration experience, as well as to retrieve the status of the resulting job. When invoked, the 1x Routing endpoint returns basic job metadata—including the <code>jobId</code>—which can be used to check the job’s status.</p>

    <ul>

    <li><p><code>orchestration/v1/one-time-routing</code> — Use this endpoint to invoke 1x routing for a particular SFDC org</p>

    </li>

    <li><p><code>orchestration/v1/one-time-routing/:jobId</code> — Use this endpoint to retrieve the job status of a 1x routing for a particular SFDC org</p>

    </li>

    </ul>

    <p>❗️ <strong>Important:</strong> The API does <strong>not</strong> validate FlowBuilder graphs before triggering routing. If you invoke 1x Routing to an invalid or misconfigured graph, the request will still be processed—but routing will fail silently. No error response will be returned from the API.<br />✅ To avoid unexpected behavior, please ensure the graph is valid and functioning as expected within the LeanData application before using it in API-triggered routing.</p>

    '
paths:
  /orchestration/v1/one-time-routing:
    post:
      tags:
      - One Time Routing
      summary: orchestration/v1/one-time-routing
      description: '<p><strong>Endpoint:</strong> <code>POST https://api.leandata.com/orchestration/v1/one-time-routing</code></p>

        <p>❗️ <strong>Important:</strong> The API does <strong>not</strong> validate FlowBuilder graphs before triggering routing. If you invoke 1x Routing to an invalid or misconfigured graph, the request will still be processed—but routing will fail silently. No error response will be returned from the API.<br />✅ To avoid unexpected behavior, please ensure the graph is valid and functioning as expected within the LeanData application before using it in API-triggered routing.</p>

        <h3 id="headers">Headers</h3>

        <ul>

        <li><p><code>x-api-key</code> (required) — Your unique API key for authentication.</p>

        </li>

        <li><p><code>Content-Type</code> (required) — Must be <code>application/json</code>.</p>

        </li>

        </ul>

        <hr />

        <h4 id="request-body-parameters">Request Body Parameters</h4>

        <ul>

        <li><p><code>objectType</code> (required) — A string value representing the type of object to route (e.g., "Lead", "Contact", "Opportunity"). This must correspond to an object type configured in your LeanData instance.</p>

        </li>

        <li><p><code>condition</code> (required) — A string value containing a SOQL (Salesforce Object Query Language) WHERE clause to find the object(s) to be routed. For example: <code>Id = ''00Q5f000006KnPbEAK''</code> or <code>Status = ''New Lead''</code>.</p>

        </li>

        <li><p><code>graphName</code> <em>(required if</em> <code>graphId</code> <em>is not provided)</em> — A string value that is the exact name of the routing graph (configured in the LeanData Flowbuilder) to use for this one-time routing operation. If <code>graphId</code> is provided, <code>graphName</code> is ignored, even if included in the request.</p>

        </li>

        <li><p><code>graphId</code> <em>(required if</em> <code>graphName</code> <em>is not provided)</em> — string value representing the unique ID of the routing graph to use for this one-time routing operation. If both <code>graphId</code> and <code>graphName</code> are provided, <code>graphId</code> is utilized and <code>graphName</code> is ignored.</p>

        </li>

        <li><p><code>notificationsDisabled</code> (required) — A boolean value. When <code>true</code>, all notifications (e.g., email alerts, Slack messages, MSFT messages, etc) that are configured within the specified routing graph will be suppressed for this one-time routing execution. Set to <code>false</code> to allow notifications.</p>

        </li>

        <li><p><code>nodeType</code> (required) — A string value representing the entry point type for the routing graph. Common values include ''TRIGGER'' (for standard trigger-based routing) or ''UPDATE TRIGGER'' (for routing based on updates to an object).</p>

        </li>

        <li><p><code>edgeName</code> (required) — A string value that is the name of the specific edge (transition) from the Trigger Node within the specified routing graph that should be followed as the starting point for this one-time routing. For example: ''Lead is MQL''.</p>

        </li>

        <li><p><code>allowDedupe</code> (optional) — A boolean value. If <code>true</code>, LeanData''s deduplication logic will be applied to prevent duplicate record processing during routing. Defaults to <code>false</code> if not provided.</p>

        </li>

        <li><p><code>businessUnitId</code> (optional) — A string value or <code>null</code>. This is the unique identifier of a specific business unit graph to route the object(s) through. This is useful for routing within a specific organizational segment. <strong>Defaults to</strong> <strong><code>null</code></strong> <strong>(no specific business unit filter) if not provided.</strong> If Multi-Graph is enabled for <code>objectType</code>, <code>businessUnitId</code> is required.</p>

        </li>

        <li><p><code>orderBy</code> (optional) — A string value containing a SOQL ORDER BY clause to sort the records found by the <code>condition</code>. For example: <code>"CreatedDate DESC"</code> to process newer records first.</p>

        </li>

        <li><p><code>queryLimit</code> (optional) — A number value that limits the number of records found by the <code>condition</code> that will be routed. Useful for testing or processing smaller batches. If omitted, all records matching the <code>condition</code> will be considered.</p>

        </li>

        <li><p><code>respectSchedules</code> (optional) — A boolean value. When <code>true</code>, records will only be routed to users who are currently available according to their configured schedules within LeanData. If <code>false</code>, scheduling availability will be ignored. Defaults to <code>false</code> if not provided.</p>

        </li>

        <li><p>sendEmail (optional) - A boolean value. When <code>true</code>, sends an email to the job owner (in this case, the Routing token user) when 1x Routing is completed.</p>

        </li>

        </ul>

        <h4 id="response-body-parameters">Response Body Parameters</h4>

        <p>The response is a JSON string containing a <strong><code>result</code></strong> object, which provides details about the initiated one-time routing job:</p>

        <ul>

        <li><p><strong><code>condition</code></strong> — A string value that is the SOQL condition that was used to select the objects for routing.</p>

        </li>

        <li><p><strong><code>nRecords</code></strong> — A string value representing the number of records that were found by the routing job.</p>

        </li>

        <li><p><strong><code>jobId</code></strong> — A string value that is the unique identifier for the asynchronous one-time routing job. You can use this ID to query for the status of the job if such an endpoint is available.</p>

        </li>

        <li><p><strong><code>objectType</code></strong> — A string value indicating the type of object that was routed.</p>

        </li>

        </ul>

        '
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                objectType: Lead
                condition: Id = '00Q5f000006KnPbEAK'
                graphName: Lead Routing Q2 2025
                notificationsDisabled: false
                nodeType: Trigger
                edgeName: Lead is MQL
                allowDedupe: true
                respectSchedules: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
  /orchestration/v1/one-time-routing/:jobId:
    get:
      tags:
      - One Time Routing
      summary: orchestration/v1/one-time-routing/:jobId
      description: '<p><strong>Endpoint:</strong> <code>GET https://api.leandata.com/orchestration/v1/one-time-routing/:jobId</code></p>

        <p>This endpoint is used to obtain the status of a One-Time Routing job.</p>

        <p>💡 The <code>:jobId</code> path parameter should be replaced with the unique ID of the One-Time Routing job you want to read.</p>

        <h4 id="headers">Headers</h4>

        <ul>

        <li><code>x-api-key</code> (required) — Your unique API key for authentication.</li>

        </ul>

        <hr />

        <h4 id="request-body-parameters">Request Body Parameters</h4>

        <ul>

        <li><p><code>result</code> — An object that contains metadata about the status of the One-Time Routing job.</p>

        <ul>

        <li><p><code>completedAt</code> — Timestamp of the job''s completion.</p>

        </li>

        <li><p><code>successCount</code> — A string value representing the number of records that were successfully processed by the routing job.</p>

        </li>

        <li><p><code>nRecords</code> — A string value representing the number of records that were found by the routing job.</p>

        </li>

        <li><p><code>status</code> — A string value representing the status of the One-Time Routing job. Because the API does not validate FlowBuilder graphs, invalid graphs will be marked as <code>"Complete".</code></p>

        <ul>

        <li><p><code>"Complete"</code></p>

        </li>

        <li><p><code>"Complete with Errors"</code></p>

        </li>

        <li><p><code>"Canceled"</code></p>

        </li>

        <li><p><code>"Failed"</code></p>

        </li>

        <li><p><code>"Processing"</code></p>

        </li>

        </ul>

        </li>

        <li><p><code>jobId</code> — A string value that is the unique identifier for the asynchronous One-Time Routing job. You can use this ID to query for the status of the job if such an endpoint is available.</p>

        </li>

        </ul>

        </li>

        </ul>

        '
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}