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

# Create Driver

> Creates a new driver with the provided details, including name, contact information, driver type, employee status, and optional license and dispatch information.



## OpenAPI

````yaml POST /drivers/create/
openapi: 3.0.1
info:
  title: OpenAPI Datatruck
  description: >-
    To be able to use Datatruck OpenAPI you should create tokens from your
    dashboard. Go to your dashboard and create token with appropriate scopes and
    expiration. Expiration and scopes are optional as well as description for
    your token, but remember name is required.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://{company}.datatruck.io/api/v1/openapi/
security: []
paths:
  /drivers/create/:
    post:
      summary: Create Driver
      description: >-
        Creates a new driver with the provided details, including name, contact
        information, driver type, employee status, and optional license and
        dispatch information.
      operationId: createDriver
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDriverRequest'
            example:
              first_name: John
              last_name: Smith
              contact_number: +1-555-0123
              driver_type: Company Driver
              new_employee_status: Active
              status: Available
              telegram_number: blank
              is_main: true
              mc_number: 1
              birth_date: '1985-06-15'
              driver_license: D1234567
              driver_license_issue_date: '2020-03-10'
              driver_license_state: CA
              driver_license_expiration: '2028-03-10'
              driver_license_class: A
              dispatch_status: 1
              email: jsmith@example.com
      responses:
        '201':
          description: Driver successfully created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: success
        '400':
          description: Invalid request data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateDriverRequest:
      type: object
      properties:
        first_name:
          type: string
          example: John
          description: First name of the driver.
        last_name:
          type: string
          example: Smith
          description: Last name of the driver.
        contact_number:
          type: string
          example: +1-555-0123
          description: Contact number of the driver.
        driver_type:
          type: string
          example: Company Driver
          description: Type of driver.
        new_employee_status:
          type: string
          example: Active
          description: Employment status of the driver.
        status:
          type: string
          nullable: true
          example: Available
          description: Current status of the driver, if applicable.
        telegram_number:
          type: string
          nullable: true
          default: blank
          example: blank
          description: Telegram contact number, if provided.
        is_main:
          type: boolean
          default: true
          example: true
          description: Indicates if the driver is the main driver.
        mc_number:
          type: integer
          example: 1
          description: Motor carrier number ID (must be an existing MC number ID).
        birth_date:
          type: string
          format: date
          nullable: true
          example: '1985-06-15'
          description: Driver's birth date in YYYY-MM-DD format, if provided.
        driver_license:
          type: string
          nullable: true
          example: D1234567
          description: Driver's license number, if provided.
        driver_license_issue_date:
          type: string
          format: date
          nullable: true
          example: '2020-03-10'
          description: >-
            Issue date of the driver's license in YYYY-MM-DD format, if
            provided.
        driver_license_state:
          type: string
          nullable: true
          example: CA
          description: State issuing the driver's license, if provided.
        driver_license_expiration:
          type: string
          format: date
          nullable: true
          example: '2028-03-10'
          description: >-
            Expiration date of the driver's license in YYYY-MM-DD format, if
            provided.
        driver_license_class:
          type: string
          nullable: true
          example: A
          description: Class of the driver's license, if provided.
        dispatch_status:
          type: integer
          nullable: true
          example: 1
          description: Dispatch status ID (integer), if applicable.
        email:
          type: string
          format: email
          nullable: true
          example: jsmith@example.com
          description: Email address of the driver, if provided.
      required:
        - first_name
        - last_name
        - contact_number
        - driver_type
        - new_employee_status
        - mc_number
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````