Skip to content

State Update

Use this endpoint to report trip progress timestamps to VectorCare.

POST https://hub.vectorcare.com/openapi/v2.0/requests/{request_id}/state/

Note: URLs must include the trailing slash.

This endpoint records when specific events occurred during a trip. You provide a state name and the timestamp when that state happened.

{
"name": "en_route",
"timestamp": "2025-01-15T14:30:00Z"
}
FieldTypeDescription
namestringState value (see table below)
timestampstringISO 8601 UTC timestamp when the state occurred
StateValueDescription
En Routeen_routeEn route to pickup location
ArrivedarrivedArrived at pickup location
On Boardon_boardPatient on board at pickup location
Arrived at Destinationarrived_at_destinationArrived at destination
CompletedcompletedTrip complete
CanceledcanceledTrip canceled (any reason)
Dry Rundry_runTrip canceled at pickup location

A typical trip progresses through states in order:

en_route → arrived → on_board → arrived_at_destination → completed

However, any trip can also end with:

  • canceled - Trip canceled before completion
  • dry_run - Trip canceled after arriving at pickup (patient not available, etc.)
Terminal window
curl -X POST "https://hub.vectorcare.com/openapi/v2.0/requests/KP-ABCD1234/state/" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..." \
-H "Content-Type: application/json" \
-d '{
"name": "en_route",
"timestamp": "2025-01-15T14:30:00Z"
}'
{
"name": "en_route",
"timestamp": "2025-01-15T14:30:00Z"
}
  • Must be in ISO 8601 format with UTC timezone (e.g., 2025-01-15T14:30:00Z)
  • Cannot be in the future
  • Must be within 7 days of the current time
StatusCause
400Invalid state name, timestamp in future, or timestamp too old
401Invalid or expired token
404Request not found