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

> Search Alvys drivers with paginated POST filters — name, status, home terminal, license class, hire date range, current truck, and pay setup.

This endpoint provides detailed information about each driver that matches the search criteria, facilitating efficient management and retrieval of driver records. The endpoint requires specifying the API version in the URL path. This 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.

#### Request Parameters

The following parameter is required in the URL path:

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

#### Body Request

The following fields can be included in the request body to filter the search results:

`<Table align={["left","left","left","left"]}>`

<thead>
  <tr>
    <th>
      Parameter
    </th>

    <th>
      Type
    </th>

    <th>
      Required
    </th>

    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Page
    </td>

    <td>
      Integer
    </td>

    <td>
      Yes
    </td>

    <td>
      The page number to retrieve.
    </td>
  </tr>

  <tr>
    <td>
      PageSize
    </td>

    <td>
      Integer
    </td>

    <td>
      Yes
    </td>

    <td>
      The number of results per page.
      PageSize must be greater than 0.
    </td>
  </tr>

  <tr>
    <td>
      Status
    </td>

    <td>
      Array of Strings
    </td>

    <td>
      Conditionally
    </td>

    <td>
      A list of statuses to filter by. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      Name
    </td>

    <td>
      String
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The name of the driver to search for. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      EmployeeId
    </td>

    <td>
      String
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The employee ID of the driver to search for. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      FleetName
    </td>

    <td>
      String
    </td>

    <td>
      Conditionally
    </td>

    <td>
      The fleet name associated with the driver. This field is required if the other conditionally required fields are left empty.
    </td>
  </tr>

  <tr>
    <td>
      IsActive
    </td>

    <td>
      Boolean
    </td>

    <td>
      Conditionally
    </td>

    <td>
      Whether to filter by active drivers.
    </td>
  </tr>
</tbody>

`</Table>`

#### Example CURL request

Use the Current API version number and make sure to 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/drivers/search' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkplA' \
--header 'Content-Type: application/json' \
--data '{
  "Page": 0,
  "PageSize": 50,
  "Status": [
    "OFF DUTY"
  ],
  "Name": "",
  "EmployeeId": "",
  "FleetName": "",
  "IsActive": true
}'
```

#### Response Parameters

The following table lists the parameters included in the response for driver search requests:

| Parameter         | Type               | Description                                                                                                 |
| :---------------- | :----------------- | :---------------------------------------------------------------------------------------------------------- |
| Page              | Integer            | The current page number of the results.                                                                     |
| PageSize          | Integer            | The number of results per page.                                                                             |
| Total             | Integer            | The total number of matching drivers.                                                                       |
| Id                | String             | The unique identifier of the driver.                                                                        |
| EmployeeId        | String             | The employee ID of the driver.                                                                              |
| PhoneNumber       | String             | The phone number of the driver.                                                                             |
| UserId            | String             | The user ID associated with the driver.                                                                     |
| Email             | String             | The email address of the driver.                                                                            |
| Name              | String             | The name of the driver.                                                                                     |
| Type              | String             | The type of driver (COMPANY, OWNER\_OPERATOR, CONTRACTOR, EXTERNAL).                                        |
| SubsidiaryId      | String             | The subsidiary ID to which the driver belongs.                                                              |
| Address           | Object             | The address details of the driver.                                                                          |
| Address.Street    | String             | The street address of the driver.                                                                           |
| Address.City      | String             | The city of the driver's address.                                                                           |
| Address.State     | String             | The state of the driver's address.                                                                          |
| Address.ZipCode   | String             | The zip code of the driver's address.                                                                       |
| Status            | String             | The current status of the driver (e.g., "SLEEPING", "DRIVING", "ON DUTY", "OFF DUTY", "ONLINE", "OFFLINE"). |
| IsActive          | Boolean            | Indicates if the driver is currently active.                                                                |
| LicenseNum        | String             | The driver's license number.                                                                                |
| LicenseState      | String             | The state that issued the driver's license.                                                                 |
| LicenseCountry    | String             | The country where the driver's license was issued (USA, Canada, Mexico).                                    |
| LicenseExpiresAt  | String (Date-Time) | The expiration date of the driver's license.                                                                |
| MedicalExpiresAt  | String (Date-Time) | The expiration date of the driver's medical certificate.                                                    |
| HiredAt           | String (Date-Time) | The date when the driver was hired.                                                                         |
| TerminatedAt      | String (Date-Time) | The date when the driver was terminated, if applicable.                                                     |
| Notes             | Array              | An optional list of notes related to the driver.                                                            |
| Notes.id          | String             | The unique identifier of the note.                                                                          |
| Notes.Description | String             | The description of the note.                                                                                |
| Notes.NoteType    | String             | The type of the note.                                                                                       |
| Notes.Time        | String (Date-Time) | The time the note was created.                                                                              |
| Notes.User        | String             | The user who created the note.                                                                              |
| Fleet             | Object             | The fleet information associated with the driver.                                                           |
| Fleet.Id          | String             | The unique identifier of the fleet.                                                                         |
| Fleet.Name        | String             | The name of the fleet.                                                                                      |
| References        | Array              | An optional list of custom references associated with the driver.                                           |
| CreatedAt         | String (Date-Time) | The date and time when the driver was created in Alvys.                                                     |

#### Example Response

On the right side, you can see examples of different error codes by clicking "Example" and selecting the response code.

<img src="https://mintcdn.com/alvys/MPqgFq1pceM5E4R4/images/migrated/974ba0e-Sear.gif?s=caaeef4919c6ef666264bdbef980a762" alt="" width="706" height="766" data-path="images/migrated/974ba0e-Sear.gif" />

#### 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. As you fill out the parameters, the Curl command on the right side of the page will be automatically updated. Alternatively, you can directly edit the Curl command. Make sure to authorize yourself before trying a request.


## OpenAPI

````yaml POST /api/p/v{version}/drivers/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}/drivers/search:
    post:
      tags:
        - Drivers
      summary: Search drivers
      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.Users.DriverSearchRequest'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Users.DriverSearchRequest'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Users.DriverSearchRequest'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Alvys.Models.Users.DriverSearchRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Alvys.Helpers.PagedResponse1DriverResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails
        '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'
        '404':
          description: Not Found
          content:
            application/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.Users.DriverSearchRequest:
      required:
        - Page
        - PageSize
      type: object
      properties:
        Page:
          type: integer
          format: int32
        PageSize:
          type: integer
          format: int32
        Status:
          type: array
          items:
            type: string
          nullable: true
        Name:
          type: string
          nullable: true
        EmployeeId:
          type: string
          nullable: true
        FleetName:
          type: string
          nullable: true
        IsActive:
          type: boolean
          nullable: true
      additionalProperties: false
    Alvys.Helpers.PagedResponse1DriverResponse:
      required:
        - Items
        - Page
        - PageSize
        - Total
      type: object
      properties:
        Page:
          type: integer
          format: int32
        PageSize:
          type: integer
          format: int32
        Facets:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/Alvys.Helpers.ResultSetFacetItem'
          nullable: true
        Total:
          type: integer
          format: int64
        Items:
          type: array
          items:
            $ref: '#/components/schemas/DriverResponse'
      additionalProperties: false
    Microsoft.AspNetCore.Mvc.ValidationProblemDetails:
      required:
        - Errors
      type: object
      properties:
        Errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        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: {}
    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: {}
    Alvys.Helpers.ResultSetFacetItem:
      required:
        - Count
        - Value
      type: object
      properties:
        Value:
          type: string
        Count:
          type: integer
          format: int64
      additionalProperties: false
    DriverResponse:
      required:
        - CreatedAt
        - Id
        - IsActive
        - Name
        - Notes
        - Status
        - SubsidiaryId
        - Type
      type: object
      properties:
        Id:
          type: string
        EmployeeId:
          type: string
          nullable: true
        PhoneNumber:
          type: string
          nullable: true
        UserId:
          type: string
          nullable: true
        Email:
          type: string
          nullable: true
        Name:
          type: string
        Type:
          type: string
        SubsidiaryId:
          type: string
        Address:
          allOf:
            - $ref: '#/components/schemas/Alvys.Features.Locations.ShortAddress'
          nullable: true
        Status:
          type: string
        LicenseNum:
          type: string
          nullable: true
        LicenseState:
          type: string
          nullable: true
        LicenseCountry:
          type: string
          nullable: true
        LicenseExpiresAt:
          type: string
          format: date-time
          nullable: true
        MedicalExpiresAt:
          type: string
          format: date-time
          nullable: true
        HiredAt:
          type: string
          format: date-time
          nullable: true
        TerminatedAt:
          type: string
          format: date-time
          nullable: true
        Notes:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.Notes.NoteDto'
        Fleet:
          allOf:
            - $ref: '#/components/schemas/FleetResponse'
          nullable: true
        CreatedAt:
          type: string
          format: date-time
        IsActive:
          type: boolean
        References:
          type: array
          items:
            $ref: '#/components/schemas/Alvys.Models.References.ReferenceResponse'
          nullable: true
      additionalProperties: false
    Alvys.Features.Locations.ShortAddress:
      required:
        - City
        - State
        - Street
        - ZipCode
      type: object
      properties:
        Street:
          type: string
        City:
          type: string
        State:
          type: string
        ZipCode:
          type: string
      additionalProperties: false
    Alvys.Models.Notes.NoteDto:
      required:
        - Description
        - id
        - NoteType
        - User
      type: object
      properties:
        id:
          type: string
        Description:
          type: string
        NoteType:
          type: string
        Time:
          type: string
          format: date-time
          nullable: true
        User:
          type: string
        UserId:
          type: string
          nullable: true
      additionalProperties: false
    FleetResponse:
      type: object
      properties:
        Id:
          type: string
          nullable: true
        Name:
          type: string
          nullable: true
        InvoiceNumberPrefix:
          type: string
          nullable: true
      additionalProperties: false
    Alvys.Models.References.ReferenceResponse:
      required:
        - Name
        - Value
      type: object
      properties:
        Id:
          type: string
          nullable: true
        ReferenceId:
          type: string
          nullable: true
        Name:
          type: string
        Value:
          type: string
        Type:
          type: string
          nullable: true
        Access:
          type: string
          nullable: true
        Origin:
          type: string
          nullable: true
      additionalProperties: false
  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>`.

````