> ## 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 Sites based on the current Dispatch results

> Returns `Sites`, but instead of all `Sites` for a `Company` this returns all `Sites` that are associated to the dispatch list, where the dispatch list is defined by the `filter` and `search` inputs.




## OpenAPI

````yaml /api-reference/openapi.json get /v1/sites/dispatch
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/sites/dispatch:
    parameters:
      - 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. 
    get:
      tags:
        - Typeaheads
        - Sites
      summary: Retrieve Sites based on the current Dispatch results
      description: >
        Returns `Sites`, but instead of all `Sites` for a `Company` this returns
        all `Sites` that are associated to the dispatch list, where the dispatch
        list is defined by the `filter` and `search` inputs.
      operationId: get-v1-sites-dispatch-index
      parameters:
        - $ref: '#/components/parameters/filter-dispatch_number_ids'
        - $ref: '#/components/parameters/filter-job-company_ids'
        - $ref: '#/components/parameters/filter-job-customer_account_ids'
        - $ref: '#/components/parameters/filter-job-driver_ids'
        - $ref: '#/components/parameters/filter-job-dropoff_site_ids'
        - $ref: '#/components/parameters/filter-job-end_date'
        - $ref: '#/components/parameters/filter-job-equipment_ids'
        - $ref: '#/components/parameters/filter-job-external_ids'
        - $ref: '#/components/parameters/filter-job-material_ids'
        - $ref: '#/components/parameters/filter-job-pickup_site_ids'
        - $ref: '#/components/parameters/filter-job-project_ids'
        - $ref: '#/components/parameters/filter-job-service_ids'
        - $ref: '#/components/parameters/filter-job-site_types'
        - $ref: '#/components/parameters/filter-job-start_date'
        - $ref: '#/components/parameters/filter-job-states'
        - $ref: '#/components/parameters/filter-job-vendor_account_ids'
        - $ref: '#/components/parameters/search-job-datagrid'
        - $ref: '#/components/parameters/page-after'
        - $ref: '#/components/parameters/page-before'
        - $ref: '#/components/parameters/page-limit'
        - $ref: '#/components/parameters/facet-search-query'
        - $ref: '#/components/parameters/facet-filter-waypoint-type'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Site-Read'
                required:
                  - data
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
components:
  parameters:
    filter-dispatch_number_ids:
      name: filter[dispatch_number_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated DispatchNumber IDs
    filter-job-company_ids:
      name: filter[job][company_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Company IDs for the Job
    filter-job-customer_account_ids:
      name: filter[job][customer_account_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Customer Account IDs for the Job
    filter-job-driver_ids:
      name: filter[job][driver_ids]
      in: query
      required: false
      schema:
        type: array
      description: The assigned Driver IDs for the Job
    filter-job-dropoff_site_ids:
      name: filter[job][dropoff_site_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Dropoff Site IDs for the Job
    filter-job-end_date:
      name: filter[job][end_date]
      in: query
      required: false
      schema:
        type: string
      description: End date range for Job.job_start_at
    filter-job-equipment_ids:
      name: filter[job][equipment_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Equipment IDs for the Job
    filter-job-external_ids:
      name: filter[job][external_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated External Project IDs for the Job
    filter-job-material_ids:
      name: filter[job][material_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Material IDs for the Job
    filter-job-pickup_site_ids:
      name: filter[job][pickup_site_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Pickup Site IDs for the Job
    filter-job-project_ids:
      name: filter[job][project_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Project IDs for the Job
    filter-job-service_ids:
      name: filter[job][service_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Service IDs for the Job
    filter-job-site_types:
      name: filter[job][site_types]
      in: query
      required: false
      schema:
        type: array
      description: >-
        SiteType enum filters for the Job (see SiteType enum for the list of
        values)
    filter-job-start_date:
      name: filter[job][start_date]
      in: query
      required: false
      schema:
        type: string
      description: Start date range for Job.job_start_at
    filter-job-states:
      name: filter[job][states]
      in: query
      required: false
      schema:
        type: array
      description: Job states
    filter-job-vendor_account_ids:
      name: filter[job][vendor_account_ids]
      in: query
      required: false
      schema:
        type: array
      description: The associated Vendor Account IDs for the Job
    search-job-datagrid:
      name: search[job][datagrid]
      in: query
      required: false
      schema:
        type: string
      description: Search string for datagrid queries
    page-after:
      name: page[after]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to start paginating after
    page-before:
      name: page[before]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to stop paginating at
    page-limit:
      name: page[limit]
      in: query
      schema:
        type: integer
        format: int32
        default: 25
        maximum: 100
      description: The maximum number of paginated results to return
    facet-search-query:
      name: facet[search][query]
      in: query
      required: false
      schema:
        type: string
      description: The typeahead search query. Matches on the models's `name` field
    facet-filter-waypoint-type:
      name: facet[filter][waypoint][type]
      in: query
      required: false
      schema:
        type: string
        enum:
          - pickup
          - drop_off
      description: A Waypoint type to filter on. Can be omitted to return all.
  schemas:
    Site-Read:
      title: Site-Read
      x-stoplight:
        id: d3bw9em1ibuq1
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - company
            - name
            - lat
            - lon
            - notes
            - state
            - external_id
            - full_address
            - routable
          properties:
            company:
              $ref: '#/components/schemas/Company-Read-Nested'
            address:
              $ref: '#/components/schemas/Address-Read-Nested'
            name:
              type: string
              x-stoplight:
                id: qetgw5ugccnx3
            lat:
              type: string
              x-stoplight:
                id: f85y4jij1rblz
              nullable: true
            lon:
              type: string
              x-stoplight:
                id: 12zny9anzmdv1
              nullable: true
            site_type:
              $ref: '#/components/schemas/SiteType'
            notes:
              type: string
              x-stoplight:
                id: x8fcflv4sr9qu
              nullable: true
            state:
              $ref: '#/components/schemas/SiteState'
            next_billion_geofence:
              $ref: '#/components/schemas/NextBillionGeofence-Read'
            external_id:
              type: string
              x-stoplight:
                id: 89q7a12oipvs7
              nullable: true
            full_address:
              type: string
              x-stoplight:
                id: 5yo2vmvrpdqhs
              nullable: true
            routable:
              type: boolean
              x-stoplight:
                id: 1wpkny0oz7ju1
            moving_site:
              $ref: '#/components/schemas/MovingSite-Read'
            department:
              $ref: '#/components/schemas/Department-Read-Nested'
            contacts:
              type: array
              x-stoplight:
                id: iln7bn31b1mdo
              items:
                $ref: '#/components/schemas/Contact-Read-Nested'
            editable:
              type: boolean
              description: Whether the current user can edit this site
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
        - $ref: '#/components/schemas/Timestamps'
        - $ref: '#/components/schemas/Discardable'
      x-tags:
        - Sites
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    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
    Address-Read-Nested:
      title: Address-Read-Nested
      x-stoplight:
        id: cvym2dzuo375q
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Address-Read'
    SiteType:
      title: SiteType
      x-stoplight:
        id: 31h267btxh667
      enum:
        - Plant
        - Quarry
        - JobSite
        - Depot
        - Other
        - Daily
        - EquipmentHomeBase
      example: Plant
    SiteState:
      title: SiteState
      x-stoplight:
        id: tk96rwiactdrj
      enum:
        - active
        - inactive
      default: active
      description: ''
    NextBillionGeofence-Read:
      title: NextBillionGeofence-Read
      x-stoplight:
        id: 60y0z4bb3pu6m
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Geofence-Data'
    MovingSite-Read:
      title: MovingSite-Read
      x-stoplight:
        id: yaf7dbodbspna
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Timestamps'
        - type: object
          x-stoplight:
            id: tf4brd0yshw5e
          required:
            - equipment_id
            - site_id
            - polling_interval_seconds
          properties:
            equipment_id:
              type: string
              x-stoplight:
                id: bucjeefefqu2t
              format: uuid
            site_id:
              type: string
              x-stoplight:
                id: nxcmrn80s2rqj
              format: uuid
            polling_interval_seconds:
              type: integer
              x-stoplight:
                id: 72glfhxls2dqw
    Department-Read-Nested:
      title: Department-Read-Nested
      x-stoplight:
        id: gv9tfg4scr2yx
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: 4y3gfdgq1brqf
          properties:
            name:
              type: string
              x-stoplight:
                id: 3718c2tvwwqsn
              description: Department name.
          required:
            - name
    Contact-Read-Nested:
      title: Contact-Read-Nested
      x-stoplight:
        id: 3u6d8qhsz5ehn
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - email
            - phone
          properties:
            name:
              type: string
              x-stoplight:
                id: sd80y9pbgvkok
              nullable: true
            email:
              type: string
              x-stoplight:
                id: 883fmt34pdeaj
              nullable: true
            phone:
              type: string
              x-stoplight:
                id: wdtqyju4t4u06
              example: '+18885551234'
              nullable: true
      description: ''
    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
    Timestamps:
      title: Timestamps
      x-stoplight:
        id: t82ecgfu0oj00
      type: object
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          x-stoplight:
            id: gjj950jpq0ga9
          format: date-time
          description: ISO8601 timestamp with local timezone
        updated_at:
          type: string
          x-stoplight:
            id: bwcuyfwc7aj0e
          format: date-time
          description: ISO8601 timestamp with local timezone
      additionalProperties: false
    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
    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
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
    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
    Address-Read:
      title: Address-Read
      x-stoplight:
        id: v1mcd2qgns2tf
      type: object
      required:
        - thoroughfare
        - premise
        - locality
        - administrative_area
        - postal_code
        - country
        - lat
        - lon
        - place_id
      properties:
        thoroughfare:
          type: string
          x-stoplight:
            id: 8wrr7qkc9ilqn
        premise:
          type: string
          x-stoplight:
            id: z4jth408out1q
          nullable: true
        locality:
          type: string
          x-stoplight:
            id: kfby6wqpgvxbz
        administrative_area:
          type: string
          x-stoplight:
            id: c9bkrloxf4t8d
        postal_code:
          type: string
          x-stoplight:
            id: 7zq51k1mof3o3
        country:
          type: string
          x-stoplight:
            id: iydw9q619ya01
          pattern: ^[A-Z]{2}
          example: US
          minLength: 2
          maxLength: 2
        lat:
          type: string
          x-stoplight:
            id: kqu1qtf9rivh1
          description: |-
            latitude of the `Address`. 

            Must be a stringified number between -90 and 90 inclusive.

            Required if `lon` is present.
          nullable: true
        lon:
          type: string
          x-stoplight:
            id: oly2yabkzpk9g
          description: |-
            longitude of the `Address`. 

            Must be a stringified number between -180 and 180 inclusive.

            Required if `lat` is present.
          nullable: true
        place_id:
          type: string
          x-stoplight:
            id: im1fdq7qqxdij
          description: NextBillion placeID
          nullable: true
      additionalProperties: false
    Geofence-Data:
      title: Geofence-Data
      x-stoplight:
        id: ay73k76oae8gm
      type: object
      properties:
        id:
          type: string
          format: uuid
          x-stoplight:
            id: m9n8p7q6r5s4t
          description: NextBillionGeofence ID
        geofence:
          type: object
          x-stoplight:
            id: bo67u046r1ibk
          required:
            - name
            - type
          properties:
            id:
              type: string
              x-stoplight:
                id: nm2o97jli2zqm
              format: uuid
              description: NextBillion Geofence ID
            name:
              type: string
              x-stoplight:
                id: x5sp8wq8d2ack
            type:
              type: string
              x-stoplight:
                id: d91rv1gbtfkm0
              description: '`circle` or `polygon`'
            geojson:
              type: object
              x-stoplight:
                id: vk7dx7ipdbuxa
              required:
                - type
                - coordinates
              properties:
                type:
                  type: string
                  x-stoplight:
                    id: 65qatpxdox3e9
                  description: type should be `Polygon`
                coordinates:
                  type: array
                  x-stoplight:
                    id: 3an8g587wblcs
                  description: >-
                    This should be an enclosed polygon.


                    Example format:

                    [[[-118.226140484,34.048200454],[-118.22616052,34.046872766],[-118.226198738,34.04952736],[-118.226140484,34.048200454]]]
                  items:
                    x-stoplight:
                      id: 2kltvjxl5xks6
                    type: array
                    items:
                      x-stoplight:
                        id: k93dt39dghru4
                      type: array
                      items: {}
            circle_center:
              type: object
              x-stoplight:
                id: 6xr3h683f7cl9
              required:
                - lat
                - lon
              properties:
                lat:
                  type: number
                  x-stoplight:
                    id: y70xc1ptapv1g
                lon:
                  type: number
                  x-stoplight:
                    id: uy3twrpcueq9m
            circle_radius:
              type: number
              x-stoplight:
                id: qrnq301sqfl3d
            tag:
              x-stoplight:
                id: debfy3x1l48zc
              enum:
                - pickup
                - loading
                - drop_off
                - unloading
                - check_in
                - scaling
                - ticketing
              deprecated: true
        moving_geofence:
          type: boolean
          x-stoplight:
            id: y15533dbr62js
          default: false
        tag:
          $ref: '#/components/schemas/GeofenceTag'
        geofence_type:
          $ref: '#/components/schemas/NullableGeofenceType'
      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
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: m4ul9vcq2deh6
              items:
                $ref: '#/components/schemas/ModelError-Item'
    GeofenceTag:
      title: GeofenceTag
      x-stoplight:
        id: anytkmb3ydi6c
      enum:
        - scaling
        - site
        - loading
        - unloading
        - check_in
        - ticketing
    NullableGeofenceType:
      title: NullableGeofenceType
      x-stoplight:
        id: ii94t82oqh5xo
      allOf:
        - $ref: '#/components/schemas/GeofenceType'
      nullable: true
      type: string
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
        - model
        - field
        - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
    GeofenceType:
      title: GeofenceType
      x-stoplight:
        id: geahowr9r8ly1
      nullable: true
      enum:
        - moving
        - circle
        - polygon
      readOnly: true
  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
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````