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

# Update a vehicle

> Requires the `vehicles:write` scope.



## OpenAPI

````yaml /api-reference/openapi.json patch /vehicles/{vehicleId}
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:
  /vehicles/{vehicleId}:
    patch:
      tags:
        - Vehicles
      summary: Update a vehicle
      description: Requires the `vehicles:write` scope.
      operationId: updateVehicle
      parameters:
        - schema:
            type: string
          required: true
          name: vehicleId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                vehicle_type_id:
                  type: integer
                  exclusiveMinimum: 0
                vehicle_model_id:
                  type: integer
                  exclusiveMinimum: 0
                registration_number:
                  type: string
                  minLength: 1
                  maxLength: 32
                vin:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 64
                asset_tag:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 64
                description:
                  type:
                    - string
                    - 'null'
                  maxLength: 5000
                driver_id:
                  type:
                    - string
                    - 'null'
                  pattern: ^[a-z][a-z0-9]{23,31}$
                status:
                  type: string
                  enum:
                    - active
                    - maintenance
                    - inactive
                    - retired
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vehicle'
        '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:
    Vehicle:
      type: object
      properties:
        object:
          type: string
          enum:
            - vehicle
        id:
          type: string
        registration_number:
          type: string
        vin:
          type:
            - string
            - 'null'
        asset_tag:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - active
            - maintenance
            - inactive
            - retired
        vehicle_type_id:
          type:
            - integer
            - 'null'
        vehicle_model_id:
          type:
            - integer
            - 'null'
        brand:
          type:
            - string
            - 'null'
        model:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        driver_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - object
        - id
        - registration_number
        - vin
        - asset_tag
        - status
        - vehicle_type_id
        - vehicle_model_id
        - brand
        - model
        - description
        - image_url
        - driver_id
        - 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.