> ## Documentation Index
> Fetch the complete documentation index at: https://developer.energy-hub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Vehicle data for user

> Returns vehicle data of a single vehicle for the user.



## OpenAPI

````yaml get /v1.0.0/users/{userId}/vehicles/{vehicleId}
openapi: 3.0.1
info:
  description: A service used for vehicles
  title: vehicle-service
  version: 1.0.0
servers:
  - description: Generated server url
    url: https://api.energy-hub.io
security: []
paths:
  /v1.0.0/users/{userId}/vehicles/{vehicleId}:
    get:
      tags:
        - User Vehicle Controller
      summary: Vehicle data for user
      description: Returns vehicle data of a single vehicle for the user.
      operationId: getSingleVehicleForUser
      parameters:
        - schema:
            type: string
          in: path
          name: userId
          description: User ID
          required: true
        - schema:
            format: uuid
            type: string
          in: path
          name: vehicleId
          description: Vehicle ID
          required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VehicleResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                UNAUTHORIZED:
                  $ref: '#/components/examples/UNAUTHORIZED'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                VEHICLE_NOT_FOUND:
                  $ref: '#/components/examples/VEHICLE_NOT_FOUND'
      security:
        - API_Key: []
components:
  schemas:
    VehicleResponse:
      description: Object of vehicle response.
      type: object
      required:
        - id
        - isOnline
        - staticData
        - userId
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of any field in the vehicle data.
          type: string
        chargeState:
          $ref: '#/components/schemas/ChargeState'
        odometer:
          $ref: '#/components/schemas/Odometer'
        isOnline:
          description: Indicates if the vehicle is reachable trough the vendor system.
          type: boolean
          example: true
        location:
          $ref: '#/components/schemas/Location'
        id:
          format: uuid
          description: The ID of the vehicle.
          type: string
        climateState:
          $ref: '#/components/schemas/ClimateState'
        userId:
          description: The ID of the user.
          type: string
          example: 896f9d5a-b618-48a2-98ae-957059bf1bc9
        staticData:
          $ref: '#/components/schemas/StaticData'
    ErrorMessageDto:
      type: object
      required:
        - errorCode
        - id
        - message
      properties:
        errorCode:
          description: The error code
          type: string
          example: EXAMPLE_ERROR_CODE
        id:
          format: uuid
          description: The error identifier
          type: string
          example: 7958818d-64d2-4ede-b12b-4786dd2f348b
        message:
          description: The error message
          type: string
          example: Example error message
    ChargeState:
      description: Object of charge state data of a vehicle.
      type: object
      required:
        - lastUpdated
      properties:
        stateOfCharge:
          format: double
          description: The state of the charge of the vehicle battery in percent.
          type: number
          example: 72.25
        chargingTimeRemaining:
          format: int32
          description: The remaining charging time in minutes.
          type: integer
          example: 6
        chargeLimitMax:
          format: double
          description: >-
            The maximum state of charge set by the user for the vehicle in
            percent.
          type: number
          example: 80.25
        remoteChargingAllowed:
          description: >-
            Indicates if remote charging controls are allowed. It does not
            simply mean that the vehicle is unplugged, but rather its a vendor
            specific restriction for not allowing remote charging at the current
            time (i.e. location of the vehicle is not correct).  Can be NULL for
            vendors that don't have these kinds of restrictions
          type: boolean
        estimatedRange:
          format: int32
          description: The estimated range based on the current battery level in km.
          type: integer
          example: 106
        chargingState:
          description: The current charging state.
          type: string
          enum:
            - UNPLUGGED
            - CHARGING
            - PREPARING
            - FINISHED
            - STOPPED
            - FAULT
          example: CHARGING
        chargeRate:
          format: double
          description: The rate of the charge while the vehicle is charging in kW.
          type: number
          example: 6.512
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the charge state data.
          type: string
        chargeLimitMin:
          format: double
          description: >-
            The minimum state of charge set by the user for the vehicle in
            percent.
          type: number
          example: 20.25
        chargeCurrentMax:
          format: int32
          description: The maximum charging current in amperes.
          type: integer
          example: 12
        scheduledDepartureTime:
          format: date-time
          description: The scheduled departure time set by the user as timestamp.
          type: string
          example: '2023-11-26T05:05:00Z'
        isPlugged:
          description: Indicates if the charger is plugged into the car.
          type: boolean
          example: true
        scheduledChargingStartTime:
          format: date-time
          description: The scheduled charging start time set by the user as timestamp.
          type: string
          example: '2023-11-26T05:00:00Z'
    Odometer:
      description: Object of odometer data of a vehicle.
      type: object
      required:
        - lastUpdated
        - odometer
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the odometer data.
          type: string
        odometer:
          format: int32
          description: The current odometer of the vehicle in km.
          type: integer
          example: 12228
    Location:
      description: Object of location data of a vehicle.
      type: object
      required:
        - lastUpdated
        - latitude
        - longitude
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the location data.
          type: string
        latitude:
          format: double
          description: The latitude of the location in degrees.
          type: number
          example: 50.770774
        longitude:
          format: double
          description: The longitude of the location in degrees.
          type: number
          example: -126.104965
    ClimateState:
      description: Object of climate state of a vehicle.
      type: object
      required:
        - lastUpdated
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the climate state data.
          type: string
        isClimateOn:
          description: Indicates if the climate control is on.
          type: boolean
          example: true
        isBatteryHeaterOn:
          description: Indicates if the battery heater is on.
          type: boolean
          example: true
        temperatureCurrent:
          format: double
          description: The current temperature inside the vehicle in °C.
          type: number
          example: 18.1
        temperatureTarget:
          format: double
          description: The target temperature set by the user in °C.
          type: number
          example: 20.1
    StaticData:
      description: Object of static data of a vehicle.
      type: object
      required:
        - lastUpdated
        - model
        - vendor
        - vin
      properties:
        lastUpdated:
          format: date-time
          description: The timestamp of the last update of the static data.
          type: string
        vendor:
          description: The vendor of the vehicle.
          type: string
          enum:
            - TESLA
            - MERCEDES
            - BMW
            - MINI
            - VW
            - AUDI
            - SKODA
            - VOLVO
            - CUPRA
        name:
          description: The display name of the vehicle.
          type: string
          example: My Tesla
        engineType:
          description: The engine type of the vehicle.
          type: string
          enum:
            - BEV
            - HEV
            - PHEV
            - ICEV
          example: BEV
        vin:
          description: The vehicle identification number (VIN).
          type: string
          example: 1XKAD29X0KS502460
        model:
          description: The model of the vehicle.
          type: string
          example: Model 3
        batteryCapacity:
          format: double
          description: The rated battery capacity of the vehicle in kWh.
          type: number
          example: 60.12
        vehicleVariant:
          description: The variant of the vehicle.
          type: string
          example: Base
  examples:
    UNAUTHORIZED:
      value:
        errorCode: UNAUTHORIZED
        id: cae58230-364d-45ca-b67d-08a57653c59f
        message: Unauthorized
    VEHICLE_NOT_FOUND:
      value:
        errorCode: VEHICLE_NOT_FOUND
        id: cae58230-364d-45ca-b67d-08a57653c59f
        message: '[VEHICLE] Requested Vehicle not found'
  securitySchemes:
    API_Key:
      in: header
      name: X-API-KEY
      description: API key used for authorization and authentication.
      type: apiKey

````