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

# Available Time for Drivers

> List available time for the driver. This endpoint provides live access to the driver's available time. Different than most endpoints, this endpoint calls the provider's API in real time to get the latest available time for the driver. This endpoint is useful for building real time applications that need to know the driver's available time.



## OpenAPI

````yaml GET /hos/available-time
openapi: 3.1.0
info:
  title: Terminal Telematics API
  description: >-
    Terminal is a unified API that makes it easy to integrate with the leading
    telematics service providers.
  version: '0.0'
  contact:
    name: Terminal
    email: connect@withterminal.com
    url: https://www.withterminal.com
servers:
  - url: https://api.withterminal.com/tsp/v1
    description: Production
  - url: https://api.sandbox.withterminal.com/tsp/v1
    description: Sandbox
security:
  - Authorization: []
tags:
  - name: Authentication
  - name: Connections
  - name: Data Management
  - name: Drivers
  - name: Groups
  - name: Hours of Service
  - name: IFTA
  - name: Issues
  - name: Link
  - name: Providers
  - name: Safety
  - name: Trailers
  - name: Vehicles
  - name: Vehicle Utilization
  - name: Webhook Events
paths:
  /hos/available-time:
    parameters: []
    get:
      tags:
        - Hours of Service
      summary: Available Time for Drivers
      description: >-
        List available time for the driver. This endpoint provides live access
        to the driver's available time. Different than most endpoints, this
        endpoint calls the provider's API in real time to get the latest
        available time for the driver. This endpoint is useful for building real
        time applications that need to know the driver's available time.
      operationId: listHOSAvailableTime
      parameters:
        - name: Connection-Token
          in: header
          required: true
          schema:
            type: string
            example: con_tkn_22vUhkC6tgre4kwaYfUkCDA1rzn6eyb4
            pattern: ^con_tkn_\S+$
          description: >-
            The token returned when a user authenticated their account. This
            authorizes access to a specific account.
        - name: cursor
          in: query
          schema:
            type: string
            format: cursor
            example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
          description: Pagination cursor to start requests from
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: The maximum number of results to return in a page.
        - name: driverIds
          in: query
          required: false
          schema:
            type: string
            pattern: ^drv_[0-9A-HJKMNP-TV-Z]{26}(\s*,\s*drv_[0-9A-HJKMNP-TV-Z]{26})*$
          description: >-
            Comma separated list of driver IDs to filter for. Can filter up to
            50 drivers at a time. Each ID must use the `drv_` prefix.
        - schema:
            type: string
            enum:
              - driver
          in: query
          name: expand
          description: Expand resources in the returned response
        - name: raw
          in: query
          required: false
          schema:
            type: boolean
          description: >-
            Include raw responses used to normalize model. Used for debugging or
            accessing unique properties that are not unified.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      title: HOS Available Time
                      type: object
                      x-model-category: real-time
                      properties:
                        provider:
                          title: Provider Code
                          type: string
                          example: geotab
                          description: >-
                            Every provider has a unique code to identify it
                            across Terminal's system. You can find each
                            provider's code under [provider
                            details](/providers).
                        driver:
                          description: Reference to the driver for this log
                          example: drv_01D8ZQFGHVJ858NBF2Q7DV9MNC
                          oneOf:
                            - title: DriverId
                              description: Unique identifier for the driver in Terminal.
                              type: string
                              format: ulid
                              pattern: ^drv_[0-9A-HJKMNP-TV-Z]{26}$
                              example: drv_01D8ZQFGHVJ858NBF2Q7DV9MNC
                            - title: Expanded Driver
                              type: object
                              properties:
                                id:
                                  title: DriverId
                                  description: >-
                                    Unique identifier for the driver in
                                    Terminal.
                                  type: string
                                  format: ulid
                                  pattern: ^drv_[0-9A-HJKMNP-TV-Z]{26}$
                                  example: drv_01D8ZQFGHVJ858NBF2Q7DV9MNC
                              required:
                                - id
                        currentStatus:
                          description: The current status of the driver
                          type: string
                          enum:
                            - off_duty
                            - sleeper_bed
                            - driving
                            - on_duty
                            - yard_move
                            - personal_conveyance
                            - waiting_time
                        availableTime:
                          type: object
                          example:
                            cycle: 252000000
                            shift: 50400000
                            drive: 39600000
                            break: 28800000
                          description: Available time remaning in milliseconds
                          properties:
                            cycle:
                              example: 252000000
                              description: >-
                                The total remaining time for the driver's
                                current cycle (ex: 70 hours). Value is in
                                milliseconds.
                              title: DurationInMS
                              type: integer
                            shift:
                              example: 50400000
                              description: >-
                                The total remaining time for the driver's
                                current shift (ex: 14 hours). Value is in
                                milliseconds.
                              title: DurationInMS
                              type: integer
                            drive:
                              example: 39600000
                              description: >-
                                The total remaining drive time for the driver's
                                current shift (ex: 11 hours). Value is in
                                milliseconds.
                              title: DurationInMS
                              type: integer
                            break:
                              example: 28800000
                              description: >-
                                The amount of time before the next break is
                                required (ex: 8 hours). Value is in
                                milliseconds.
                              title: DurationInMS
                              type: integer
                        raw:
                          title: RawDataList
                          type: array
                          example: []
                          items:
                            title: RawData
                            type: object
                            properties:
                              provider:
                                type: string
                              schema:
                                type: string
                              extractedAt:
                                type: string
                              data:
                                type: object
                            required:
                              - provider
                              - schema
                              - extractedAt
                              - data
                      required:
                        - provider
                        - driver
                        - availableTime
                      x-description: >-
                        The available time left on the clock for a specific
                        driver.
                  next:
                    title: Pagination Cursor
                    type: string
                    example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw
                    description: Cursor used for pagination.
                    format: cursor
                required:
                  - results
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - bad_request
                  message:
                    type: string
                    example: Invalid request body
                  detail:
                    type: array
                    items:
                      title: ErrorPathDetail
                      type: object
                      properties:
                        message:
                          type: string
                          example: '''vehicleId'' property must be a valid ulid'
                        path:
                          type: string
                          example: '{requestQuery}.vehicleId'
                        suggestion:
                          type: string
                          example: >-
                            Please ensure you submit a valid 'vehicleId'
                            property
                        context:
                          type: object
                      required:
                        - message
                        - path
                required:
                  - code
                  - message
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - unauthorized
                  message:
                    type: string
                    example: Unauthorized Request
                  detail:
                    type: string
                    example: Please ensure you have a valid API key
                required:
                  - code
                  - message
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - forbidden
                  message:
                    type: string
                    example: Forbidden Request
                  detail:
                    type: string
                    example: >-
                      Please ensure the connection token matches the resource
                      you are attempting to access.
                required:
                  - code
                  - message
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - unprocessable_entity
                      - connection_disconnected
                      - insufficient_permissions
                      - invalid_credentials
                    example: connection_disconnected
                  message:
                    type: string
                    example: Connection must be connected to perform this action
                  detail:
                    type: array
                    items:
                      title: ErrorPathDetail
                      type: object
                      properties:
                        message:
                          type: string
                          example: '''vehicleId'' property must be a valid ulid'
                        path:
                          type: string
                          example: '{requestQuery}.vehicleId'
                        suggestion:
                          type: string
                          example: >-
                            Please ensure you submit a valid 'vehicleId'
                            property
                        context:
                          type: object
                      required:
                        - message
                        - path
                    example: []
                required:
                  - code
                  - message
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                properties:
                  code:
                    enum:
                      - too_many_requests
                  retryAfter:
                    description: The number of seconds to wait before retrying the request
                    type: integer
                    example: 60
                  message:
                    type: string
                    example: Too Many Requests
                  detail:
                    type: string
                    example: You have exceeded your rate limit. Please try again later.
                required:
                  - code
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - internal_server_error
                  message:
                    type: string
                    example: Internal Server Error
                  detail:
                    type: string
                    example: Something went wrong
                required:
                  - code
                  - message
        '501':
          description: Not Implemented
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - not_implemented
                  message:
                    type: string
                    example: Not Implemented
                  detail:
                    type: string
                    example: This endpoint is not yet implemented
                required:
                  - code
                  - message
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - bad_gateway
                  message:
                    type: string
                    example: Provider Unavailable
                  detail:
                    type: string
                    example: Error response received from provider with status 500
                required:
                  - code
                  - message
        '503':
          description: Provider Unavailable Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - provider_unavailable
                  message:
                    type: string
                    example: Provider is not currently available
                required:
                  - code
                  - message
        '504':
          description: Gateway Timeout Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    enum:
                      - gateway_timeout
                  message:
                    type: string
                    example: Gateway Timeout
                required:
                  - code
                  - message
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````