reorderVisits
Requires permission visits:visit:execute.
Reorder the signed-in rep's remaining planned stops for today. Returns the whole day's visits.
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 ReorderVisits($visitIds: [ID!]!) {
reorderVisits(visitIds: $visitIds) {
id
partnerName
status
createdAt
completedAt
hasUnreadMessage
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 ReorderVisits($visitIds: [ID!]!) {\n reorderVisits(visitIds: $visitIds) {\n id\n partnerName\n status\n createdAt\n completedAt\n hasUnreadMessage\n checkIns {\n id\n createdAt\n checkInAt\n checkOutAt\n checkOutLatitude\n checkOutLongitude\n }\n }\n}",
"variables": {
"visitIds": [
"id"
]
}
}
EOF
Variables:
{
"visitIds": [
"id"
]
}
Response:
{
"data": {
"reorderVisits": [
{
"id": "id",
"partnerName": "string",
"status": "CANCELLED",
"createdAt": "2025-01-15T00:00:00Z",
"completedAt": "2025-01-15T00:00:00Z",
"hasUnreadMessage": true,
"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
}
]
}
]
}
}
reorderVisits(
visitIds: [ID!]!
): [Visit!]!
Arguments
reorderVisits.visitIds ● [ID!]! non-null scalar
The IDs of today's planned visits in the new order.
Type
Visit object
A planned or unplanned visit to a customer.