> ## 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 vehicle

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



## OpenAPI

````yaml /openapi.json patch /vehicles/{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:
  /vehicles/{id}:
    patch:
      tags:
        - Vehicles
      summary: Update a vehicle
      description: >-
        Partially updates a vehicle. Set `reactivate: true` to clear
        `deactivated_at` and restore an inactive vehicle.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateVehicleRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VehicleResponse'
        '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:
    UpdateVehicleRequest:
      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}$
        fleet_id:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
        device_id:
          type:
            - integer
            - 'null'
        time_zone:
          type:
            - string
            - 'null'
          enum:
            - America/Santo_Domingo
            - America/New_York
            - America/Puerto_Rico
            - America/Bogota
            - America/Caracas
            - America/Panama
            - America/Mexico_City
            - America/Guatemala
            - America/Chicago
            - America/Denver
            - America/Phoenix
            - America/Los_Angeles
            - America/Havana
            - America/Jamaica
            - America/Lima
            - America/Santiago
            - America/Buenos_Aires
            - America/Sao_Paulo
            - UTC
        number:
          type:
            - string
            - 'null'
          maxLength: 200
        license_plate:
          type:
            - string
            - 'null'
          maxLength: 100
        title:
          type:
            - string
            - 'null'
          maxLength: 200
        type:
          type:
            - string
            - 'null'
          maxLength: 100
        sub_type:
          type:
            - string
            - 'null'
          maxLength: 100
        year:
          type:
            - string
            - 'null'
          maxLength: 20
        color:
          type:
            - string
            - 'null'
          maxLength: 50
        sim_imsi:
          type:
            - string
            - 'null'
          maxLength: 50
        sim_phone:
          type:
            - string
            - 'null'
          maxLength: 50
        vehicle_type:
          type:
            - string
            - 'null'
          maxLength: 100
        provider_metadata: {}
        maintenance_status:
          type:
            - boolean
            - 'null'
        reactivate:
          type: boolean
    VehicleResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Vehicle'
      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
    Vehicle:
      type: object
      properties:
        id:
          type: string
          format: uuid
        external_id:
          type: integer
        provider:
          $ref: '#/components/schemas/Provider'
        org_id:
          type: string
          format: uuid
        fleet_id:
          type:
            - integer
            - 'null'
        device_id:
          type:
            - integer
            - 'null'
        time_zone:
          type:
            - string
            - 'null'
          enum:
            - America/Santo_Domingo
            - America/New_York
            - America/Puerto_Rico
            - America/Bogota
            - America/Caracas
            - America/Panama
            - America/Mexico_City
            - America/Guatemala
            - America/Chicago
            - America/Denver
            - America/Phoenix
            - America/Los_Angeles
            - America/Havana
            - America/Jamaica
            - America/Lima
            - America/Santiago
            - America/Buenos_Aires
            - America/Sao_Paulo
            - UTC
          description: >-
            IANA time zone for trip and event timestamps (e.g.
            America/Santo_Domingo).
          example: America/Santo_Domingo
        number:
          type:
            - string
            - 'null'
        license_plate:
          type:
            - string
            - 'null'
        title:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
          description: >-
            Raw vehicle type string as reported by the provider (e.g. 'truck',
            'sedan').
        sub_type:
          type:
            - string
            - 'null'
        year:
          type:
            - string
            - 'null'
        color:
          type:
            - string
            - 'null'
        sim_imsi:
          type:
            - string
            - 'null'
        sim_phone:
          type:
            - string
            - 'null'
        provider_metadata:
          description: >-
            Free-form provider-specific structured metadata. Schema varies by
            provider.
        fetch_timestamp:
          type:
            - string
            - 'null'
        icon_url:
          type:
            - string
            - 'null'
        maintenance_status:
          type:
            - boolean
            - 'null'
        vehicle_type:
          type:
            - string
            - 'null'
          description: >-
            User-curated vehicle classification used for analytics (overrides
            `type`).
        deactivated_at:
          type:
            - string
            - 'null'
        deactivation_reason:
          type:
            - string
            - 'null'
      required:
        - id
        - external_id
        - provider
        - org_id
        - fleet_id
        - device_id
        - time_zone
        - number
        - license_plate
        - title
        - type
        - sub_type
        - year
        - color
        - sim_imsi
        - sim_phone
        - fetch_timestamp
        - icon_url
        - maintenance_status
        - vehicle_type
        - deactivated_at
        - deactivation_reason
    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.

````