Skip to main content

upsertJourneyPlan

Requires permission visits:journey-plan:manage.

Replaces a sales rep's route for one day. Stops are matched by customer: kept stops are re-ordered, new stops are added as planned visits, and removed stops are deleted. A stop that already has a check-in cannot be removed, and the whole change is refused. The rep must belong to the organization. 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:

mutation UpsertJourneyPlan($input: UpsertJourneyPlanInput!) {
upsertJourneyPlan(input: $input) {
id
salesRepName
createdAt
notes
planDate
salesRepId
visits {
id
partnerName
status
createdAt
completedAt
hasUnreadMessage
}
}
}

Variables:

{
"input": {
"planDate": "2025-01-15T00:00:00Z",
"salesRepId": "string",
"visits": [
{
"partnerId": "string",
"sequence": 0
}
]
}
}

Response:

{
"data": {
"upsertJourneyPlan": {
"id": "id",
"salesRepName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"notes": "string",
"planDate": "2025-01-15T00:00:00Z",
"salesRepId": "string",
"visits": [
{
"id": "id",
"partnerName": "string",
"status": "CANCELLED",
"createdAt": "2025-01-15T00:00:00Z",
"completedAt": "2025-01-15T00:00:00Z",
"hasUnreadMessage": true
}
]
}
}
}
upsertJourneyPlan(
input: UpsertJourneyPlanInput!
): JourneyPlan!

Arguments​

upsertJourneyPlan.input ● UpsertJourneyPlanInput! non-null input​

The rep, the day, optional notes and the list of stops.

Type​

JourneyPlan object​

A rep's plan for one day: the stops they will visit.