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

# Search dispatch preferences

> Search dispatch preferences with paginated POST filters, returning the routing, equipment, home-time, and lane preferences configured for drivers.

This endpoint provides detailed information about dispatch preferences that match the search criteria, enabling efficient tracking and management of dispatcher, driver, truck, and trailer assignments.

### Request Parameters

The following parameter is required in the URL path:

| Parameter | Type   | Required | Description             |
| --------- | ------ | -------- | ----------------------- |
| version   | String | Yes      | The API version to use. |

#### Request Body Parameters

The following parameters are required in the request body:

| Parameter      | Type              | Required | Description                                              |
| -------------- | ----------------- | -------- | -------------------------------------------------------- |
| DispatcherIds  | Array of Strings  | No       | A list of dispatcher IDs to filter results.              |
| DriverIds      | Array of Strings  | No       | A list of driver IDs to filter results.                  |
| TruckIds       | Array of Strings  | No       | A list of truck IDs to filter results.                   |
| TrailerIds     | Array of Strings  | No       | A list of trailer IDs to filter results.                 |
| UpdatedAtStart | String (DateTime) | No       | The start date-time for filtering updated dispatch data. |
| UpdatedAtEnd   | String (DateTime) | No       | The end date-time for filtering updated dispatch data.   |

#### Example CURL request

Use the current API version number and ensure you replace the Authorization header value with your actual Bearer token for the request:

```bash theme={null}
curl --location 'https://integrations.alvys.com/api/p/v1/dispatchpreferences/search' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ...' \
--header 'Content-Type: application/json' \
--data '{
  "DispatcherIds": ["2c551c41c840410ebcf34ba388749258"],
  "DriverIds": ["DR2517197559590084753"],
  "TruckIds": ["TR2517389363484408036"],
  "TrailerIds": ["TL2517274420190288696"],
  "UpdatedAtStart": "2025-03-01T00:00:00.000Z",
  "UpdatedAtEnd": "2025-03-03T23:59:59.999Z"
}'
```

### Response Parameters

The following table lists the parameters included in the response for dispatch preferences requests.

| Parameter    | Type              | Required | Description                                                  |
| ------------ | ----------------- | -------- | ------------------------------------------------------------ |
| UpdatedAt    | String (DateTime) | No       | The timestamp when the dispatch preference was last updated. |
| DispatcherId | String            | No       | The unique identifier of the dispatcher.                     |
| Driver1Id    | String            | No       | The unique identifier of the primary driver.                 |
| Driver2Id    | String            | No       | The unique identifier of the secondary driver.               |
| TruckId      | String            | No       | The unique identifier of the truck.                          |
| TrailerId    | String            | No       | The unique identifier of the trailer.                        |

#### Versioning

The version parameter in the URL path specifies which version of the API you are using. Including the version number ensures that your application interacts with the correct version of the API, providing stability and compatibility as the API evolves. For more information on how versioning works and how to include it in your requests, please refer to the [Versioning](/docs/versioning) page.

#### Example Response

```json theme={null}
[
  {
    "UpdatedAt": "2025-03-02T14:30:05+00:00",
    "DispatcherId": "2c551c41c840410ebcf34ba388749258",
    "Driver1Id": "DR2517197559590084753",
    "Driver2Id": "DR2518197559590084765",
    "TruckId": "TR2517389363484408036",
    "TrailerId": "TL2517274420190288696"
  },
  {
    "UpdatedAt": "2025-03-02T16:45:10+00:00",
    "DispatcherId": "3d671c41c840410ebcf34ba388749275",
    "Driver1Id": "DR2527197559590084754",
    "Driver2Id": "",
    "TruckId": "TR2527389363484408047",
    "TrailerId": "TL2527274420190288799"
  }
]
```

#### Rate Limits

All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the [Rate Limits](/docs/rate-limits) section.

This page is interactive, allowing you to try a request by specifying the API version in the URL path and providing the necessary request body. As you fill out the parameters, the Curl command on the right side of the page will be automatically updated. Alternatively, you can fork our [Public API Postman Collection](https://app.getpostman.com/run-collection/39138316-54c493c3-15e5-4fd7-a651-6e45b308548f?action=collection%2Ffork\&source=rip_markdown\&collection-url=entityId%3D39138316-54c493c3-15e5-4fd7-a651-6e45b308548f%26entityType%3Dcollection%26workspaceId%3Dc0255544-5964-4c52-9d24-05b30a9b021c) directly. Make sure to authorize yourself before trying a request.


## OpenAPI

````yaml POST /api/p/v{version}/dispatchpreferences/search
openapi: 3.0.1
info:
  title: Alvys
  description: >-
    Alvys provides a robust set of REST APIs to allow you to integrate Alvys
    into virtually any platform. These APIs cover most of Alvys' major product
    areas with additional endpoints being added regularly based on customer
    requests.
  contact:
    name: Alvys Support
    url: https://www.alvys.com/resources/contact/
  version: v1
servers:
  - url: https://integrations.alvys.com
    description: Public API Server
  - url: https://api.alvys.com/
    description: Public API Server
security:
  - Public: []
tags:
  - name: Authentication
    description: Obtain an OAuth 2.0 access token for the Alvys Public API.
  - name: Carrier Settlement Statements
    description: >-
      Search carrier settlement statements and retrieve a single statement by
      number.
  - name: Carriers
    description: Read carrier records, search carriers, and manage carrier documents.
  - name: Customers
    description: Create, read, update, delete, and search customer records.
  - name: Deductions
    description: >-
      Create one-time deductions and search or delete existing deduction
      records.
  - name: DispatchPreferences
    description: Dispatch preferences endpoints for reading dispatch rules and preferences.
  - name: Driver Settlement Statements
    description: >-
      Search driver settlement statements and retrieve a single statement by
      number.
  - name: Drivers
    description: >-
      Read driver records, search drivers and driver events, and manage driver
      documents.
  - name: Fuel
    description: Read and search fuel transactions.
  - name: Invoices
    description: >-
      Read invoices, create carrier invoices, and record carrier and customer
      payments.
  - name: Loads
    description: Read, update, search loads, and manage load documents and notes.
  - name: Locations
    description: Read and search company location details.
  - name: Maintenance
    description: Read and search maintenance records.
  - name: Tenders
    description: Create, accept, reject, cancel, update, and search inbound EDI tenders.
  - name: Tolls
    description: Read and search toll transactions.
  - name: Trailers
    description: Read trailers, search trailer events, and manage trailer documents.
  - name: Trips
    description: >-
      Read, search trips, manage trip documents, and record stop appointments,
      arrivals, and departures.
  - name: Trucks
    description: Read trucks, search truck events, and manage truck documents.
  - name: Users
    description: List and search users.
  - name: Visibility
    description: >-
      Read inbound and outbound visibility history and search outbound
      visibility errors.
  - name: Webhooks
    description: >-
      Create, read, update, delete, enable, disable, verify, test, and rotate
      secrets for webhook subscriptions; read event types, delivery logs, and
      health metrics.
paths:
  /api/p/v{version}/dispatchpreferences/search:
    post:
      tags:
        - DispatchPreferences
      summary: Search dispatch preferences
      parameters:
        - name: version
          in: path
          description: API version (e.g., 1.0)
          required: true
          schema:
            type: string
            default: '1.0'
            example: '1.0'
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.AssignmentPreferences.Request.DispatchPreferenceSearchRequest
          application/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.AssignmentPreferences.Request.DispatchPreferenceSearchRequest
          text/json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.AssignmentPreferences.Request.DispatchPreferenceSearchRequest
          application/*+json:
            schema:
              allOf:
                - $ref: >-
                    #/components/schemas/Alvys.Models.AssignmentPreferences.Request.DispatchPreferenceSearchRequest
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/Alvys.Models.AssignmentPreferences.Response.DispatchPreferenceResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails'
      security:
        - Public: []
components:
  schemas:
    Alvys.Models.AssignmentPreferences.Request.DispatchPreferenceSearchRequest:
      type: object
      properties:
        DispatcherIds:
          type: array
          items:
            type: string
          nullable: true
        DriverIds:
          type: array
          items:
            type: string
          nullable: true
        TruckIds:
          type: array
          items:
            type: string
          nullable: true
        TrailerIds:
          type: array
          items:
            type: string
          nullable: true
        UpdatedAtStart:
          type: string
          format: date-time
          nullable: true
        UpdatedAtEnd:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
    Alvys.Models.AssignmentPreferences.Response.DispatchPreferenceResponse:
      required:
        - UpdatedAt
      type: object
      properties:
        UpdatedAt:
          type: string
          format: date-time
        DispatcherId:
          type: string
          nullable: true
        Driver1Id:
          type: string
          nullable: true
        Driver2Id:
          type: string
          nullable: true
        TruckId:
          type: string
          nullable: true
        TrailerId:
          type: string
          nullable: true
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ProblemDetails:
      type: object
      properties:
        Type:
          type: string
          nullable: true
        Title:
          type: string
          nullable: true
        Status:
          type: integer
          format: int32
          nullable: true
        Detail:
          type: string
          nullable: true
        Instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    Public:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OAuth 2.0 client-credentials access token. Obtain one from
        https://auth.alvys.com/oauth/token (grant_type=client_credentials,
        audience=https://api.alvys.com/public/), then paste it here. The
        playground sends it as `Authorization: Bearer <token>`.

````