---
title: "Retrieve all drivers in the account."
url: "https://developers.vzconnect.com/apis/driver-api/versions/dd59d93e-671c-494a-b1e2-63fbd7c9d7da/operations/getDrivers"
---

> Full API specification: https://developers.vzconnect.com/apis/driver-api/versions/dd59d93e-671c-494a-b1e2-63fbd7c9d7da.md

# Retrieve all drivers in the account.

`GET` `/cmd/v1/drivers`

Operation ID: `getDrivers`

Retrieve Driver data by calling for all drivers within an account. Optionally filter by key fob id or driver id; a filtered call returns a single driver. The returned response is restricted to the REVEAL account's data plan.

## Query parameters

- `keyfobid` (string, optional) - Optional key fob id in hexadecimal format (8, 12 or 16 characters). When supplied, only the driver assigned to that key fob is returned. Takes precedence over driverId if both are supplied. A key fob id that is invalid or not assigned to a driver does not return an empty list; the request fails.
- `driverId` (integer, int32, optional) - Optional driver id. When supplied (and keyfobid is not), only the driver with that id is returned. A driver id that is invalid or not found does not return an empty list; the request fails.

## Responses

- `200` - Successfully retrieved the list of drivers.
- `204` - No drivers exist in the account. Only returned when no filter is supplied. The response has no body.
- `400` - Bad request. The request parameters are invalid.
- `401` - Unauthorized. Authentication credentials are missing or invalid.
- `500` - Internal server error.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Driver API
  version: "1.0"
servers:
  - url: https://api.us.vzconnect.com
paths:
  /cmd/v1/drivers:
    get:
      summary: Retrieve all drivers in the account.
      description: Retrieve Driver data by calling for all drivers within an account.
        Optionally filter by key fob id or driver id; a filtered call returns a
        single driver. The returned response is restricted to the REVEAL
        account's data plan.
      operationId: getDrivers
      tags:
        - Driver API
      parameters:
        - name: keyfobid
          in: query
          required: false
          description: Optional key fob id in hexadecimal format (8, 12 or 16 characters).
            When supplied, only the driver assigned to that key fob is returned.
            Takes precedence over driverId if both are supplied. A key fob id
            that is invalid or not assigned to a driver does not return an empty
            list; the request fails.
          schema:
            type: string
            example: "23456789"
        - name: driverId
          in: query
          required: false
          description: Optional driver id. When supplied (and keyfobid is not), only the
            driver with that id is returned. A driver id that is invalid or not
            found does not return an empty list; the request fails.
          schema:
            type: integer
            format: int32
            example: 1
      responses:
        "200":
          description: Successfully retrieved the list of drivers.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/DriverResource"
              example:
                - Driver:
                    CreatedDateUTC: 2016-08-08T17:51:04.093
                    DriverNumber: "100096"
                    EmailAddress: user@example.com
                    FirstName: Chris
                    LastName: Abernathy
                    EnableMobileAccess: false
                    PhoneNumber: "5551234567"
                    DriverId: 1
                  Links:
                    KeyFobs:
                      Href: https://vzc.local/drivers/100096/keys
                    Self:
                      Href: https://vzc.local/drivers/100096
        "204":
          description: No drivers exist in the account. Only returned when no filter is
            supplied. The response has no body.
        "400":
          description: Bad request. The request parameters are invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Unauthorized. Authentication credentials are missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "500":
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    DriverResource:
      type: object
      description: A driver together with related API links.
      required:
        - Driver
        - Links
      properties:
        Driver:
          $ref: "#/components/schemas/Driver"
        Links:
          type: object
          description: Always returned. Href values are empty strings when the driver has
            no Driver Number.
          required:
            - KeyFobs
            - Self
          properties:
            KeyFobs:
              allOf:
                - $ref: "#/components/schemas/Link"
              description: The driver's key fob(s) can be found using the key fob API link.
            Self:
              $ref: "#/components/schemas/Link"
    Error:
      type: object
      description: Generic error response. The documentation does not define an
        explicit error body schema.
      properties:
        message:
          type: string
          description: A human-readable description of the error.
    Driver:
      type: object
      description: A driver record within a REVEAL account.
      required:
        - CreatedDateUTC
        - DriverNumber
        - EmailAddress
        - FirstName
        - LastName
        - EnableMobileAccess
        - PhoneNumber
        - DriverId
      properties:
        CreatedDateUTC:
          type: string
          format: date-time
          description: The date the driver was created within the REVEAL account.
          example: 2016-08-08T17:51:04.093
        DriverNumber:
          type: string
          nullable: true
          description: The Driver Number is the unique identifier that will be used to
            reference the driver within the API. The Driver Number is not a
            mandatory field within the REVEAL account, but is required for the
            API.
          example: "100096"
        EmailAddress:
          type: string
          description: The email address for the driver. The driver email address is
            optional. It is mandatory for utilizing driver related applications
            such as the Field App or LogBook. A driver's email address must be
            unique within an account.
          example: user@example.com
        FirstName:
          type: string
          description: The first name of the driver.
          example: Chris
        LastName:
          type: string
          description: The last name of the driver.
          example: Abernathy
        EnableMobileAccess:
          type: boolean
          default: false
          description: Boolean field for true or false. Default is false. True indicates
            the driver will have access to mobile applications.
          example: false
        PhoneNumber:
          type: string
          nullable: true
          description: The phone number for the driver.
          example: "5551234567"
        DriverId:
          type: integer
          description: An integer that serves as a primary key, uniquely identifying each
            record in the table.
          example: 1
    Link:
      type: object
      description: An API hyperlink reference.
      properties:
        Href:
          type: string
          description: The URL of the related resource.
```
