undoRoutePlanningRun
Requires permission visits:journey-plan:manage.
Undoes a planning run: cancels the stops it added and restores the stops it removed. Refused once any of those stops has started or changed, a removed stop's day has passed or its customer now belongs to another rep, or the run also changed reps outside your team. Requires permission to manage journey plans.
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:
- GraphQL
- cURL
mutation UndoRoutePlanningRun($runId: ID!) {
undoRoutePlanningRun(runId: $runId) {
id
actorName
actorUserId
endDate
finishedAt
isPreview
reps {
repName
status
added
addedMissed
addedNewCustomers
addedVisitIds
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UndoRoutePlanningRun($runId: ID!) {\n undoRoutePlanningRun(runId: $runId) {\n id\n actorName\n actorUserId\n endDate\n finishedAt\n isPreview\n reps {\n repName\n status\n added\n addedMissed\n addedNewCustomers\n addedVisitIds\n }\n }\n}",
"variables": {
"runId": "id"
}
}
EOF
Variables:
{
"runId": "id"
}
Response:
{
"data": {
"undoRoutePlanningRun": {
"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"
]
}
]
}
}
}
undoRoutePlanningRun(
runId: ID!
): RoutePlanningRun!
Arguments
undoRoutePlanningRun.runId ● ID! non-null scalar
The ID of the planning run.
Type
RoutePlanningRun object
A planning run, or a preview of one.