> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unitedpetroleum.app/llms.txt
> Use this file to discover all available pages before exploring further.

# List POI visits

> Returns POI visits (geofence entries/exits) for your org, cursor-paginated on (`visit_start desc`, `id desc`). A visit is one entry-to-exit cycle: a vehicle entered the geofence, stayed for some time, then left. The fields prefixed `poi_*` and `vehicle_*` are denormalized snapshots so historical visits remain stable even when the underlying POI/vehicle is later edited.



## OpenAPI

````yaml /openapi.json get /poi-visits
openapi: 3.1.0
info:
  title: United Logistics API
  version: 0.1.0
  description: >-
    Industry-grade public API for fleet, fuel, and toll operations. Every
    endpoint is scoped to the organization owning the API key. Authentication:
    bearer API key (`ulk_<prefix>_<secret>`). Rate limit: 60 requests/minute/key
    by default (override per key via the dashboard).
  contact:
    name: United Logistics Engineering
    email: sfuentes@assetmg.tech
servers:
  - url: https://app.unitedlogistics.com.do/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /poi-visits:
    get:
      tags:
        - POIs
      summary: List POI visits
      description: >-
        Returns POI visits (geofence entries/exits) for your org,
        cursor-paginated on (`visit_start desc`, `id desc`). A visit is one
        entry-to-exit cycle: a vehicle entered the geofence, stayed for some
        time, then left. The fields prefixed `poi_*` and `vehicle_*` are
        denormalized snapshots so historical visits remain stable even when the
        underlying POI/vehicle is later edited.
      parameters:
        - schema:
            type: string
            pattern: ^\d+$
            description: Page size, 1-500. Defaults to 50.
            example: '50'
          required: false
          name: limit
          in: query
        - schema:
            type: string
            description: Opaque cursor from a previous call's `pagination.next_cursor`.
          required: false
          name: cursor
          in: query
        - schema:
            type: string
            pattern: ^\d+$
            description: Filter to a single POI.
            example: '481'
          required: false
          name: poi_id
          in: query
        - schema:
            type: string
            pattern: ^\d+$
            description: Filter to a single vehicle (`vehicles.external_id`).
            example: '16444'
          required: false
          name: vehicle_external_id
          in: query
        - schema:
            type: string
            format: date-time
            description: ISO-8601 lower bound on `visit_start` (inclusive).
          required: false
          name: start
          in: query
        - schema:
            type: string
            format: date-time
            description: ISO-8601 upper bound on `visit_start` (inclusive).
          required: false
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/POIVisitListResponse'
              example:
                data:
                  - id: 9183721
                    org_id: d87f7281-ea19-45cd-b6fd-d8eb9e310da1
                    poi_id: 481
                    vehicle_external_id: 16444
                    stay_id: 9183714
                    visit_start: '2026-05-20T13:11:03.412Z'
                    visit_end: '2026-05-20T14:42:51.000Z'
                    duration_minutes: 92
                    poi_name: Cliente Altice – Bávaro
                    poi_tags:
                      - cliente
                      - distribución-este
                    poi_latitude: 18.6792
                    poi_longitude: -68.4014
                    poi_image_url: null
                    vehicle_number: T-114
                    license_plate: L139558
                    event_count: 318
                    distance_to_poi_meters: 41.5
                    poi_version: 3
                    created_at: '2026-05-20T14:43:01.117Z'
                    updated_at: '2026-05-20T14:43:01.117Z'
                  - id: 9183720
                    org_id: d87f7281-ea19-45cd-b6fd-d8eb9e310da1
                    poi_id: 481
                    vehicle_external_id: 16444
                    stay_id: 9183714
                    visit_start: '2026-05-19T08:02:51.000Z'
                    visit_end: '2026-05-19T08:48:14.000Z'
                    duration_minutes: 45
                    poi_name: Cliente Altice – Bávaro
                    poi_tags:
                      - cliente
                      - distribución-este
                    poi_latitude: 18.6792
                    poi_longitude: -68.4014
                    poi_image_url: null
                    vehicle_number: T-114
                    license_plate: L139558
                    event_count: 162
                    distance_to_poi_meters: 22.8
                    poi_version: 3
                    created_at: '2026-05-19T08:48:25.000Z'
                    updated_at: '2026-05-19T08:48:25.000Z'
                pagination:
                  next_cursor: >-
                    eyJ2aXNpdF9zdGFydCI6IjIwMjYtMDUtMTlUMDg6MDI6NTEuMDAwWiIsImlkIjo5MTgzNzIwfQ
                  has_more: true
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: bad_request
                  message: limit must be between 1 and 500.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: unauthorized
                  message: API key missing or invalid.
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
              example:
                error:
                  code: too_many_requests
                  message: Rate limit exceeded.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    POIVisitListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/POIVisit'
        pagination:
          $ref: '#/components/schemas/PaginationCursor'
      required:
        - data
        - pagination
    ErrorObject:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: unauthorized
            message:
              type: string
              example: Missing Authorization header.
            details: {}
          required:
            - code
            - message
      required:
        - error
    POIVisit:
      type: object
      properties:
        id:
          type: integer
          example: 9183721
        org_id:
          type: string
          format: uuid
          example: d87f7281-ea19-45cd-b6fd-d8eb9e310da1
        poi_id:
          type: integer
          example: 481
        vehicle_external_id:
          type: integer
          example: 16444
        stay_id:
          type:
            - integer
            - 'null'
          example: 9183714
        visit_start:
          type:
            - string
            - 'null'
          example: '2026-05-20T13:11:03.412Z'
        visit_end:
          type:
            - string
            - 'null'
          example: '2026-05-20T14:42:51.000Z'
        duration_minutes:
          type:
            - integer
            - 'null'
          example: 92
        poi_name:
          type:
            - string
            - 'null'
          example: Cliente Altice – Bávaro
        poi_tags:
          type:
            - array
            - 'null'
          items:
            type: string
          example:
            - cliente
            - distribución-este
        poi_latitude:
          type:
            - number
            - 'null'
          example: 18.6792
        poi_longitude:
          type:
            - number
            - 'null'
          example: -68.4014
        poi_image_url:
          type:
            - string
            - 'null'
          example: null
        vehicle_number:
          type:
            - string
            - 'null'
          example: T-114
        license_plate:
          type:
            - string
            - 'null'
          example: L139558
        event_count:
          type:
            - integer
            - 'null'
          example: 318
        distance_to_poi_meters:
          type:
            - number
            - 'null'
          example: 41.5
        poi_version:
          type:
            - integer
            - 'null'
          example: 3
        created_at:
          type: string
          example: '2026-05-20T14:43:01.117Z'
        updated_at:
          type: string
          example: '2026-05-20T14:43:01.117Z'
      required:
        - id
        - org_id
        - poi_id
        - vehicle_external_id
        - stay_id
        - visit_start
        - visit_end
        - duration_minutes
        - poi_name
        - poi_tags
        - poi_latitude
        - poi_longitude
        - poi_image_url
        - vehicle_number
        - license_plate
        - event_count
        - distance_to_poi_meters
        - poi_version
        - created_at
        - updated_at
    PaginationCursor:
      type: object
      properties:
        next_cursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor for the next page. Null when there are no more
            results.
          example: eyJpZCI6IjAxQUI...
        has_more:
          type: boolean
      required:
        - next_cursor
        - has_more
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: ulk_<prefix>_<secret>
      description: >-
        Authorization: Bearer ulk_<prefix>_<secret>. Cree la clave en
        Configuración → API.

````