openapi: 3.0.0
info:
  title: Switchboard API
  version: 2.0.0
  description: Switchboard API Version 2 - Enhanced endpoints with metadata
    responses and improved features
  contact:
    name: Switchboard
    url: https://onswitchboard.com
servers:
  - url: /
    description: API Version 2
paths:
  /v2/vehicles:
    get:
      summary: Retrieve a list of vehicles
      description: Retrieves a list of vehicles with pagination metadata
      x-eov-operation-id: readVehicles
      x-eov-operation-handler: v2/vehicles/routes/read
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-50). Values
            above 50 are capped at 50.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 50
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Successfully retrieved vehicles
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Vehicle"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of vehicles in the current response
                        example: 50
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 50
                      hasMore:
                        type: boolean
                        description: True if there are more vehicles available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  summary: First page, with every field of the Vehicle schema populated
                  value:
                    data:
                      - id: lnzTIBw9uT
                        unitId: "101"
                        enabled: true
                        licensePlate:
                          value: ER8123
                          jurisdiction: BC
                        location:
                          objectId: 2ntvSpRGIK
                          id: 2ntvSpRGIK
                          city: Vancouver
                          country: CA
                          stateProvince: BC
                          longitude: -123.123
                          latitude: 49.123
                          dateTime: 2020-01-01T00:00:00.000Z
                          drivers:
                            - objectId: 2ntvSpRGIK
                              id: 2ntvSpRGIK
                          odometerReadingKm: 160424.12
                          engineHours: 1204.1
                          speedKm: 84
                          vehicleSerial: "563062023431345"
                          vehicleVIN: JTLKE50E581048963
                          vehicleUnitId: "101"
                        vinNumber: JTLKE50E581048963
                        vehicleType: 7
                        nextInspectionDate: 2022-01-01
                        inspectionFrequencyMonths: 12
                        dashcamHardwareId: "860052026261391"
                        mviDecalNumber: R192378
                        engineModuleId: "563062023431345"
                        notes: Example of vehicle notes
                    meta:
                      count: 50
                      limit: 50
                      hasMore: true
                      nextCursor: abc123XYZ0
                nextPageWithDeprecatedCursorParam:
                  summary: A subsequent page requested with the deprecated cursor parameter
                  value:
                    data:
                      - id: Qm4kTBw9uT
                        unitId: "102"
                        enabled: true
                        licensePlate:
                          value: null
                          jurisdiction: null
                        location: null
                        vinNumber: null
                        vehicleType: null
                        nextInspectionDate: null
                        inspectionFrequencyMonths: null
                        dashcamHardwareId: null
                        mviDecalNumber: null
                        engineModuleId: null
                        notes: null
                    meta:
                      count: 1
                      limit: 50
                      hasMore: false
                      previousCursor: abc123XYZ0
                      warning: The "cursor" query parameter is deprecated; use "cursorId" instead.
        "401":
          description: Unauthorized
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vehicles
    post:
      summary: Create a new vehicle
      description: Creates a new vehicle with the given information
      x-eov-operation-id: createVehicle
      x-eov-operation-handler: v1/vehicles/routes/create
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/Vehicle"
                - required:
                    - unitId
        required: true
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vehicle"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vehicles
  /v2/vehicles/{id}:
    get:
      summary: Retrieve a single vehicle
      description: Retrieves information for a vehicle by its id
      x-eov-operation-id: readVehicle
      x-eov-operation-handler: v2/vehicles/routes/read
      parameters:
        - name: id
          in: path
          description: The vehicle id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vehicle"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vehicles
    patch:
      summary: Update a single vehicle
      description: Updates information for a vehicle by its id
      x-eov-operation-id: updateVehicle
      x-eov-operation-handler: v1/vehicles/routes/patch
      parameters:
        - name: id
          in: path
          description: The vehicle id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/Vehicle"
        required: true
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vehicle"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vehicles
    delete:
      summary: Delete a single vehicle
      description: Deletes a vehicle by its id
      x-eov-operation-id: deleteVehicle
      x-eov-operation-handler: v1/vehicles/routes/delete
      parameters:
        - name: id
          in: path
          description: The vehicle id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Vehicle"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vehicles
  /v2/vehicles/{id}/locations:
    get:
      summary: Retrieve a list of locations for a given vehicle
      description: >-
        Retrieves a list of locations. 

        The {id} parameter corresponds to the vehicle id, not to be confused
        with the vehicle's unit id.
      x-eov-operation-id: readLocations
      x-eov-operation-handler: v1/vehicles/subcollections/locations/routes/read
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-250). Defaults
            to 100 when omitted. Values above the maximum are capped, not
            rejected.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Location objectId from meta.nextCursor of the previous response.
            Returns the next page of locations older than this id (exclusive),
            using default dateTime descending sort.
          required: false
          schema:
            type: string
        - name: startmillis
          in: query
          description: The starting epoch timestamp in milliseconds (inclusive). When
            neither startmillis nor endmillis is supplied, results default to
            the last 1 hour. Passing startmillis=0 disables the lower bound and
            scans the full history.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: endmillis
          in: query
          description: The ending epoch timestamp in milliseconds (inclusive). Supplying
            endmillis on its own suppresses the 1 hour default lower bound.
          required: false
          schema:
            type: string
            pattern: ^\d+$
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      totalCount:
                        type: number
                        description: Total number of locations retrieved
                        example: 10
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 10
                      hasMore:
                        type: boolean
                        description: True if there are more locations available. When true, pass
                          meta.nextCursor as cursorId on the next request. Page
                          until this is false - a page may contain fewer than
                          limit locations and still have more available, because
                          records that fail GPS validation are omitted from the
                          response without ending pagination.
                        example: true
                      nextCursor:
                        type: string
                        description: Location objectId of the last item on this page. Pass as cursorId
                          to fetch the next (older) page.
                        example: yklTrCPAC1
                      previousCursor:
                        type: string
                        description: When paging with cursorId, this echoes the cursorId that was
                          requested. Omitted on the first page.
                        example: yklTrCPAC1
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
                  company:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the company
                        example: Example Company
                  trip:
                    type: object
                    properties:
                      estimatedDistanceKm:
                        type: number
                        description: Estimated distance travelled over locations retrieved
                        example: 595.949
                      startLocation:
                        type: object
                        properties:
                          latitude:
                            type: number
                            format: float
                            maximum: 90
                            minimum: -90
                            description: The latitude associated with this location. This value cannot be 0.
                            example: 49.123
                          longitude:
                            type: number
                            format: float
                            maximum: 180
                            minimum: -180
                            description: The longitude associated with this location. This value cannot be
                              0.
                            example: -123.123
                          dateTime:
                            type: string
                            format: date-time
                            description: The UTC timestamp when the vehicle was at this location
                            example: 2020-01-01T00:00:00.000Z
                      endLocation:
                        type: object
                        properties:
                          latitude:
                            type: number
                            format: float
                            maximum: 90
                            minimum: -90
                            description: The latitude associated with this location. This value cannot be 0.
                            example: 49.123
                          longitude:
                            type: number
                            format: float
                            maximum: 180
                            minimum: -180
                            description: The longitude associated with this location. This value cannot be
                              0.
                            example: -123.123
                          dateTime:
                            type: string
                            format: date-time
                            description: The UTC timestamp when the vehicle was at this location
                            example: 2020-01-01T00:00:00.000Z
                  locations:
                    type: array
                    items:
                      $ref: "#/components/schemas/Location"
        "400":
          description: Bad Request. Returned when the cursor is invalid, or when
            deprecated page-based pagination exceeds the maximum offset (page *
            limit > 500). Use cursorId (from meta.nextCursor) for pagination.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Locations
    post:
      summary: Create locations for a given vehicle
      description: Creates one or more locations for a given vehicle with the
        information provided
      x-eov-operation-id: createLocations
      x-eov-operation-handler: v1/vehicles/subcollections/locations/routes/create
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/Locations"
                - required:
                    - locations
        required: true
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  locations_created:
                    type: array
                    items:
                      $ref: "#/components/schemas/Location"
                  errors:
                    type: object
                    properties:
                      messages:
                        type: array
                        items:
                          $ref: "#/components/schemas/Error"
                      locations_not_created:
                        type: array
                        items:
                          $ref: "#/components/schemas/Location"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  locations_created:
                    type: array
                    items:
                      $ref: "#/components/schemas/Location"
                  errors:
                    type: object
                    properties:
                      messages:
                        type: array
                        items:
                          $ref: "#/components/schemas/Error"
                      locations_not_created:
                        type: array
                        items:
                          $ref: "#/components/schemas/Location"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Locations
  /v2/vehicles/{id}/locations/{id}: {}
  /v2/vehicles/locations/latest:
    get:
      summary: Retrieve the most recent location for a vehicle by unit ID
      description: Retrieves the most recent vehicle location for a given vehicle unit ID
      x-eov-operation-id: readLatestLocation
      x-eov-operation-handler: v1/vehicles/subcollections/locations/routes/readLatest
      parameters:
        - name: unitId
          in: query
          description: The vehicle unit ID to retrieve the most recent location for
          required: true
          allowReserved: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9_ -]*$
            minLength: 1
      responses:
        "200":
          description: Successfully retrieved the most recent location
          content:
            application/json:
              schema:
                type: object
                properties:
                  company:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the company
                        example: Example Company
                  location:
                    $ref: "#/components/schemas/Location"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Locations
  /v2/trailers:
    get:
      summary: Retrieve a list of trailers
      description: Retrieves a list of trailers with pagination metadata
      x-eov-operation-id: readTrailers
      x-eov-operation-handler: v2/trailers/routes/read
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-100)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Successfully retrieved trailers
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Trailer"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of trailers in the current response
                        example: 20
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 20
                      hasMore:
                        type: boolean
                        description: True if there are more trailers available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: lnzTIBw9uT
                        unitId: "001"
                        licensePlate:
                          value: ABC123
                          jurisdiction: BC
                        vinNumber: 1HGBH41JXMN109186
                        trailerType: DRY_VAN
                    meta:
                      count: 20
                      page: 0
                      limit: 20
                      hasMore: true
        "401":
          description: Unauthorized
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trailers
    post:
      summary: Create a new trailer
      description: Creates a new trailer with the given information
      x-eov-operation-id: createTrailer
      x-eov-operation-handler: v1/trailers/routes/create
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/Trailer"
                - required:
                    - unitId
        required: true
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Trailer"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trailers
  /v2/trailers/{id}:
    get:
      summary: Retrieve a single trailer
      description: Retrieves information for a trailer by its id
      x-eov-operation-id: readTrailer
      x-eov-operation-handler: v2/trailers/routes/read
      parameters:
        - name: id
          in: path
          description: The trailer id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Trailer"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trailers
    patch:
      summary: Update a single trailer
      description: Updates information for a trailer by its id
      x-eov-operation-id: updateTrailer
      x-eov-operation-handler: v1/trailers/routes/patch
      parameters:
        - name: id
          in: path
          description: The trailer id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/Trailer"
        required: true
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Trailer"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trailers
    delete:
      summary: Delete a single trailer
      description: Deletes a trailer by its id
      x-eov-operation-id: deleteTrailer
      x-eov-operation-handler: v1/trailers/routes/delete
      parameters:
        - name: id
          in: path
          description: The trailer id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
      responses:
        "200":
          description: Successully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Trailer"
        "404":
          description: Object not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trailers
  /v2/drivers:
    get:
      summary: Retrieve a list of drivers
      description: Retrieves a list of drivers with pagination metadata
      x-eov-operation-id: getDrivers
      x-eov-operation-handler: v2/drivers/routes/read
      parameters:
        - name: bodyLimit
          in: query
          description: Maximum number of results to return per request (0-50)
          required: true
          schema:
            type: integer
            format: int32
            default: 0
            minimum: 0
            maximum: 50
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Successfully retrieved drivers info
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Driver"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of drivers in the current response
                        example: 50
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 50
                      hasMore:
                        type: boolean
                        description: True if there are more drivers available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
        "401":
          description: Unauthorized
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Drivers
    post:
      summary: Creates a new driver
      description: Creates a new driver with the provided information
      x-eov-operation-id: createDriver
      x-eov-operation-handler: v1/drivers/routes/create
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/Driver"
                - required:
                    - firstName
                    - lastName
                    - phoneNumber
                    - driversLicense
                    - driversLicenseCountry
                    - driversLicenseJurisdiction
                    - canCycleType
                    - usaCycleType
                    - timezone
                    - username
                    - exempt
      responses:
        "200":
          description: Successfully created driver
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Driver"
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Drivers
  /v2/drivers/{id}:
    get:
      summary: Retrieve a single driver
      description: Retrieves information for a driver by its id
      x-eov-operation-id: getDriverById
      x-eov-operation-handler: v2/drivers/routes/read
      parameters:
        - name: id
          in: path
          description: The ID of the driver
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Successfully retrieved driver
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/Driver"
                  - required:
                      - firstName
                      - lastName
                      - phoneNumber
                      - driversLicense
                      - driversLicenseCountry
                      - driversLicenseJurisdiction
                      - canCycleType
                      - usaCycleType
                      - timezone
                      - username
                      - exempt
        "400":
          description: Bad request
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Drivers
    put:
      summary: Update a single driver
      description: Updates information for a driver by its id
      x-eov-operation-id: updateDriverById
      x-eov-operation-handler: v1/drivers/routes/update
      parameters:
        - name: id
          in: path
          description: The ID of the driver
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Driver"
      responses:
        "200":
          description: Successfully updated driver
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Driver"
        "400":
          description: Invalid driver ID
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Drivers
  /v2/eldDailyCertifications:
    get:
      summary: Retrieve a list of daily HOS summaries
      description: Retrieves a list of daily HOS summaries with pagination metadata.
        When driverId is provided, returns certifications for that driver sorted
        by startTimeUTC descending. When driverId is not provided, returns
        certifications across all drivers sorted by startTimeUTC descending
        (most recent first).
      x-eov-operation-id: getEldDailyCertifications
      x-eov-operation-handler: v2/eldDailyCertification/routes/read
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return per request. Defaults to 20
            when driverId is not provided, or 50 when driverId is provided.
            (1-50)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
        - name: driverId
          in: query
          description: The id of the driver for HOS daily logs. When omitted, returns
            certifications across all drivers.
          required: false
          schema:
            type: string
        - name: startmillis
          in: query
          description: The starting epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: endmillis
          in: query
          description: The ending epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: sort
          in: query
          description: 'Sort order for startTimeUTC. Options: "asc" (ascending) or "desc"
            (descending). Defaults to "desc".'
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        "200":
          description: Successfully retrieved daily HOS summaries info
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/ELDDailyCertification"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of daily HOS summaries in the current response
                        example: 20
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 20
                      hasMore:
                        type: boolean
                        description: True if there are more daily HOS summaries available. When true,
                          pass meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: xyz789
                        driver: driver123
                        startTimeUTC: 2024-01-15T00:00:00.000Z
                        onDutyConsumedMs: 30600000
                        drivingTimeConsumedMs: 28800000
                        caCycleRemainingMs: 110000
                        caOnDutyTimeRemainingMs: 110000
                        caDriveTimeRemainingMs: 28800000
                        caShiftOnDutyTimeRemainingMs: 110000
                        caShiftDriveTimeRemainingMs: 110000
                        caShiftConsumedMs: 110000
                        usCycleRemainingMs: 110000
                        usOnDutyTimeRemainingMs: 110000
                        usDriveTimeRemainingMs: 28800000
                    meta:
                      count: 1
                      limit: 20
                      hasMore: false
        "401":
          description: Unauthorized
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - HOS Summary
  /v2/latestEldDailyCertifications:
    get:
      summary: Retrieve latest daily HOS summaries by driver
      description: Retrieves the latest daily HOS summary for each driver with
        pagination metadata
      x-eov-operation-id: getLatestEldDailyCertifications
      x-eov-operation-handler: v2/eldDailyCertification/routes/read
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-50)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 20
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
        - name: sort
          in: query
          description: 'Sort order for startTimeUTC. Options: "asc" (ascending) or "desc"
            (descending). Defaults to "desc".'
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        "200":
          description: Successfully retrieved latest daily HOS summaries
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/ELDDailyCertification"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of drivers with daily HOS summaries in the current response
                        example: 20
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 20
                      hasMore:
                        type: boolean
                        description: True if there are more drivers available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: abc456
                        driver: driver123
                        startTimeUTC: 2024-01-15T00:00:00.000Z
                        onDutyConsumedMs: 30600000
                        drivingTimeConsumedMs: 28800000
                        caCycleRemainingMs: 110000
                        caOnDutyTimeRemainingMs: 110000
                        caDriveTimeRemainingMs: 28800000
                        caShiftOnDutyTimeRemainingMs: 110000
                        caShiftDriveTimeRemainingMs: 110000
                        caShiftConsumedMs: 110000
                        usCycleRemainingMs: 110000
                        usOnDutyTimeRemainingMs: 110000
                        usDriveTimeRemainingMs: 28800000
                    meta:
                      count: 1
                      limit: 20
                      hasMore: false
        "400":
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: Unauthorized
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - HOS Summary
  /v2/eldEvents:
    get:
      summary: Retrieve a list of ELD events
      description: Retrieves a list of ELD events with pagination metadata. If
        driverId is not provided, returns the most recent ELD events.
      x-eov-operation-id: getELDEvents
      x-eov-operation-handler: v2/eldEvent/routes/read
      parameters:
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-50)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 50
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
        - name: driverId
          in: query
          description: The id of the driver for ELD events. If not provided, returns the
            most recent ELD events for all drivers.
          required: false
          schema:
            type: string
        - name: startmillis
          in: query
          description: The starting epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: endmillis
          in: query
          description: The ending epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: sort
          in: query
          description: 'Sort order for eventDateTime. Options: "asc" (ascending) or "desc"
            (descending). Defaults to "desc".'
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        "200":
          description: Successfully retrieved ELD Events
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/ELDEvent"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of ELD events in the current response
                        example: 50
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 50
                      hasMore:
                        type: boolean
                        description: True if there are more ELD events available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: abc123
                        eventDateTime: 2024-01-15T10:30:00.000Z
                        eldEventTypeCode: ON_DUTY
                        eventRecordStatus: ACTIVE
                    meta:
                      count: 50
                      limit: 50
                      hasMore: true
        "401":
          description: Unauthorized
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - ELD Events
  /v2/visionEvents:
    get:
      summary: Retrieve a list of vision events
      description: Retrieves a list of vision events filtered by vehicle unit ID
        and/or driver ID with optional date filtering and pagination metadata.
        At least one of vehicleUnitId or driverId must be provided.
      x-eov-operation-id: getVisionEvents
      x-eov-operation-handler: v2/visionEvent/routes/read
      parameters:
        - name: vehicleUnitId
          in: query
          description: The vehicle unit ID for vision events (spaces should be URL encoded
            as %20 or +). Either vehicleUnitId or driverId must be provided.
          required: false
          allowReserved: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9_ ]*$
            minLength: 1
        - name: driverId
          in: query
          description: The id of the driver for vision events. Either vehicleUnitId or
            driverId must be provided.
          required: false
          schema:
            type: string
        - name: startmillis
          in: query
          description: The starting epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
        - name: endmillis
          in: query
          description: The ending epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-50)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 25
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Filter by specific event type
          required: false
          schema:
            type: string
            enum:
              - NORMAL_RECORD
              - IGNITION_ON
              - IGNITION_OFF
              - POWER_DISCONNECTED
              - CRASH_DETECTION
              - HARSH_ACCELERATION
              - HARSH_BRAKING
              - HARSH_TURNING
              - OVERSPEED_ALARM
              - QL_PANIC_EVENT
              - QL_SOS_EVENT
              - QL_GEOFENCE
              - QL_PARKING_SAFEGUARD
              - QL_MANUAL_RECORD
              - QL_SOD_TIME_RANGE_RECORD
        - name: debug
          in: query
          description: Enable debug logging for development (set to true)
          required: false
          schema:
            type: string
            enum:
              - "true"
              - "false"
            default: "false"
        - name: sort
          in: query
          description: "Sort order for each item's dateTime field. Options: \"asc\"
            (ascending) or \"desc\" (descending). Defaults to \"desc\"."
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        "200":
          description: Successfully retrieved vision events. When nothing matches the
            filters, data is an empty array (HTTP 200, not 404).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/VisionEvent"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of vision events in the current response
                        example: 25
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 25
                      hasMore:
                        type: boolean
                        description: True if there are more vision events available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: vision123
                        dateTime: 2024-01-15T14:30:00.000Z
                        type: IGNITION_ON
                        vehicleUnitId: "101"
                        vehicle: 2ntvSpRGIK
                        driver: driver123
                        location:
                          latitude: 49.2827
                          longitude: -123.1207
                    meta:
                      count: 25
                      limit: 25
                      hasMore: true
        "400":
          description: Bad Request - Invalid parameters (e.g., neither vehicleUnitId nor
            driverId provided)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vision
  /v2/tripInspections:
    get:
      summary: Retrieve trip inspections
      description: Retrieves a list of trip inspections with optional filtering and
        pagination metadata
      x-eov-operation-id: readTripInspections
      x-eov-operation-handler: v2/tripInspection/routes/read
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 25
          description: Number of trip inspections to return (1-50)
          example: 25
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
        - name: vehicleUnitId
          in: query
          allowReserved: true
          schema:
            type: string
          description: Filter by vehicle unit ID (spaces should be URL encoded as %20 or +)
          example: "101"
        - name: driverId
          in: query
          schema:
            type: string
          description: Filter by driver ID
          example: abc123
        - name: startmillis
          in: query
          schema:
            type: integer
          description: Filter by inspection date (start) in milliseconds since epoch
          example: 1672531200000
        - name: endmillis
          in: query
          schema:
            type: integer
          description: Filter by inspection date (end) in milliseconds since epoch
          example: 1675209599999
        - name: sort
          in: query
          description: 'Sort order for dateTime. Options: "asc" (ascending) or "desc"
            (descending). Defaults to "desc".'
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: debug
          in: query
          schema:
            type: string
            enum:
              - "true"
              - "false"
          description: Enable debug logging for development
          example: "false"
      responses:
        "200":
          description: Trip inspections retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/TripInspection"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of trip inspections in the current response
                        example: 25
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 25
                      hasMore:
                        type: boolean
                        description: True if there are more trip inspections available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: trip123
                        type: PRE_TRIP
                        dateTime: 2024-01-15T08:00:00.000Z
                        driverId: driver123
                        vehicleUnitId: "101"
                        status: completed
                    meta:
                      count: 25
                      limit: 25
                      hasMore: true
        "400":
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trip Inspection
    post:
      summary: Create a trip inspection
      description: Creates a new trip inspection. Accepts driverId, vehicleUnitId, and
        optional trailer unit IDs instead of nested objects.
      x-eov-operation-id: createTripInspection
      x-eov-operation-handler: v2/tripInspection/routes/read
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TripInspectionCreateRequest"
      responses:
        "200":
          description: Successfully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TripInspection"
        "201":
          description: Trip inspection created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TripInspection"
        "204":
          description: Trip inspection deleted successfully
        "404":
          description: Trip inspection not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trip Inspection
  /v2/tripInspections/{id}:
    get:
      summary: Retrieve a single trip inspection
      description: Retrieves information for a trip inspection by its id
      x-eov-operation-id: readTripInspection
      x-eov-operation-handler: v2/tripInspection/routes/read
      parameters:
        - name: id
          in: path
          description: The trip inspection id to perform the operation on
          required: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]*$
        - name: debug
          in: query
          schema:
            type: string
            enum:
              - "true"
              - "false"
          description: Enable debug logging for development
          example: "false"
      responses:
        "200":
          description: Successfully performed operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TripInspection"
        "201":
          description: Trip inspection created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TripInspection"
        "204":
          description: Trip inspection deleted successfully
        "404":
          description: Trip inspection not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        default:
          description: Unexpected error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Trip Inspection
  /v2/visionImages:
    get:
      summary: Retrieve a list of vision images
      description: Retrieves a list of vision images (dashcam snapshots) filtered by
        vehicle unit ID with optional date filtering and pagination metadata.
        vehicleUnitId is required.
      x-eov-operation-id: getVisionImages
      x-eov-operation-handler: v2/visionImage/routes/read
      parameters:
        - name: vehicleUnitId
          in: query
          description: The vehicle unit ID for vision images (spaces should be URL encoded
            as %20 or +). Required.
          required: true
          allowReserved: true
          schema:
            type: string
            pattern: ^[a-zA-Z0-9_ ]*$
            minLength: 1
        - name: startmillis
          in: query
          description: The starting epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
        - name: endmillis
          in: query
          description: The ending epoch timestamp in milliseconds (0 or greater)
          required: false
          schema:
            type: integer
            minimum: 0
        - name: limit
          in: query
          description: Maximum number of results to return per request (1-50)
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 25
        - name: page
          in: query
          deprecated: true
          description: Deprecated. Use cursorId instead. Offset-based page number (0 or
            greater); page * limit must not exceed 500.
          required: false
          schema:
            type: string
            pattern: ^\d+$
        - name: cursorId
          in: query
          description: Object id from meta.nextCursor of the previous response. Returns
            the next page after this id (exclusive).
          required: false
          schema:
            type: string
        - name: debug
          in: query
          description: Enable debug logging for development (set to true)
          required: false
          schema:
            type: string
            enum:
              - "true"
              - "false"
            default: "false"
        - name: sort
          in: query
          description: "Sort order for each item's dateTime field. Options: \"asc\"
            (ascending) or \"desc\" (descending). Defaults to \"desc\"."
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        "200":
          description: Successfully retrieved vision images. When nothing matches the
            filters, data is an empty array (HTTP 200, not 404).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/VisionImage"
                  meta:
                    type: object
                    properties:
                      count:
                        type: number
                        description: Number of vision images in the current response
                        example: 25
                      limit:
                        type: number
                        description: Maximum number of results to return per request
                        example: 25
                      hasMore:
                        type: boolean
                        description: True if there are more vision images available. When true, pass
                          meta.nextCursor as cursorId.
                        example: true
                      nextCursor:
                        type: string
                        description: Object id of the last item on this page. Pass as cursorId to fetch
                          the next page.
                        example: abc123XYZ0
                      previousCursor:
                        type: string
                        description: When paging with cursorId, echoes the cursorId that was requested.
                          Omitted on the first page.
                        example: abc123XYZ0
                      warning:
                        type: string
                        description: Present when a deprecated query parameter was used (for example,
                          cursor instead of cursorId).
                        example: The "cursor" query parameter is deprecated; use "cursorId" instead.
              examples:
                default:
                  value:
                    data:
                      - id: visionimg123
                        dateTime: 2024-01-15T14:30:00.000Z
                        vehicleUnitId: "101"
                        imageURL: https://example.com/images/snapshot_123.jpg
                        driverId: driver123
                    meta:
                      count: 25
                      limit: 25
                      hasMore: true
        "400":
          description: Bad Request - Invalid parameters (e.g., vehicleUnitId not provided)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Vision
components:
  parameters:
    APIHeader:
      name: x-api-id
      in: header
  schemas:
    Vehicle:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the trailer record
          example: 2ntvSpRGIK
        unitId:
          type: string
          pattern: ^[ -~]*$
          minLength: 1
          description: Unique identifier for the vehicle
          example: "101"
        enabled:
          type: boolean
          example: true
          description: Vehicle enabled status
        licensePlate:
          type: object
          $ref: "#/components/schemas/LicensePlate"
        location:
          type: object
          $ref: "#/components/schemas/Location"
        vinNumber:
          type:
            - string
            - "null"
          description: The VIN associated with the vehicle
          example: JTLKE50E581048963
        vehicleType:
          type:
            - integer
            - "null"
          description: "The type of vehicle. The available options are: N/A (0), Beverage
            Truck (1), Box Truck (2), Bus (3), Construction Vehicle (4), Garbage
            Truck (5), Panel Truck (6), Pickup Truck (7), Tractor (8), Van (9)"
          example: 7
        nextInspectionDate:
          anyOf:
            - type:
                - string
                - "null"
              format: date
              description: The trailer inspection date in YYYY-MM-DD format
              example: 2022-01-01
            - type:
                - string
                - "null"
              maxLength: 0
              description: Empty string to unset the trailer inspection date
              example: |+
                
        inspectionFrequencyMonths:
          type:
            - integer
            - "null"
          minimum: 0
          description: The trailer inspection frequency in months
          example: 12
        dashcamHardwareId:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: The dashcam ID associated with the vehicle
          example: "860052026261391"
        mviDecalNumber:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: The MVI decal number associated with the vehicle
          example: R192378
        engineModuleId:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: The engine module ID associated with the vehicle
          example: "563062023431345"
        notes:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: Additional notes associated with the vehicle
          example: Example of vehicle notes
    Locations:
      properties:
        companyObjectId:
          type: string
          minLength: 1
          description: "[Deprecated] Unique identifier for the company record"
          example: 2ntvSpRGIK
          deprecated: true
        locations:
          type: array
          items:
            $ref: "#/components/schemas/Location"
            required:
              - city
              - country
              - stateProvince
              - dateTime
              - latitude
              - longitude
          minItems: 1
          maxItems: 15
    Driver:
      properties:
        firstName:
          type: string
          pattern: "^[^\0-\x1f]*$"
          example: John
          description: Driver's first name
        lastName:
          type: string
          pattern: "^[^\0-\x1f]*$"
          example: Doe
          description: Driver's last name
        phoneNumber:
          type: string
          pattern: ^[0-9]*$
          example: "8586770459"
          description: Driver's phone number
        driversLicense:
          type: string
          pattern: ^[A-Za-z 0-9-]*$
          example: 655-3892
          description: Driver's License ID
        driversLicenseCountry:
          type: string
          pattern: ^[A-Za-z]*$
          example: CA
          description: Driver's license country
        driversLicenseJurisdiction:
          type: string
          pattern: ^[A-Za-z]*$
          example: BC
          description: Driver's license jurisdiction
        canCycleType:
          type: integer
          default: 1
          minimum: 1
          maximum: 7
          description: >-
            Driver's Canadian HOS cycle type. Related to ELD HOS rules the
            driver will follow in Canada. Valid values:
                    1: 70 hour / 7 Day
                    2: 120 hour / 14 Day
                    3: Oil Well Service
                    4: 80 hour / 7 day
                    5: 120 hour / 14 day
                    6: Alberta
                    7: Loggers
        usaCycleType:
          type: integer
          default: 1
          minimum: 1
          maximum: 27
          description: >-
            Driver's US HOS cycle type. Related to ELD HOS rules the driver will
            follow in the USA. Valid values:
                    1: 70 hour / 8 Day
                    2: 60 hour / 7 Day
                    3: Oilfield 70 hour / 8 day
                    4: Motion Picture 60 hour / 7 day
                    5: Motion Picture 70 hour / 8 day
                    6: Construction 60 hour / 7 day
                    7: Construction 70 hour / 8 day
                    8: Ground Water Well 60 hour / 7 day
                    9: Ground Water Well 70 hour / 8 day
                    10: Intrastate 70 hour / 7 day
                    11: Alaska: 70 hour / 7 day
                    12: Alaska: 80 hour / 8 day
                    13: California: Intrastate 80 hour / 8 day
                    14: California: Motion Picture 80 hour / 8 day
                    15: USA: Passenger-carrying 60 hour / 7 Day
                    16: USA: Passenger-carrying 70 hour / 8 Day
                    17: Alaska: Passenger-carrying 70 hour / 7 day
                    18: Alaska: Passenger-carrying 80 hour / 8 day
                    19: USA: Oversized 60 hour / 7 day
                    20: USA: Oversized 70 hour / 8 day
                    21: California: Passenger-carrying 80 hour / 8 day
                    26: USA: Agricultural 60 hour / 7 Day
                    27: USA: Agricultural 70 hour / 8 Day
        timezone:
          type: string
          pattern: ^[A-Za-z/_]*$
          example: America/Vancouver
          description: Driver's timezone
        username:
          type: string
          pattern: ^[A-Za-z0-9._+-@]*$
          example: johndoe123
          description: Driver's username
        email:
          anyOf:
            - type:
                - string
                - "null"
              format: email
              example: johndoe@example.com
              description: Driver's email address
            - type:
                - string
                - "null"
              maxLength: 0
              description: Empty string to unset the email
              example: |+
                
        licenseExpiryDate:
          anyOf:
            - type:
                - string
                - "null"
              format: date
              description: The date in YYYY-MM-DD format
              example: 2022-01-01
            - type:
                - string
                - "null"
              maxLength: 0
              description: Empty string to unset the date
              example: |+
                
        enabled:
          type: boolean
          example: true
          description: Vehicle enabled status
        exempt:
          type: boolean
          example: true
          description: Driver's exemption status
        yardMoves:
          type: boolean
          example: false
          description: Driver's yard moves status
        personalUseCMV:
          type: boolean
          example: false
          description: Driver's personal use CMV status
        sendTextToDriver:
          type: boolean
          example: true
          description: Send text to driver on registration or password change
        medicalCheckDate:
          type: string
          format: date
          example: 2022-01-01
          description: Driver's medical expiry date
        notes:
          type: string
          example: Example Notes
          description: Additional driver notes
        password:
          type: string
          minLength: 4
          format: password
          example: password
          description: Driver's password
        exemptionReason:
          type: string
          example: Exemption Reason
          description: Driver's exemption reason
        dotNumber:
          type: string
          pattern: ^[A-Za-z0-9]*$
          example: "973457"
          description: Driver's DOT number
        id:
          type: string
          pattern: ^[A-Za-z0-9]*$
          example: yrKsyRstu1
          description: Driver Object Id
    Trailer:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the trailer record
          example: 2ntvSpRGIK
        unitId:
          type: string
          pattern: ^[ -~]*$
          minLength: 1
          description: Unique identifier for the trailer
          example: "101"
        enabled:
          type: boolean
          example: true
          description: Trailer enabled status
        licensePlate:
          type: object
          $ref: "#/components/schemas/LicensePlate"
        vinNumber:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          maxLength: 25
          description: The VIN associated with the trailer
          example: JTLKE50E581048963
        trailerType:
          type:
            - integer
            - "null"
          description: "The type of trailer. The available options are: N/A (0), Dry Van
            (1), Refrigerated (2), Flat Bed (3), Step Deck (4), Container (5),
            Tanker (6), Low Bed (7), Other (8)"
          example: 1
        nextInspectionDate:
          anyOf:
            - type:
                - string
                - "null"
              format: date
              description: The trailer inspection date in YYYY-MM-DD format
              example: 2022-01-01
            - type:
                - string
                - "null"
              maxLength: 0
              description: Empty string to unset the trailer inspection date
              example: |+
                
        inspectionFrequencyMonths:
          type:
            - integer
            - "null"
          minimum: 0
          description: The trailer inspection frequency in months
          example: 12
        trackerId:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: The tracker ID associated with the trailer
          example: "860052026261391"
        mviDecalNumber:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: The MVI decal number associated with the trailer
          example: R192378
        lowerTempBoundCelsius:
          type:
            - number
            - "null"
          format: double
          description: The lowest temperature threshold for the trailer with an associated
            temperature monitor
          example: -5.5
        upperTempBoundCelsius:
          type:
            - number
            - "null"
          format: double
          description: The highest temperature threshold for the trailer with an
            associated temperature monitor
          example: 6.5
        notes:
          type:
            - string
            - "null"
          pattern: ^[a-zA-Z0-9_ ]*$
          description: Additional notes associated with the trailer
          example: Example of trailer notes
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: The HTTP status code associated with the response
          example: 400
        message:
          type: string
          description: Additional description of the error
          example: Bad Request
    Location:
      properties:
        objectId:
          type: string
          readOnly: true
          deprecated: true
          description: "[Deprecated] Unique identifier for the location record. Use id
            instead."
          example: 2ntvSpRGIK
        id:
          type: string
          readOnly: true
          description: Unique identifier for the location record
          example: 2ntvSpRGIK
        city:
          type:
            - string
            - "null"
          description: The city associated with this location
          example: Vancouver
        country:
          type:
            - string
            - "null"
          description: The country code associated with this location
          example: CA
        stateProvince:
          type:
            - string
            - "null"
          description: The state or province code associated with this location
          example: BC
        longitude:
          type: number
          format: float
          maximum: 180
          minimum: -180
          description: The longitude associated with this location. This value cannot be 0.
          example: -123.123
        latitude:
          type: number
          format: float
          maximum: 90
          minimum: -90
          description: The latitude associated with this location. This value cannot be 0.
          example: 49.123
        dateTime:
          type: string
          format: date-time
          description: The UTC timestamp when the vehicle was at this location
          example: 2020-01-01T00:00:00.000Z
        drivers:
          type: array
          minItems: 0
          maxItems: 5
          items:
            type: object
            properties:
              objectId:
                type: string
                description: "[Deprecated] Unique identifier for the driver record"
                deprecated: true
              id:
                type: string
                description: Unique identifier for the driver record
                example: 2ntvSpRGIK
          description: An array of drivers ids associated corresponding to the vehicle at
            this time
        odometerReadingKm:
          type:
            - number
            - "null"
          description: The odometer reading of the vehicle at this location
          example: 160424.12
        engineHours:
          type:
            - number
            - "null"
          description: The engine hour reading of the vehicle at this location
          example: 1204.1
        speedKm:
          type:
            - number
            - "null"
          description: The speed of the vehicle at this location
          example: 84
        vehicleSerial:
          type:
            - string
            - "null"
          description: The vehicle serial (engine module ID) associated with the vehicle
          example: "563062023431345"
        vehicleVIN:
          type:
            - string
            - "null"
          maxLength: 25
          description: The VIN associated with the vehicle
          example: JTLKE50E581048963
        vehicleUnitId:
          type:
            - string
            - "null"
          description: The unit ID associated with the vehicle
          example: TRUCK001
      required:
        - dateTime
    LicensePlate:
      required:
        - value
      properties:
        value:
          type:
            - string
            - "null"
          description: The license plate value
          maxLength: 25
          example: ER8123
        jurisdiction:
          pattern: ^[A-Za-z]*$
          description: The state province abbreviation for the jurisdiction of the license
            plate
          type:
            - string
            - "null"
          example: BC
    ELDDailyCertification:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the HOS Daily Summary record
          example: 2ntvSpRGIK
        driver:
          type: string
          readOnly: true
          description: Unique identifier for the driver record
          example: 2ntvSpRGIK
        startTimeUTC:
          type: string
          format: date-time
          description: The UTC timestamp when the daily hours-of-service log begins
          example: 2020-01-01T00:00:00.000Z
        onDutyConsumed:
          type: integer
          description: Amount of On-Duty time consumed for the current shift. Unit
            milliseconds.
          example: 110000
        drivingTimeConsumed:
          type: integer
          description: Amount of Driving time consumed for the current shift. Unit
            milliseconds.
          example: 28800000
        caCycleTimeLeft:
          type: integer
          description: Amount of Cycle Hours (according to Canadian HOS) remaining in
            current cycle. Unit milliseconds.
          example: 110000
        caOnDutyTimeLeft:
          type: integer
          description: Amount of On-Duty time (according to Canadian HOS) remaining for
            current day. Unit milliseconds.
          example: 110000
        caDriveTimeLeft:
          type: integer
          description: Amount of Drive time (according to Canadian HOS) remaining for
            current day. Unit milliseconds.
          example: 110000
        caShiftOnDutyTimeLeft:
          type: integer
          description: Amount of On-Duty time (according to Canadian HOS) remaining for
            the current shift. Unit milliseconds.
          example: 110000
        caShiftDriveTimeLeft:
          type: integer
          description: Amount of Drive time (according to Canadian HOS) remaining for the
            current shift. Unit milliseconds.
          example: 110000
        caShiftHours:
          type: integer
          description: Amount of time (according to Canadian HOS) remaining for the
            current shift. Unit milliseconds.
          example: 110000
        usCycleTimeLeft:
          type: integer
          description: Amount of Cycle Hours (according to USA HOS) remaining in current
            cycle. Unit milliseconds.
          example: 110000
        usOnDutyTimeLeft:
          type: integer
          description: Amount of On-Duty time (according to USA HOS) remaining for the
            current shift. Unit milliseconds.
          example: 110000
        usDriveTimeLeft:
          type: integer
          description: Amount of Drive time (according to USA HOS) remaining for the
            current shift. Unit milliseconds.
          example: 110000
        shiftStartTime:
          type: string
          format: date-time
          description: The UTC timestamp when the current shift started. Null if not
            available.
          example: 2024-01-15T08:00:00.000Z
        shiftEndTime:
          type: string
          format: date-time
          description: The UTC timestamp when the current shift ends. Null if not available.
          example: 2024-01-15T20:00:00.000Z
    ELDEvent:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the ELD Event record
          example: 2ntvSpRGIK
        driver:
          anyOf:
            - type: string
              readOnly: true
              description: Unique identifier for the driver record
              example: 2ntvSpRGIK
            - type: object
              $ref: "#/components/schemas/Driver"
        dateTime:
          type: string
          format: date-time
          description: The UTC timestamp to when the ELD Event refers
          example: 2020-01-01T00:00:00.000Z
        status:
          type: string
          description: The status of the ELD Event
          example: On Duty
        note:
          type: string
          description: Notes/Annotations attached to the ELD Event
          example: Pre-Trip Inspection
    VisionEvent:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the Vision Event record
          example: 2ntvSpRGIK
        vehicle:
          anyOf:
            - type: string
              readOnly: true
              description: Unique identifier for the vehicle record
              example: 2ntvSpRGIK
            - type: object
              $ref: "#/components/schemas/Vehicle"
        vehicleUnitId:
          type: string
          description: The unit ID of the vehicle associated with the vision event
          example: "101"
        type:
          type: string
          description: The type of vision event
          example: HARSH_BRAKING
          enum:
            - NORMAL_RECORD
            - IGNITION_ON
            - IGNITION_OFF
            - POWER_DISCONNECTED
            - CRASH_DETECTION
            - HARSH_ACCELERATION
            - HARSH_BRAKING
            - HARSH_TURNING
            - OVERSPEED_ALARM
            - QL_PANIC_EVENT
            - QL_SOS_EVENT
            - QL_GEOFENCE
            - QL_PARKING_SAFEGUARD
            - QL_MANUAL_RECORD
            - QL_SOD_TIME_RANGE_RECORD
        dateTime:
          type: string
          format: date-time
          description: The UTC timestamp when the vision event occurred
          example: 2020-01-01T00:00:00.000Z
        location:
          type: object
          description: Location information where the event occurred
          properties:
            latitude:
              type: number
              description: Latitude coordinate
              example: 49.2827
            longitude:
              type: number
              description: Longitude coordinate
              example: -123.1207
        videoURL:
          type:
            - string
            - "null"
          description: URL to the video footage of the event
          example: https://example.com/videos/event_123.mp4
        driver:
          anyOf:
            - type: string
              readOnly: true
              description: Unique identifier for the driver record
              example: 2ntvSpRGIK
            - type: object
              $ref: "#/components/schemas/Driver"
    VisionImage:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the Vision Image record
          example: 2ntvSpRGIK
        vehicleUnitId:
          type: string
          description: The unit ID of the vehicle associated with the vision image
          example: "101"
        dateTime:
          type: string
          format: date-time
          description: The UTC timestamp when the vision image was captured
          example: 2020-01-01T00:00:00.000Z
        imageURL:
          type:
            - string
            - "null"
          description: URL to the image snapshot
          example: https://example.com/images/snapshot_123.jpg
        driverId:
          type: string
          description: Unique identifier for the driver associated with the vision image,
            when available
          example: 2ntvSpRGIK
    TripInspection:
      properties:
        id:
          type: string
          readOnly: true
          description: Unique identifier for the trip inspection record
          example: 2ntvSpRGIK
        type:
          type: integer
          description: "Type of inspection: 1 = Pre-trip, 2 = Post-trip, 3 = CTPAT"
          example: 1
          enum:
            - 1
            - 2
            - 3
        dateTime:
          type: string
          format: date-time
          description: Date and time when the inspection was performed
          example: 2023-01-15T10:30:00Z
        driver:
          type: object
          description: Driver who performed the inspection
          properties:
            id:
              type: string
              description: Driver ID
              example: abc123
            name:
              type: string
              description: Driver name
              example: John Doe
        vehicle:
          type: object
          description: Vehicle being inspected
          properties:
            id:
              type: string
              description: Vehicle ID
              example: veh123
            unitId:
              type: string
              description: Vehicle unit ID
              example: "101"
        trailerFirst:
          type: object
          description: First trailer being inspected
          properties:
            id:
              type: string
              description: Trailer ID
              example: trail123
            unitId:
              type: string
              description: Trailer unit ID
              example: "201"
        trailerSecond:
          type: object
          description: Second trailer being inspected
          properties:
            id:
              type: string
              description: Trailer ID
              example: trail456
            unitId:
              type: string
              description: Trailer unit ID
              example: "202"
        defects:
          type: array
          description: List of defects found during inspection
          items:
            type: object
            properties:
              typeDescription:
                type: string
                description: Description of the defect type
                example: Brake system defect
              equipment:
                type: string
                description: Equipment affected by the defect
                example: vehicle
                enum:
                  - vehicle
                  - trailer
              severity:
                type: integer
                description: "Severity level of the defect: 1 = Minor, 2 = Major"
                example: 1
                enum:
                  - 1
                  - 2
              description:
                type: string
                description: Additional description of the defect
                example: Brake pads need replacement
              fixed:
                type: boolean
                description: Whether the defect has been fixed
                example: false
              fixedNotes:
                type: string
                description: Notes about the repair
                example: Replaced brake pads
              vehicleUnitId:
                type: string
                description: Vehicle unit ID where the defect was found
                example: "101"
        notes:
          type: string
          description: Additional notes about the inspection
          example: Inspection completed successfully
      required:
        - type
        - dateTime
        - driver
        - vehicle
    TripInspectionCreateRequest:
      type: object
      properties:
        type:
          type: integer
          description: "Type of inspection: 1 = Pre-trip, 2 = Post-trip, 3 = CTPAT"
          example: 1
          enum:
            - 1
            - 2
            - 3
        dateTime:
          type: string
          format: date-time
          description: Date and time when the inspection was performed
          example: 2023-01-15T10:30:00Z
        driverId:
          type: string
          description: Driver objectId who performed the inspection
          example: H4JiiZRggX
        vehicleUnitId:
          type: string
          description: Vehicle unit ID being inspected
          example: jocar
        trailerFirstUnitId:
          type: string
          description: First trailer unit ID (optional)
          example: jotrailer
        trailerSecondUnitId:
          type: string
          description: Second trailer unit ID (optional)
          example: "202"
        notes:
          type: string
          description: Additional notes about the inspection
          example: Inspection completed successfully
      required:
        - type
        - dateTime
        - driverId
        - vehicleUnitId
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
    ApiIdAuth:
      type: apiKey
      in: header
      name: x-api-id
security:
  - ApiIdAuth: []
    ApiKeyAuth: []
tags:
  - name: Vehicle
    description: Vehicle Endpoint Definitions
  - name: Trailer
    description: Trailer Endpoint Definitions
  - name: Drivers
    description: Driver Endpoint Definitions
  - name: Location
    description: Location Endpoint Definitions
  - name: Vision
    description: Vision Endpoint Definitions
  - name: Trip Inspection
    description: Trip Inspection Endpoint Definitions
