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

# Find vehicles

> Receive all of the vehicles that are registered under an asset provider



## OpenAPI

````yaml /api-reference/m2m-api.yml post /api/fleets/v1/{assetProviderCountryCode}/{assetProviderCode}/vehicles
openapi: 3.0.3
info:
  title: M2M API
  version: '@version@'
servers:
  - url: https://api.smartmove.eu/m2m
security: []
tags:
  - name: Vehicles
  - name: Maintenance
  - name: Logbook
  - name: Drivers
  - name: Users
  - name: Checklist
  - name: Incidents
  - name: Databox
  - name: Assets
  - name: Asset Provider
  - name: Invoices
paths:
  /api/fleets/v1/{assetProviderCountryCode}/{assetProviderCode}/vehicles:
    post:
      tags:
        - Vehicles
      summary: Find vehicles
      description: Receive all of the vehicles that are registered under an asset provider
      operationId: searchVehicles
      parameters:
        - in: path
          name: assetProviderCountryCode
          schema:
            type: string
            minLength: 2
            maxLength: 2
          required: true
          example: AT
          description: >-
            The two-letter country code of the asset provider the vehicles
            belong to
        - in: path
          name: assetProviderCode
          schema:
            type: string
            minLength: 3
            maxLength: 3
          required: true
          example: ABC
          description: >-
            The three-character code of the asset provider the vehicles belong
            to
      requestBody:
        required: false
        description: >-
          The request body enables to paginate through all the vehicles, as well
          as to filter and search for vehicles fulfilling certain requirements
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchVehiclesRequest'
      responses:
        '200':
          description: Paginated response of the vehicles where the filters apply
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VehiclesPage'
        '401':
          description: Required and valid bearer token was not included
        '403':
          description: Access to the requested asset provider has been rejected
        '404':
          description: Could not find vehicles of that asset provider
      security:
        - oauth:
            - openid
components:
  schemas:
    SearchVehiclesRequest:
      type: object
      properties:
        searchText:
          type: string
          description: >
            The given search text filters the vehicles including the text in one
            of the following fields:
              * vin
              * license plate
              * vendor
              * model
              * variant
        pagination:
          $ref: '#/components/schemas/PaginationRequest'
        filters:
          type: array
          description: >-
            Allows to filter vehicles for the given requirements. All filters
            are combined with AND operators.
          items:
            $ref: '#/components/schemas/VehicleSearchFilterItem'
        sorting:
          type: array
          description: Allows to sort vehicles by given fields in order of items in array.
          items:
            $ref: '#/components/schemas/VehicleSearchSortItem'
    VehiclesPage:
      type: object
      required:
        - items
        - pagination
      properties:
        items:
          $ref: '#/components/schemas/VehicleList'
        pagination:
          $ref: '#/components/schemas/PaginationResult'
    PaginationRequest:
      description: Request what page is wanted to be retrieved
      type: object
      required:
        - pageSize
        - page
      properties:
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
        page:
          type: integer
          minimum: 0
          default: 0
    VehicleSearchFilterItem:
      description: Allows to filter for specific requirements
      type: object
      required:
        - field
        - operation
      properties:
        field:
          type: string
          enum:
            - status.lastUpdated
            - status.odometer
            - status.reach
            - status.fuelLevel
            - information.make
            - information.model
            - information.vin
            - information.licensePlate
            - information.variant
            - driver.driverId
            - driver.mobilityProviderCountryCode
            - driver.mobilityProviderCode
        operation:
          $ref: '#/components/schemas/FilterValues'
        value:
          description: arbitrary value depending on field and operation
    VehicleSearchSortItem:
      description: Allows to sort by fields
      type: object
      required:
        - by
        - direction
      properties:
        by:
          type: string
          enum:
            - status.lastUpdated
            - status.odometer
            - status.reach
            - status.fuelLevel
            - information.make
            - information.model
            - information.vin
            - information.licensePlate
            - information.variant
        direction:
          type: string
          enum:
            - ASC
            - DESC
    VehicleList:
      type: array
      items:
        $ref: '#/components/schemas/Vehicle'
    PaginationResult:
      type: object
      required:
        - pageNumber
        - pageSize
        - totalEntries
      properties:
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
        pageNumber:
          type: integer
          minimum: 0
          default: 0
        totalEntries:
          type: integer
          minimum: 0
    FilterValues:
      type: string
      enum:
        - IN
        - LIKE
        - NOT_LIKE
        - EQUALS
        - NOT_EQUALS
        - BEFORE
        - BEFORE_EQUALS
        - AFTER
        - AFTER_EQUALS
        - SMALLER
        - SMALLER_EQUALS
        - GREATER
        - GREATER_EQUALS
        - IS_NULL
    Vehicle:
      type: object
      required:
        - asset
        - information
        - status
      properties:
        asset:
          $ref: '#/components/schemas/Asset'
        information:
          $ref: '#/components/schemas/VehicleInformation'
        status:
          $ref: '#/components/schemas/VehicleStatus'
    Asset:
      type: object
      required:
        - id
        - assetProviderCountryCode
        - assetProviderCode
      properties:
        id:
          type: string
          example: AT*ABC*V1000000
        assetProviderCountryCode:
          type: string
          example: AT
        assetProviderCode:
          type: string
          example: ABC
        blobUuid:
          type: string
          format: uuid
          example: a79abfff-bcdb-4bd1-b999-af29fe3d9056
        defaultImage:
          type: string
          example: https://some.storage.website/image.png
        active:
          type: boolean
    VehicleInformation:
      type: object
      required:
        - vin
      properties:
        vin:
          type: string
          example: 0F0EAATTRBPC3CDBB
        vendor:
          type: string
          example: BMW
        model:
          type: string
          example: Zoe
        variant:
          type: string
          example: Long Range
        licensePlate:
          type: string
          example: W-53A
        fuelType:
          type: string
          enum:
            - DIESEL
            - REGULAR
            - PLUS
            - ELECTRIC
            - HYBRID
            - PLUGINHYBRID
        seats:
          type: integer
          example: 5
        gear:
          type: string
          enum:
            - Manual
            - Automatic
            - SemiAutomatic
        firstRegistrationDate:
          type: string
          format: date
          example: '2023-08-17'
        buildYear:
          type: integer
          example: 2023
        evBatteryCapacity:
          type: number
          format: double
          description: Capacity of the EV battery in kWh
          example: 10.4
        iceTankCapacity:
          type: number
          format: double
          description: Capacity of the ICE fuel tank in liters
          example: 10.4
        trackGeolocation:
          type: boolean
          description: Describes whether geolocation tracking is active or not
        autoLogbookType:
          $ref: '#/components/schemas/TripType'
          description: >-
            Default logbook entry type for new entries when auto-logbook is
            enabled. Null means auto-logbook is off
    VehicleStatus:
      type: object
      properties:
        lastUpdated:
          type: string
          format: date-time
          example: '2023-08-17T18:19:22.874Z'
        location:
          $ref: '#/components/schemas/Position'
        isCharging:
          type: boolean
        isLocked:
          type: boolean
        windowsClosed:
          type: boolean
        doorsClosed:
          type: boolean
        engineActive:
          type: boolean
        odometer:
          type: integer
        reach:
          type: integer
        fuelLevel:
          type: integer
        headlightsActive:
          type: boolean
        immobilizerActive:
          type: boolean
        tirePressureFrontLeft:
          type: number
        tirePressureFrontRight:
          type: number
        tirePressureRearLeft:
          type: number
        tirePressureRearRight:
          type: number
        nextServiceDate:
          type: string
          format: date
          example: '2023-08-17'
        nextServiceDistance:
          type: integer
        isPluggedIn:
          type: boolean
    TripType:
      type: string
      description: Type of trip
      enum:
        - Business
        - Private
    Position:
      type: object
      required:
        - lat
        - lng
      properties:
        lat:
          type: number
        lng:
          type: number
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: >-
            https://api.smartmove.eu/auth/realms/countryCode-providerCode/protocol/openid-connect/token
          scopes:
            all: openid
        authorizationCode:
          authorizationUrl: >-
            https://api.smartmove.eu/auth/realms/countryCode-providerCode/protocol/openid-connect/auth
          tokenUrl: >-
            https://api.smartmove.eu/auth/realms/countryCode-providerCode/protocol/openid-connect/token
          scopes:
            all: openid

````