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:
- GraphQL
- cURL
mutation RestoreVisit($visitId: ID!) {
restoreVisit(visitId: $visitId) {
id
partnerName
status
createdAt
completedAt
displayStatus
checkIns {
id
createdAt
checkInAt
checkOutAt
checkOutLatitude
checkOutLongitude
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation RestoreVisit($visitId: ID!) {\n restoreVisit(visitId: $visitId) {\n id\n partnerName\n status\n createdAt\n completedAt\n displayStatus\n checkIns {\n id\n createdAt\n checkInAt\n checkOutAt\n checkOutLatitude\n checkOutLongitude\n }\n }\n}",
"variables": {
"visitId": "id"
}
}
EOF
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.