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

# Retrieve latest Location Histories for a Company

> Retrieve latest `LocationHistories` for a `Company`.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/location_histories/latest
openapi: 3.0.3
info:
  title: Horizon API V1
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: >-
    This is the Version 1 implementation.


    When in doubt we default to the practices outlined
    [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)
  license:
    name: Private
    url: https://tread.io
servers:
  - description: production
    url: https://api.tread-horizon.com
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Orders
  - name: Loads
  - name: Jobs
  - name: JobAssignments
  - name: ApprovalAssignments
  - name: Equipment
  - name: FuelSurcharges
  - name: Materials
  - name: Accounts
  - name: Tickets
  - name: Users
  - name: Sites
  - name: Companies
  - name: Departments
  - name: Rates
  - name: Services
  - name: EquipmentType
  - name: FileAttachments
  - name: MaterialType
  - name: LineItemType
  - name: DriverStateEvent
  - name: Authentication
  - name: IamRoles
  - name: Typeaheads
  - name: Integrations
  - name: Reflection
  - name: LoadCycles
  - name: AddOns
  - name: ServiceClass
  - name: Invoices
  - name: JobSummaries
  - name: LoadSummaries
  - name: CompanyShares
  - name: UserDevicePermission
  - name: Drivers
  - name: Settlements
  - name: LocationHistories
  - name: Telematics
  - name: OmniReports
  - name: DriverDays
  - name: Agave
  - name: AddOnCharges
  - name: ResourceUsageLogs
  - name: ResourceScopes
  - name: TravelledDistances
  - name: MaterialRates
  - name: CompanyDayJobStats
  - name: KMLFiles
  - name: AutoAddOnAssignments
  - name: SiteRateSchedules
  - name: TwilioIntegrations
  - name: Foremen
  - name: AccountExternalTruckIdentifier
  - name: GeofenceTriggers
  - name: Labels
  - name: Compliance
  - name: ComplianceDocuments
paths:
  /v1/location_histories/latest:
    parameters:
      - $ref: '#/components/parameters/Accept-Language'
    get:
      tags:
        - LocationHistories
      summary: Retrieve latest Location Histories for a Company
      description: Retrieve latest `LocationHistories` for a `Company`.
      operationId: get-v1-location_histories-latest
      parameters:
        - schema:
            type: string
          in: query
          name: filter[order_id]
          description: >-
            Filters location histories to include only those associated with the
            specified order's jobs 
        - schema:
            type: string
          in: query
          name: filter[job_id]
          description: >-
            Filters location histories to include only those associated with the
            specific job 
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: 1glvq81dstm0v
                    items:
                      $ref: >-
                        #/components/schemas/NextBillionAssetLocations-LatestLocation-Read
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      deprecated: true
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: >-
        The Accept-Language request HTTP header indicates the natural language
        and locale that the client prefers. 
  schemas:
    NextBillionAssetLocations-LatestLocation-Read:
      title: NextBillionAssetLocations-LatestLocation-Read
      x-stoplight:
        id: kxf2ke7m44u5j
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/NextBillionAssetLocations-Read'
        - type: object
          x-stoplight:
            id: 640j3b5ol4fi7
          properties:
            driver:
              $ref: '#/components/schemas/User-Read-Nested'
            vendor_job_assignment:
              $ref: '#/components/schemas/JobAssignment-LatestLocation-Read-Nested'
            dispatch_number:
              $ref: '#/components/schemas/DispatchNumber-Read-Nested'
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    NextBillionAssetLocations-Read:
      title: NextBillionAssetLocations-Read
      x-stoplight:
        id: r4fxi0lyzdk7c
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: okxxnjle06x4t
          required:
            - lat
            - lon
            - accuracy
            - device_id
            - load_id
            - job_id
            - order_id
            - created_at
            - load_state
            - radii
            - speed_meters_per_second
            - bearing_degrees
            - occurred_at
          properties:
            lat:
              type: string
              x-stoplight:
                id: sz4r3je8tjtug
            lon:
              type: string
              x-stoplight:
                id: oxv4dux129o9u
            accuracy:
              type: string
              x-stoplight:
                id: yfet2yt7hix1r
              nullable: true
            device_id:
              type: string
              x-stoplight:
                id: twigr07p456el
              nullable: true
            load_id:
              type: string
              x-stoplight:
                id: x2nr61wujagbl
              format: uuid
              nullable: true
            job_id:
              type: string
              x-stoplight:
                id: eh8h8ewvux24d
              format: uuid
              nullable: true
            order_id:
              type: string
              x-stoplight:
                id: es98zgal04r4z
              nullable: true
            created_at:
              type: string
              x-stoplight:
                id: mfxcvbjb4hpah
              format: date-time
              deprecated: true
            load_state:
              $ref: '#/components/schemas/NullableLoadState'
            equipment:
              $ref: '#/components/schemas/Equipment-Read-Nested'
            radii:
              x-stoplight:
                id: qgdg5f6qq8vw9
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/Radii-Read-Nested'
            speed_meters_per_second:
              type: string
              x-stoplight:
                id: p42zd3kzlilwf
              nullable: true
            bearing_degrees:
              type: string
              x-stoplight:
                id: os6j4w8qfqg4h
              nullable: true
            occurred_at:
              type: string
              x-stoplight:
                id: 1gdxcj1n7b4ug
              format: date-time
    User-Read-Nested:
      title: User-Read-Nested
      x-stoplight:
        id: llvhpyfas0ekp
      allOf:
        - $ref: '#/components/schemas/User-Read-Typeahead'
        - $ref: '#/components/schemas/Discardable'
        - type: object
          x-stoplight:
            id: 6i4ku1oj5jnjs
          required:
            - email
            - phone
            - external_id
            - schedule_on
          properties:
            email:
              type: string
              x-stoplight:
                id: lyetvi4zixhq9
              nullable: true
            phone:
              type: string
              x-stoplight:
                id: 5dyog3jwd9m72
              description: User's E.164 formatted phone number
              nullable: true
            external_id:
              type: string
              x-stoplight:
                id: nk3qk35smj1ej
              nullable: true
            schedule_on:
              type: boolean
              x-stoplight:
                id: 5l8bajmm29c31
    JobAssignment-LatestLocation-Read-Nested:
      title: JobAssignment-LatestLocation-Read-Nested
      x-stoplight:
        id: j6i2gjnatp1s4
      type: object
      properties:
        customer_account:
          $ref: '#/components/schemas/Account-LatestLocation-Read-Nested'
        vendor_account:
          $ref: '#/components/schemas/Account-LatestLocation-Read-Nested'
      additionalProperties: false
    DispatchNumber-Read-Nested:
      title: DispatchNumber-Read-Nested
      x-stoplight:
        id: 5oe6kw6t82gnr
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
          properties:
            name:
              type: string
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    NullableLoadState:
      title: NullableLoadState
      x-stoplight:
        id: s21krgz0gt3pa
      allOf:
        - $ref: '#/components/schemas/LoadState'
      nullable: true
      type: string
    Equipment-Read-Nested:
      title: Equipment-Read-Nested
      x-stoplight:
        id: 7ezenec7ycv5l
      allOf:
        - $ref: '#/components/schemas/Equipment-Read-Typeahead'
        - type: object
          required:
            - license_number
            - zone
            - accounting_id
            - equipment_id
          properties:
            license_number:
              type: string
              x-stoplight:
                id: hw1ooa17wsadq
              nullable: true
            zone:
              type: string
              x-stoplight:
                id: 81hr4p8yp8btv
              nullable: true
            accounting_id:
              type: string
              x-stoplight:
                id: ere9qhs4cuwhi
              nullable: true
            equipment_id:
              type: string
              x-stoplight:
                id: gt7r3iqzx2w0u
    Radii-Read-Nested:
      title: Radii-Read-Nested
      x-stoplight:
        id: ly6sm0c8t4pyb
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: ho0uakpcggx2p
          required:
            - radius_meters
          properties:
            radius_meters:
              type: number
              x-stoplight:
                id: gw6qtcobk2y84
            site_id:
              type: string
              x-stoplight:
                id: fudag8xqdf288
              format: uuid
    User-Read-Typeahead:
      title: User-Read-Typeahead
      x-stoplight:
        id: ttbbss5b5k66f
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - first_name
            - last_name
          properties:
            first_name:
              type: string
              description: First name
              x-stoplight:
                id: gwo999rcdahmg
            last_name:
              type: string
              description: Last name
              x-stoplight:
                id: l9omnnsq644bh
      description: ''
    Discardable:
      title: Discardable
      x-stoplight:
        id: 46axlb8u5wjay
      type: object
      required:
        - discarded_at
      properties:
        discarded_at:
          type: string
          x-stoplight:
            id: cy8t6fecoyxbo
          format: date-time
          nullable: true
      additionalProperties: false
    Account-LatestLocation-Read-Nested:
      title: Account-LatestLocation-Read-Nested
      x-stoplight:
        id: rrobgjwm8y242
      type: object
      required:
        - name
      properties:
        name:
          type: string
          x-stoplight:
            id: 4hcvfg9m00lsi
      additionalProperties: false
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: tg10dt7s0l6bw
          properties:
            error_type:
              type: string
              x-stoplight:
                id: wvq8c0qsym4hz
          required:
            - error_type
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    LoadState:
      title: LoadState
      x-stoplight:
        id: 4gkn8rmkg2f8b
      enum:
        - created
        - to_pickup
        - arrived_pickup
        - loaded
        - to_dropoff
        - arrived_dropoff
        - unloaded
        - completed
        - canceled
        - paused
      example: created
      default: created
      readOnly: true
    Equipment-Read-Typeahead:
      title: Equipment-Read-Typeahead
      x-stoplight:
        id: sv94osohm5xhg
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - equipment_type
            - external_id
            - equipment_id
          properties:
            name:
              type: string
              description: Equipment name
            equipment_type:
              $ref: '#/components/schemas/EquipmentType-Read-Nested'
            external_id:
              type: string
              x-stoplight:
                id: jrkz95htilck3
              nullable: true
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
            equipment_id:
              type: string
              x-stoplight:
                id: fkr9fkdtl996f
    EquipmentType-Read-Nested:
      title: EquipmentType-Read-Nested
      x-stoplight:
        id: em46i5kysysdh
      type: object
      required:
        - id
        - name
        - system
        - external_id
        - accounting_id
      properties:
        id:
          type: string
          x-stoplight:
            id: 835oy22o6h24z
          format: uuid
        name:
          type: string
          x-stoplight:
            id: tnszefd7lypln
        system:
          type: boolean
          x-stoplight:
            id: vimoqz5e8x6gx
        external_id:
          type: string
          x-stoplight:
            id: ttaijg77qmbgk
          nullable: true
        accounting_id:
          type: string
          x-stoplight:
            id: s4rscgptv68x3
          nullable: true
      additionalProperties: false
    CompanyShare-Read-Nested:
      title: CompanyShare-Read-Nested
      x-stoplight:
        id: makajouqsb7jq
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: s6h0nfzt2fjry
          required:
            - external_id
            - ticket_match_id
            - sender_company
            - dispatchable
            - schedule_on
            - rate_override
            - expires_at
          properties:
            external_id:
              type: string
              x-stoplight:
                id: c9ls3nrhbih3v
              nullable: true
            ticket_match_id:
              type: string
              x-stoplight:
                id: a1cd3nrhbih3v
              nullable: true
            sender_company:
              $ref: '#/components/schemas/Company-Read-Nested'
            dispatchable:
              type: boolean
              x-stoplight:
                id: kd884ihz6qi6w
            schedule_on:
              type: boolean
              x-stoplight:
                id: kd884ihz61234
            rate_override:
              type: boolean
              x-stoplight:
                id: mq4osazzielxo
            expires_at:
              type: string
              x-stoplight:
                id: aaa111jpq0ga9
              format: date-time
              description: ISO8601 timestamp with local timezone
              nullable: true
    Company-Read-Nested:
      title: Company-Read-Nested
      x-stoplight:
        id: cb2kn77qmf1l7
      description: Compact Company model for nested reads.
      allOf:
        - $ref: '#/components/schemas/Identifier'
          x-stoplight:
            id: jwsufva4znm91
        - $ref: '#/components/schemas/TreadId'
        - type: object
          properties:
            legal_name:
              type: string
              x-stoplight:
                id: yc10t8hieecwk
              description: The Company's name. Must be globally unique.
            company_type:
              $ref: '#/components/schemas/CompanyType'
          required:
            - legal_name
            - company_type
    TreadId:
      title: TreadId
      x-stoplight:
        id: 43k4t5tl359m4
      type: object
      required:
        - tread_id
      properties:
        tread_id:
          type: string
          x-stoplight:
            id: zi3ld7djflw6f
          pattern: ^[0-9A-F]{6}$
          minLength: 6
          maxLength: 6
          example: ABC123
          description: Tread ID
      additionalProperties: false
    CompanyType:
      title: CompanyType
      x-stoplight:
        id: dkzo7gjbtb1b3
      enum:
        - broker
        - contractor
        - hauler
        - owner_operator
        - producer
        - super
      example: hauler
      description: Company Type
  responses:
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````