Skip to main content

routePlanningRunPreview

Requires at least one of the permissions visits:journey-plan:generate-own or visits:journey-plan:manage.

Works out what a planning run would add, remove and defer for each rep, without changing anything. Allowed while another run is in progress. A rep who may only refresh their own route can preview only that, keeping existing stops. Requires permission to manage journey plans or to generate your own route.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query RoutePlanningRunPreview {
routePlanningRunPreview {
id
actorName
actorUserId
endDate
finishedAt
isPreview
reps {
repName
status
added
addedMissed
addedNewCustomers
addedVisitIds
}
}
}

Response:

{
"data": {
"routePlanningRunPreview": {
"id": "id",
"actorName": "string",
"actorUserId": "id",
"endDate": "2025-01-15T00:00:00Z",
"finishedAt": "2025-01-15T00:00:00Z",
"isPreview": true,
"reps": [
{
"repName": "string",
"status": "FAILED",
"added": 0,
"addedMissed": 0,
"addedNewCustomers": 0,
"addedVisitIds": [
"id"
]
}
]
}
}
}
routePlanningRunPreview(
input: RoutePlanningRunInput
): RoutePlanningRun!

Arguments​

routePlanningRunPreview.input ● RoutePlanningRunInput input​

The reps, days and re-planning mode. Omit fields to use the rules.

Type​

RoutePlanningRun object​

A planning run, or a preview of one.