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

# Add a driver

> Creates (or finds) the driver’s app account by email, joins them to the fleet and emails them a link to set a password.

Requires the `drivers:write` scope.

Accepts an `Idempotency-Key` header.



## OpenAPI

````yaml /api-reference/openapi.json post /drivers
openapi: 3.1.0
info:
  title: ChargeExpress Fleet API
  version: v1
  description: >-
    Manage your fleet’s drivers, vehicles, limits, charging and wallet, and
    receive webhooks.


    Scopes: `fleet:read` (Read the fleet, drivers, vehicles, sessions, wallet,
    invoices and events); `drivers:write` (Create, update, suspend and remove
    drivers); `vehicles:write` (Create, update and retire vehicles);
    `limits:write` (Change fleet and driver charging limits); `wallet:write`
    (Fund the wallet, pay usage invoices and set the low-balance alert);
    `webhooks:write` (Manage webhook endpoints and redeliver events).
servers:
  - url: https://partners.chargeexpressltd.com/api/public/v1
    description: Production
  - url: https://stage.partners.chargeexpressltd.com/api/public/v1
    description: Stage
security:
  - apiKey: []
paths:
  /drivers:
    post:
      tags:
        - Drivers
      summary: Add a driver
      description: >-
        Creates (or finds) the driver’s app account by email, joins them to the
        fleet and emails them a link to set a password.


        Requires the `drivers:write` scope.


        Accepts an `Idempotency-Key` header.
      operationId: addDriver
      parameters:
        - schema:
            type: string
            maxLength: 255
          required: false
          name: Idempotency-Key
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  minLength: 1
                  maxLength: 255
                last_name:
                  type: string
                  minLength: 1
                  maxLength: 255
                email:
                  type: string
                  maxLength: 255
                  format: email
                phone:
                  type: string
                  pattern: ^\+?[0-9\s-]{9,16}$
                date_of_birth:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                gender:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      enum:
                        - male
                        - female
                national_id:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^GHA-\d{9}-\d$
                address:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      minLength: 1
                      maxLength: 255
                city:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      minLength: 1
                      maxLength: 128
                employee_id:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      minLength: 1
                      maxLength: 64
                hire_date:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                license_number:
                  type: string
                  minLength: 1
                  maxLength: 128
                license_class:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      minLength: 1
                      maxLength: 8
                license_issued_at:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                license_expires_at:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                emergency_contact_name:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      minLength: 1
                      maxLength: 255
                emergency_contact_phone:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^\+?[0-9\s-]{9,16}$
                emergency_contact_relationship:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      minLength: 1
                      maxLength: 32
                vehicle_id:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      pattern: ^[a-z][a-z0-9]{23,31}$
                notes:
                  anyOf:
                    - type: string
                      enum:
                        - ''
                    - type: string
                      maxLength: 5000
              required:
                - first_name
                - last_name
                - email
                - phone
                - license_number
                - license_expires_at
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Driver'
                  - type: object
                    properties:
                      login_invite:
                        type: object
                        properties:
                          status:
                            type: string
                          message:
                            type: string
                        required:
                          - status
                          - message
                    required:
                      - login_invite
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The key lacks the scope this request needs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Conflict with the current state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    Driver:
      type: object
      properties:
        object:
          type: string
          enum:
            - driver
        id:
          type: string
        status:
          type: string
          enum:
            - active
            - suspended
            - pending
            - archived
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        phone:
          type:
            - string
            - 'null'
        employee_id:
          type:
            - string
            - 'null'
        license_number:
          type:
            - string
            - 'null'
        license_expires_at:
          type:
            - string
            - 'null'
          format: date
        photo_url:
          type:
            - string
            - 'null'
        vehicle_ids:
          type: array
          items:
            type: string
        profile:
          type:
            - object
            - 'null'
          additionalProperties: {}
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - status
        - first_name
        - last_name
        - email
        - phone
        - employee_id
        - license_number
        - license_expires_at
        - photo_url
        - vehicle_ids
        - profile
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - permission_error
                - invalid_request_error
                - rate_limit_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - request_id
      required:
        - error
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Your fleet API key, e.g. `Authorization: Bearer cxk_live_…`. Create keys
        in the fleet portal under Developers.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.