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

# Add

> Adds a driver to SmartCP Logistics. Only `surname` and `name` are required; all other supported driver details can be supplied when available.



## OpenAPI

````yaml https://logistics.api.smartcp.org/openapi/drivers.openapi.json POST /drivers
openapi: 3.0.3
info:
  title: SmartCP Logistics Drivers API
  version: 1.0.0
  description: >-
    Driver listing and creation endpoints for the SmartCP Logistics public REST
    API.
servers:
  - url: https://logistics.api.smartcp.org/v1
    description: Production
security:
  - bearerAuth: []
    directoryHeader: []
paths:
  /drivers:
    post:
      summary: Add Driver
      description: >-
        Adds a driver to SmartCP Logistics. Only `surname` and `name` are
        required; all other supported driver details can be supplied when
        available.
      operationId: createDriver
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDriverRequest'
            example:
              surname: Kowalski
              name: Jan
              phone: +48 123 456 789
              id_number: ABC123456
              employment: Employment contract
              permitted_countries:
                - de
                - fr
              license_category: C+E
              driver_license_number: 12345/26
              driver_card_id: PL1234567890
              trainee: false
              adr: true
              avsec: false
              gdp: false
              tapa: false
      responses:
        '201':
          description: Driver created successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseSuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/CreatedDriver'
              example:
                status: 201
                message: Created
                data:
                  id: 125
                  surname: KOWALSKI
                  name: JAN
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '422':
          $ref: '#/components/responses/ValidationErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequestsResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  schemas:
    CreateDriverRequest:
      type: object
      required:
        - surname
        - name
      properties:
        surname:
          type: string
          maxLength: 64
          description: Driver surname.
          example: Kowalski
        name:
          type: string
          maxLength: 64
          description: Driver first name.
          example: Jan
        phone:
          type: string
          nullable: true
          maxLength: 32
          description: Driver phone number.
          example: +48 123 456 789
        id_number:
          type: string
          nullable: true
          maxLength: 64
          description: Identification document number.
          example: ABC123456
        employment:
          type: string
          nullable: true
          maxLength: 32
          description: Employment type or description.
          example: Employment contract
        permitted_countries:
          type: array
          nullable: true
          description: Country codes in which the driver is permitted to operate.
          items:
            type: string
            maxLength: 8
          example:
            - de
            - fr
        license_category:
          type: string
          nullable: true
          maxLength: 16
          description: Driving licence category.
          example: C+E
        driver_license_number:
          type: string
          nullable: true
          maxLength: 16
          description: Driving licence number.
          example: 12345/26
        driver_card_id:
          type: string
          nullable: true
          maxLength: 32
          description: Driver card identifier.
          example: PL1234567890
        trainee:
          type: boolean
          nullable: true
          default: false
          description: Marks the driver as a trainee.
        adr:
          type: boolean
          nullable: true
          default: false
          description: Indicates that the driver has ADR qualifications.
        avsec:
          type: boolean
          nullable: true
          default: false
          description: Indicates that the driver has AVSEC qualifications.
        gdp:
          type: boolean
          nullable: true
          default: false
          description: Indicates that the driver has GDP qualifications.
        tapa:
          type: boolean
          nullable: true
          default: false
          description: Indicates that the driver has TAPA qualifications.
    BaseSuccessResponse:
      type: object
      required:
        - status
        - message
        - data
      properties:
        status:
          type: integer
          example: 201
        message:
          type: string
          example: Created
        data:
          nullable: true
    CreatedDriver:
      type: object
      required:
        - id
        - surname
        - name
      properties:
        id:
          type: integer
          description: Created driver ID.
          example: 125
        surname:
          type: string
          description: Stored driver surname.
          example: KOWALSKI
        name:
          type: string
          description: Stored driver first name.
          example: JAN
    StringErrorResponse:
      type: object
      required:
        - status
        - message
        - data
      properties:
        status:
          type: integer
          example: 422
        message:
          type: string
          example: The surname field is required.
        data:
          nullable: true
          example: null
  responses:
    UnauthorizedResponse:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 401
            message: Authentication failed
            data: null
    ValidationErrorResponse:
      description: Validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 422
            message: The surname field is required.
            data: null
    TooManyRequestsResponse:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 429
            message: Too Many Attempts.
            data: null
    InternalServerErrorResponse:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StringErrorResponse'
          example:
            status: 500
            message: Internal Server Error
            data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Client API key sent as a bearer token.
    directoryHeader:
      type: apiKey
      in: header
      name: X-Client-Directory
      description: >-
        Client directory identifier. Legacy `directory` header is still accepted
        for backward compatibility.

````

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