checkInVisit
Requires permission visits:visit:execute.
Checks the signed-in rep in at a planned visit, with an optional location. An offline replay can send the time the rep tapped and an idempotency key, so the check-in is created exactly once. If an admin cancelled or completed the visit meanwhile, the check-in is still recorded but the status is left unchanged. Requires permission to run 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 CheckInVisit($visitId: ID!) {
checkInVisit(visitId: $visitId) {
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 CheckInVisit($visitId: ID!) {\n checkInVisit(visitId: $visitId) {\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": {
"visitId": "id"
}
}
EOF
Variables:
{
"visitId": "id"
}
Response:
{
"data": {
"checkInVisit": {
"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
}
]
}
}
}
checkInVisit(
clientCheckInAt: DateTime
idempotencyKey: String
latitude: Float
longitude: Float
visitId: ID!
): Visit!
Arguments
checkInVisit.clientCheckInAt ● DateTime scalar
When the rep tapped check-in, for an offline replay. The server limits it to a sensible time.
checkInVisit.idempotencyKey ● String scalar
A key that makes an offline replay create the check-in only once.
checkInVisit.latitude ● Float scalar
The rep's latitude at check-in. Optional.
checkInVisit.longitude ● Float scalar
The rep's longitude at check-in. Optional.
checkInVisit.visitId ● ID! non-null scalar
The ID of the visit.
Type
Visit object
A planned or unplanned visit to a customer.