openapi: 3.0.0 info: title: LeanData Graph API description: >- Run LeanData One Time Routing and fetch routing graph metadata to power custom orchestration solutions and integrations. version: 1.0.0 servers: - url: https://api.leandata.com tags: - name: Retrieve Routing Graphs Information description: >
This section outlines the endpoints used to retrieve Routing Graphs information for building a custom orchestration experience. The endpoint returns information such as trigger node names, the edges in those trigger nodes, graph name, etc
orchestration/v1/routing-graphs — Use this endpoint
when fetching routing graphs from a particular SFDC
org.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.
This endpoint retrieves a collection of configured routing graphs, allowing you to filter them by object type, deployment status, and name. This is useful for programmatically inspecting or listing the routing flows defined within your system.
Endpoint: GET
/orchestration/v1/routing-graphs
objectType (required) — A string value that
specifies the type of object the routing graphs are associated with
(e.g., "lead", "contact", "account").
isLive (optional) — A boolean value that filters
graphs by their deployment status. Set to true to retrieve
only live (deployed) graphs, or false for non-live graphs.
If omitted, all graphs (regardless of deployment status) are returned.
Note: For Business Unit deployments, this will include both Ready
To Go Live and Live deployments.
name (optional) — A string value that filters graphs
where the graph's name contains this substring (case-insensitive).
routingQueryLimit (optional) -- A numeric value that
controls the batch size for fetching routing graphs from the API key's
associated Salesforce organization. All matching graphs will still be
returned, but a higher value will result in larger batches and
potentially faster overall retrieval, up to the Salesforce API limits.
The default value is 20.
The response will contain a graphs
array, which is a collection of Graph Objects. Each
Graph Object provides detailed information about a
specific routing graph:
id (String) — Unique identifier for
the graph.
name (String) — Display name of the
graph.
isLive (Boolean) — Indicates if the
graph is currently active in production.
date (String) — Creation date in
ISO8601 format.
time (String) — Creation time in
ISO8601 format.
businessUnit (String | null) — Name
of the associated business unit, null if none.
businessUnitId (String | null) —
Identifier for the associated business unit, null if
none.
isBUDeleted (Boolean) — Indicates
if the associated business unit has been deleted.
editedBy (String) — Identifier of
the user who last edited the graph.
editedByName (String) — Display
name of the user who last edited the graph.
isGraphAvailableForEdit (Boolean) —
Indicates if the current user has permission to edit this graph.
triggerNodeEdges (Object) — This
object maps trigger node names (keys) to an object containing details
about their outgoing connections and node type. For each trigger node
name, the associated object will contain:
edges (Array) — An array of
strings, where each string is the identifier of an outgoing edge or the
next node in the flow from this trigger node.
nodeType (String) — The type of the
node, e.g. TRIGGER, UPDATE TRIGGER etc.
canGraphBeOverridden (Boolean) —
Indicates if the graph can be overridden by other graphs.
hasRoutingPriorities (Boolean) —
Indicates if the graph has routing priority settings. This would
evaluate to true if an edge on a trigger node has a
priority setting that is not the default of 5.
lastModifiedDate (String) — Last
modification timestamp in ISO8601 format.
lastModifiedBy (String) —
Identifier of the user who last modified the graph.
scheduledJobs (Array | null) — An
array of scheduled jobs associated with this graph, null if
none.
lastDeployedDate (String) —
Timestamp of the last deployment in ISO8601 format.
Endpoint: POST
https://api.leandata.com/orchestration/v1/one-time-routing
❗️ 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.
x-api-key (required) — Your unique API key for
authentication.
Content-Type (required) — Must be
application/json.
objectType (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.
condition (required) — A string value containing a
SOQL (Salesforce Object Query Language) WHERE clause to find the
object(s) to be routed. For example: Id =
'00Q5f000006KnPbEAK' or Status = 'New Lead'.
graphName (required if graphId
is not provided) — 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 graphId is provided,
graphName is ignored, even if included in the request.
graphId (required if graphName
is not provided) — string value representing the unique ID of
the routing graph to use for this one-time routing operation. If both
graphId and graphName are provided,
graphId is utilized and graphName is
ignored.
notificationsDisabled (required) — A boolean value.
When true, 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 false to allow notifications.
nodeType (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).
edgeName (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'.
allowDedupe (optional) — A boolean value. If
true, LeanData's deduplication logic will be applied to
prevent duplicate record processing during routing. Defaults to
false if not provided.
businessUnitId (optional) — A string value or
null. 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. Defaults to
null (no specific business unit
filter) if not provided. If Multi-Graph is enabled for
objectType, businessUnitId is required.
orderBy (optional) — A string value containing a
SOQL ORDER BY clause to sort the records found by the
condition. For example: "CreatedDate DESC" to
process newer records first.
queryLimit (optional) — A number value that limits
the number of records found by the condition that will be
routed. Useful for testing or processing smaller batches. If omitted,
all records matching the condition will be considered.
respectSchedules (optional) — A boolean value. When
true, records will only be routed to users who are
currently available according to their configured schedules within
LeanData. If false, scheduling availability will be
ignored. Defaults to false if not provided.
sendEmail (optional) - A boolean value. When true,
sends an email to the job owner (in this case, the Routing token user)
when 1x Routing is completed.
The response is a JSON string containing a
result object, which provides details
about the initiated one-time routing job:
condition — A string value that is
the SOQL condition that was used to select the objects for routing.
nRecords — A string value
representing the number of records that were found by the routing
job.
jobId — 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.
objectType — A string value
indicating the type of object that was routed.
Endpoint: GET
https://api.leandata.com/orchestration/v1/one-time-routing/:jobId
This endpoint is used to obtain the status of a One-Time Routing job.
💡 The :jobId path parameter should be replaced with the
unique ID of the One-Time Routing job you want to read.
x-api-key (required) — Your unique API key for
authentication.result — An object that contains metadata about the
status of the One-Time Routing job.
completedAt — Timestamp of the job's completion.
successCount — A string value representing the
number of records that were successfully processed by the routing
job.
nRecords — A string value representing the number of
records that were found by the routing job.
status — 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 "Complete".
"Complete"
"Complete with Errors"
"Canceled"
"Failed"
"Processing"
jobId — 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.