---
title: "Get Visits"
method: GET
path: "/visits/"
tags: ["Visits"]
---

# Get Visits

`GET /visits/`

## Request

- Base URL: `https://v3.api.hypertrack.com`
- URL: `https://v3.api.hypertrack.com/visits/`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/hypertrack/apis/hypertrack-api/docs/visits/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves Visits associated with orders. This API provides the ability to filter for visits based on a set of query parameters.

## Query parameters

- `visit_id` string, uuid, nullable
- `geofence_id` string, uuid, nullable
- `driver_handle` string, nullable
- `worker_handle` string, nullable
- `device_id` string, uuid, nullable
- `order_handle` string, nullable
- `place_handle` string, nullable
- `pagination_token` string, nullable
- `visited_at_from` string, date-time, nullable
- `visited_at_to` string, date-time, nullable
- `metadata_filter` string, Encoded JSON, nullable
- `region_filter` string, Encoded JSON, nullable
- `search_term` string, nullable
- `aggregate` boolean
- `arrived_at_date_without_tz_from` string, nullable
- `arrived_at_date_without_tz_to` string, nullable
- `limit` integer, nullable
- `ops_group_handles` string, nullable
- `attachments` union[], nullable
  - union
    - ImageAttachmentUpload
      - `type` 'image', required: Type of attachment
      - `caption` string, required: Caption for the image
      - `data` string, required: Image as base64 text
      - `attachment_id` string, uuid, nullable: String representing the ID of the attachment
    - NoteAttachmentUpload
      - `type` 'note', required: Type of attachment
      - `data` string, required: Text for the note
      - `attachment_id` string, uuid, nullable: String representing the ID of the attachment
    - SignatureAttachmentUpload
      - `type` 'signature', required: Type of attachment
      - `data` string, required: Signature as base64 text
      - `attachment_id` string, uuid, nullable: String representing the ID of the attachment

## Response `200`

Successful response

- GetVisitsResponse
  - `orders` VisitOrder[], nullable: Array of Orders fulfilled in the given time range
    - `order_handle` string, required: String representing the order
    - `service` ServiceStatsInfo, required
      - `duration` integer, nullable: Duration to be tracked for the order
      - `distance` integer, nullable: Duration to be tracked for the order
      - `outage_duration` integer, nullable: Duration to be tracked for the order
      - `outage` object, nullable: Duration to be tracked for the order
      - `tracking_rate` number, nullable: Driver tracking rate during the lifespan of the visit
    - `enroute` EnrouteStatsInfo, required
      - `duration` integer, nullable: Duration to be tracked for the order
      - `distance` integer, nullable: Duration to be tracked for the order
      - `idle_time` integer, nullable: Duration to be tracked for the order
      - `outage_duration` integer, nullable: Duration to be tracked for the order
      - `outage_distance` integer, nullable: Outage distance for the visit
      - `outage` object, nullable: Duration to be tracked for the order
      - `tracking_rate` number, nullable: Driver tracking rate during the lifespan of the visit
    - `driver_handle` string: String representing the handle for the driver
    - `tracking_rate` number: Tracking rate during the lifespan of the order
    - `worker_handle` string: String representing the handle for the worker
    - `system_generated_order_handle` boolean, nullable: Boolean to filter out orders where order handle was automatically generated by HT system
    - `ops_group_handle` string: String representing the ops group handle
    - `visits` Visit[]: List of visits associated with order
      - `visit_id` string, uuid, required: Unique identifier representing each visit.
      - `created_at` string, required: Creation timestamp of visit
      - `updated_at` string, nullable: Last Updated timestamp of visit
      - `geofence_id` string, uuid, required: GeofenceId associated with visit
      - `driver_handle` string: Driver handle for this visit
      - `worker_handle` string: Worker handle for this visit
      - `worker_name` string, nullable: Worker name for this visit
      - `worker_profile` object, nullable: Worker profile associated with visit.
      - `device_id` string, uuid, nullable: Device id associated with visit
      - `order_handle` string, required: Order handle for this visit
      - `place_handle` string, nullable: Place handle for this visit
      - `ops_group_handle` string, required: Ops Group handle for this visit
      - `arrival` union: Arrival information of visit
        - LocationInfo
          - `location` union: Location for the visit
            - LocationGeometry
              - …
            - unknown
          - `recorded_at` string, required: Recorded timestamp
          - `location_accuracy` number, nullable: Location accuracy in meters
        - unknown
      - `exit` union: Exited information of visit
        - LocationInfo
          - `location` union: Location for the visit
            - LocationGeometry
              - …
            - unknown
          - `recorded_at` string, required: Recorded timestamp
          - `location_accuracy` number, nullable: Location accuracy in meters
        - unknown
      - `enroute` union
        - EnrouteStatsInfo
          - `duration` integer, nullable: Duration to be tracked for the order
          - `distance` integer, nullable: Duration to be tracked for the order
          - `idle_time` integer, nullable: Duration to be tracked for the order
          - `outage_duration` integer, nullable: Duration to be tracked for the order
          - `outage_distance` integer, nullable: Outage distance for the visit
          - `outage` object, nullable: Duration to be tracked for the order
          - `tracking_rate` number, nullable: Driver tracking rate during the lifespan of the visit
        - unknown
      - `service` union
        - ServiceStatsInfo
          - `duration` integer, nullable: Duration to be tracked for the order
          - `distance` integer, nullable: Duration to be tracked for the order
          - `outage_duration` integer, nullable: Duration to be tracked for the order
          - `outage` object, nullable: Duration to be tracked for the order
          - `tracking_rate` number, nullable: Driver tracking rate during the lifespan of the visit
        - unknown
      - `metadata` object, nullable: Metadata associated with this visit.
      - `geofence_metadata` object, nullable: Geofence Metadata associated with the visit.
      - `tracking_rate` number: Driver tracking rate during the lifespan of the order
      - `system_generated_order_handle` boolean, nullable: Boolean to filter out orders where order handle was automatically generated by HT system
      - `visit_geometry` union: Geometry of the visit
        - VisitGeometryModel
          - `radius` integer, required: Radius of visit's location in case of point type
          - `geometry` AnyLocationGeometry, required
            - `type` 'Point' | 'Polygon', required: Geometry type
            - `coordinates` unknown[], required: Location coordinates represented as [longitude, latitude] or [[[longitude, latitude],..]]
              - …
        - unknown
      - `geofence_address` string, nullable: Geofence address for this visit
      - `timezone` string, nullable: Timezone associated with this visit
      - `attachments` union[], nullable: Attachments associated with this geotag
        - union
          - ImageAttachmentResponse
            - `type` 'image', required: Type of attachment
            - `url` string, required: Image link
            - `caption` string, nullable: Caption for the image
            - `attachment_id` string, nullable
          - NoteAttachmentResponse
            - `type` 'note', required: Type of attachment
            - `data` string, required: Text for the note
            - `attachment_id` string, nullable
          - SignatureAttachmentResponse
            - `type` 'signature', required: Type of attachment
            - `url` string, required: Signature image link
            - `attachment_id` string, nullable
  - `pagination_token` string, nullable: Identifier used to fetch the next page of data
  - `aggregate` union: Combined aggregate metrics for visits and orders in the given time range
    - VisitOrderAggregate
      - `count` integer, required: Number of orders generated in the given time range
      - `tracking_rate` number: Tracking rate of the driver during the lifespan of the orders
      - `visits` VisitsAggregate
        - `count` integer: Number of geotags generated in the given time range
      - `workers` WorkersAggregate
        - `count` integer: Total number of drivers
    - unknown

## Other responses

- `400`: Validation error
- `401`: Authentication error

---

[API](https://skmtc.dev/hypertrack/apis/hypertrack-api.md) - [All operations](https://skmtc.dev/hypertrack/apis/hypertrack-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hypertrack/apis/hypertrack-api/revisions/389326c4c9c8?raw)
