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

# Update a driver

> Partially updates a driver. Set `reactivate: true` to clear `deactivated_at` and restore an inactive driver.



## OpenAPI

````yaml /openapi.json patch /drivers/{id}
openapi: 3.1.0
info:
  title: United Logistics API
  version: 0.1.0
  description: >-
    Industry-grade public API for fleet, fuel, and toll operations. Every
    endpoint is scoped to the organization owning the API key. Authentication:
    bearer API key (`ulk_<prefix>_<secret>`). Rate limit: 60 requests/minute/key
    by default (override per key via the dashboard).
  contact:
    name: United Logistics Engineering
    email: sfuentes@assetmg.tech
servers:
  - url: https://app.unitedlogistics.com.do/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /drivers/{id}:
    patch:
      tags:
        - Drivers
      summary: Update a driver
      description: >-
        Partially updates a driver. Set `reactivate: true` to clear
        `deactivated_at` and restore an inactive driver.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDriverRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriverResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObject'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateDriverRequest:
      type: object
      properties:
        external_id:
          type: integer
          exclusiveMinimum: 0
        provider:
          anyOf:
            - type: string
              enum:
                - karma
                - internal
            - type: string
              pattern: ^[a-z][a-z0-9][a-z0-9_-]{0,62}$
        name:
          type: string
          minLength: 1
          maxLength: 200
        driver_key:
          type: string
          minLength: 1
          maxLength: 200
        license_number:
          type:
            - string
            - 'null'
          maxLength: 100
        profile_picture_url:
          type:
            - string
            - 'null'
          format: uri
        status:
          type: string
          enum:
            - active
            - inactive
            - on_leave
            - suspended
        phone_number:
          type:
            - string
            - 'null'
          maxLength: 50
        email:
          anyOf:
            - type:
                - string
                - 'null'
              maxLength: 200
              format: email
            - type: string
              enum:
                - ''
            - type: 'null'
        notes:
          type:
            - string
            - 'null'
          maxLength: 2000
        reactivate:
          type: boolean
    DriverResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Driver'
      required:
        - data
    ErrorObject:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: unauthorized
            message:
              type: string
              example: Missing Authorization header.
            details: {}
          required:
            - code
            - message
      required:
        - error
    Driver:
      type: object
      properties:
        id:
          type: string
          format: uuid
        external_id:
          type: integer
          description: >-
            Org-scoped integer id used as the natural key when paired with
            `provider`.
        provider:
          $ref: '#/components/schemas/Provider'
        org_id:
          type: string
          format: uuid
        name:
          type: string
        driver_key:
          type: string
          description: Unique RFID/credential the driver presents on the in-vehicle device.
        license_number:
          type:
            - string
            - 'null'
        profile_picture_url:
          type:
            - string
            - 'null'
        status:
          type:
            - string
            - 'null'
        phone_number:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        notes:
          type:
            - string
            - 'null'
        deactivated_at:
          type:
            - string
            - 'null'
        deactivation_reason:
          type:
            - string
            - 'null'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - external_id
        - provider
        - org_id
        - name
        - driver_key
        - license_number
        - profile_picture_url
        - status
        - phone_number
        - email
        - notes
        - deactivated_at
        - deactivation_reason
        - created_at
        - updated_at
    Provider:
      anyOf:
        - type: string
          enum:
            - karma
            - internal
        - type: string
          pattern: ^[a-z][a-z0-9][a-z0-9_-]{0,62}$
      description: >-
        Registered: karma (Karma sync), internal (created in the app). Custom
        integrators use a stable lowercase slug.
      example: karma
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: ulk_<prefix>_<secret>
      description: >-
        Authorization: Bearer ulk_<prefix>_<secret>. Cree la clave en
        Configuración → API.

````