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

# Update Truck

> Update truck.



## OpenAPI

````yaml /spec/oas.yaml patch /locations/{location_id}/trucks/{truck_id}
openapi: 3.0.3
info:
  title: CRO Software API
  version: 2.x
  description: >-
    REST API for the CRO Software waste management and logistics platform.
    Authenticate via OAuth2 (client_credentials or authorization_code). All
    requests require a Bearer token and an X-Tenant-Id header.
servers:
  - url: https://api.crosoftware.com/v0
    description: Production
security: []
paths:
  /locations/{location_id}/trucks/{truck_id}:
    patch:
      tags:
        - Trucks
      summary: Update Truck
      description: Update truck.
      operationId: trucks_update_truck
      parameters:
        - name: location_id
          in: path
          required: true
          schema:
            type: integer
            format: int64
            description: Location identifier.
        - name: truck_id
          in: path
          required: true
          schema:
            type: integer
            format: int64
            description: Truck identifier.
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            description: Version identifier (date format).
        - name: x-tenant-id
          in: header
          required: true
          schema:
            type: integer
            format: int64
            description: >-
              Tenant identifier. Contact [CRO
              Software](https://crosoftwaresolutions.com/) for more info if you
              don't already have this id. See [list tenant
              ids](/docs/requests/tenants_list_tenants) for info on listing the
              tenants you have access to.
        - name: driver_id
          in: query
          required: true
          schema:
            type: string
            description: Driver identifier.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTruckRequestModel'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TruckModel'
      security:
        - oauth2:
            - api
components:
  schemas:
    UpdateTruckRequestModel:
      type: object
      description: Update truck values.
      properties:
        driver_id:
          type: string
          description: >-
            Driver identifier. A null driver_id resets the truck to have no
            driver.
    TruckModel:
      type: object
      description: Truck profile.
      properties:
        driver_id:
          type: string
          description: Driver identifier.
        id:
          type: integer
          format: int64
          description: Resource identifier.
        interface_color:
          type: string
          description: Hex string color identifier.
        is_deactivated:
          type: boolean
          description: Truck inactive if TRUE.
        location_id:
          type: integer
          format: int64
          description: Location identifier.
        name:
          type: string
          description: Name (free text).
        notes:
          type: string
          description: Notes (free text).
        out_of_service:
          type: boolean
          description: Truck out of service.
        require_odometer:
          type: boolean
          description: Require odometer.
        third_party_hauler_id:
          type: string
          format: uuid
          description: Third party hauler identifier.
        trailer_id:
          type: integer
          format: int64
          description: Trailer record identifier.
        type:
          type: string
          description: Truck type (free text).
        weight:
          type: string
          description: Truck empty weight.
      required:
        - driver_id
        - id
        - interface_color
        - is_deactivated
        - location_id
        - name
        - notes
        - out_of_service
        - require_odometer
        - third_party_hauler_id
        - trailer_id
        - type
        - weight
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/token
          scopes:
            api: General API access
            webhook: Webhook management
        authorizationCode:
          authorizationUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/auth
          tokenUrl: REPLACE_WITH_AUTH_BASE_URL/oauth2/token
          scopes:
            api: General API access
            webhook: Webhook management

````