Skip to main content

restoreVisit

Requires permission visits:journey-plan:manage.

Puts a removed stop back on its rep's route, at the end of its day. Only a stop dated today or later can be restored, and not when the customer now belongs to another rep or is already on that day's route. The rep must be in the caller's 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:

mutation RestoreVisit($visitId: ID!) {
restoreVisit(visitId: $visitId) {
id
partnerName
status
createdAt
completedAt
displayStatus
checkIns {
id
createdAt
checkInAt
checkOutAt
checkOutLatitude
checkOutLongitude
}
}
}

Variables:

{
"visitId": "id"
}

Response:

{
"data": {
"restoreVisit": {
"id": "id",
"partnerName": "string",
"status": "CANCELLED",
"createdAt": "2025-01-15T00:00:00Z",
"completedAt": "2025-01-15T00:00:00Z",
"displayStatus": "CANCELLED",
"checkIns": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"checkInAt": "2025-01-15T00:00:00Z",
"checkOutAt": "2025-01-15T00:00:00Z",
"checkOutLatitude": 0,
"checkOutLongitude": 0
}
]
}
}
}
restoreVisit(
visitId: ID!
): Visit!

Arguments​

restoreVisit.visitId ● ID! non-null scalar​

The ID of the removed visit.

Type​

Visit object​

A planned or unplanned visit to a customer.