> ## 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.

# Typeahead search on MaterialRates for a Company

> `search[site][query]` is a typeahead against the `MaterialRate`'s `Site`'s `name`



## OpenAPI

````yaml /api-reference/openapi.json get /v1/companies/{company-id}/material_rates/typeahead
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/companies/{company-id}/material_rates/typeahead:
    parameters:
      - schema:
          type: string
          format: uuid
        name: company-id
        in: path
        required: true
        description: Company ID
      - $ref: '#/components/parameters/Accept-Language'
    get:
      tags:
        - Typeaheads
        - MaterialRates
      summary: Typeahead search on MaterialRates for a Company
      description: >-
        `search[site][query]` is a typeahead against the `MaterialRate`'s
        `Site`'s `name`
      operationId: get-v1-companies-company-id-material_rates-typeahead
      parameters:
        - $ref: '#/components/parameters/page-limit'
        - $ref: '#/components/parameters/page-after'
        - $ref: '#/components/parameters/page-before'
        - $ref: '#/components/parameters/search-site-query'
        - $ref: '#/components/parameters/filter-customer_account_id'
        - $ref: '#/components/parameters/filter-project_id'
        - $ref: '#/components/parameters/filter-material_id'
        - $ref: '#/components/parameters/filter-site_id'
      responses:
        '200':
          description: OK
          headers:
            Link:
              schema:
                type: string
              description: Contains prev and next links for pagination
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: 5abtl41lpwhjr
                    items:
                      $ref: '#/components/schemas/MaterialRate-Read-Typeahead'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
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. 
    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
    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
    search-site-query:
      name: search[site][query]
      in: query
      required: false
      schema:
        type: string
      description: Search string for queries on Site
    filter-customer_account_id:
      name: filter[customer_account_id]
      in: query
      required: false
      schema:
        type: string
        format: uuid
      description: The associated Customer Account ID
    filter-project_id:
      name: filter[project_id]
      in: query
      required: false
      schema:
        type: string
      description: Project ID filter
    filter-material_id:
      name: filter[material_id]
      in: query
      required: false
      schema:
        type: string
        format: uuid
      description: The associated Material ID
    filter-site_id:
      name: filter[site_id]
      in: query
      required: false
      schema:
        type: string
        format: uuid
      description: The associated Site ID
  schemas:
    MaterialRate-Read-Typeahead:
      title: MaterialRate-Read-Typeahead
      x-stoplight:
        id: n7ssu2zszdqgx
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - sell_price
            - buy_price
            - unit_of_measure
          properties:
            sell_price:
              type: string
              x-stoplight:
                id: dskmpvrizqinj
              nullable: true
            buy_price:
              type: string
              x-stoplight:
                id: w107s2wjkvowa
              nullable: true
            unit_of_measure:
              $ref: '#/components/schemas/NullableOrderUnitOfMeasure'
            site:
              $ref: '#/components/schemas/Site-Read-Typeahead'
            material:
              $ref: '#/components/schemas/Material-Read-Typeahead'
            project:
              $ref: '#/components/schemas/Project-Read-Typeahead'
            customer_account:
              $ref: '#/components/schemas/Account-Read-Typeahead'
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    NullableOrderUnitOfMeasure:
      title: NullableOrderUnitOfMeasure
      x-stoplight:
        id: rtlna368z495u
      allOf:
        - $ref: '#/components/schemas/OrderUnitOfMeasure'
      type: string
      nullable: true
    Site-Read-Typeahead:
      title: Site-Read-Typeahead
      x-stoplight:
        id: wnzkdq5df4apa
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - external_id
          properties:
            name:
              type: string
              description: Site name
            company_share:
              $ref: '#/components/schemas/CompanyShare-Read-Nested'
            external_id:
              type: string
              x-stoplight:
                id: tt6lx8lw29aiu
              nullable: true
    Material-Read-Typeahead:
      title: Material-Read-Typeahead
      x-stoplight:
        id: 30glh3las0ydb
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - external_id
          properties:
            name:
              type: string
              description: Material name
            external_id:
              type: string
              description: Material external_id
              x-stoplight:
                id: ml0l0yvuz5u6d
              nullable: true
    Project-Read-Typeahead:
      title: Project-Read-Typeahead
      x-stoplight:
        id: 3wdg6ghyvsknb
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - external_id
          properties:
            name:
              type: string
              description: Project name
            external_id:
              type: string
              x-stoplight:
                id: 7kipqxvhrgvk0
              nullable: true
    Account-Read-Typeahead:
      title: Account-Read-Typeahead
      x-stoplight:
        id: 0jtlv216ot4og
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          x-stoplight:
            id: zinx4pmrlrvkg
          required:
            - name
            - schedule_on
          properties:
            name:
              type: string
              x-stoplight:
                id: 675oqyzkv2xvp
              description: Account name
            connected_company:
              type: object
              x-stoplight:
                id: 9e36j656fhsso
              required:
                - id
              properties:
                id:
                  type: string
                  x-stoplight:
                    id: 8nxy7z0w3h51m
                  format: uuid
            schedule_on:
              type: boolean
              x-stoplight:
                id: 4yv7e5z57qmn2
      x-internal: true
    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
    OrderUnitOfMeasure:
      title: OrderUnitOfMeasure
      x-stoplight:
        id: kahcgn7w8swdv
      enum:
        - Load
        - Tonne
        - Ton
        - Yard
        - Meter
        - Foot
        - Liter
        - Hour
        - Bushel
        - Gallon
        - CubicMeter
        - Mile
        - Kilometer
        - Barrel
        - Bag
        - Pallet
      example: Load
    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
    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
    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

````