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

# Submit command to control the amount of vehicle charging power

> This endpoint creates an asynchronously executed command request to control the amount of vehicle charging power.



## OpenAPI

````yaml post /v1.0.0/vehicles/{vehicleId}/commands/charging-current
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/vehicles/{vehicleId}/commands/charging-current:
    post:
      tags:
        - Vehicle Controller
      summary: Submit command to control the amount of vehicle charging power
      description: >-
        This endpoint creates an asynchronously executed command request to
        control the amount of vehicle charging power.
      operationId: chargingCurrent
      parameters:
        - description: Vehicle ID
          in: path
          name: vehicleId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommandChargingCurrentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitCommandResponse'
          description: Successful operation
        '400':
          content:
            application/json:
              examples:
                BAD_REQUEST:
                  $ref: '#/components/examples/BAD_REQUEST'
              schema:
                $ref: '#/components/schemas/ValidationErrorMessageDto'
          description: Bad request
        '401':
          content:
            application/json:
              examples:
                UNAUTHORIZED:
                  $ref: '#/components/examples/UNAUTHORIZED'
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
          description: Unauthorized
        '404':
          content:
            application/json:
              examples:
                VEHICLE_NOT_FOUND:
                  $ref: '#/components/examples/VEHICLE_NOT_FOUND'
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
          description: Not found
        '409':
          content:
            application/json:
              examples:
                COMMAND_ALREADY_SUBMITTED:
                  $ref: '#/components/examples/COMMAND_ALREADY_SUBMITTED'
                COMMAND_TYPE_NOT_ALLOWED:
                  $ref: '#/components/examples/COMMAND_TYPE_NOT_ALLOWED'
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
          description: Conflict
        '501':
          content:
            application/json:
              examples:
                COMMAND_REQUEST_NOT_IMPLEMENTED:
                  $ref: '#/components/examples/COMMAND_REQUEST_NOT_IMPLEMENTED'
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
          description: Not implemented
      security:
        - API_Key: []
components:
  schemas:
    CommandChargingCurrentRequest:
      description: Object of charging current target of vehicle device.
      properties:
        amps:
          description: The charging current during an active charging process.
          example: 12
          format: int32
          maximum: 32
          minimum: 5
          type: integer
      type: object
    SubmitCommandResponse:
      properties:
        createdAt:
          description: The timestamp when command is created.
          format: date-time
          type: string
        deviceId:
          description: The ID of the vehicle.
          format: uuid
          type: string
        id:
          description: The ID of the command.
          format: uuid
          type: string
        state:
          $ref: '#/components/schemas/CommandState'
        type:
          description: The name of the command type to execute.
          enum:
            - CHARGING_START
            - CHARGING_STOP
            - SET_CHARGING_CURRENT
            - SET_CHARGING_SCHEDULE
          type: string
        userId:
          description: The ID of the user.
          example: 896f9d5a-b618-48a2-98ae-957059bf1bc9
          type: string
      required:
        - createdAt
        - deviceId
        - id
        - state
        - type
        - userId
      type: object
    ValidationErrorMessageDto:
      allOf:
        - $ref: '#/components/schemas/ErrorMessageDto'
        - properties:
            errorCode:
              description: The error code
              example: EXAMPLE_ERROR_CODE
              type: string
            id:
              description: The error identifier
              example: 7958818d-64d2-4ede-b12b-4786dd2f348b
              format: uuid
              type: string
            message:
              description: The error message
              example: Example error message
              type: string
            validationErrors:
              description: List of validation errors
              items:
                $ref: '#/components/schemas/ValidationError'
              type: array
          type: object
      required:
        - errorCode
        - id
        - message
      type: object
    ErrorMessageDto:
      properties:
        errorCode:
          description: The error code
          example: EXAMPLE_ERROR_CODE
          type: string
        id:
          description: The error identifier
          example: 7958818d-64d2-4ede-b12b-4786dd2f348b
          format: uuid
          type: string
        message:
          description: The error message
          example: Example error message
          type: string
      required:
        - errorCode
        - id
        - message
      type: object
    CommandState:
      description: |
        The state of the command.
        * `PENDING` - Command is waiting to be executed.
        * `FAILED` - Execution of command has failed.
        * `EXECUTED` - Command has been executed successfully.
      enum:
        - PENDING
        - EXECUTED
        - FAILED
      type: string
    ValidationError:
      properties:
        field:
          description: Affected field
          type: string
        message:
          description: Validation message
          type: string
      type: object
  examples:
    BAD_REQUEST:
      value:
        errorCode: BAD_REQUEST
        id: 05b7a5ef-b4ec-4dcc-ad08-04bae9a95ef6
        message: Bad request
        validationErrors:
          - field: Affected field
            message: Validation message
    UNAUTHORIZED:
      value:
        errorCode: UNAUTHORIZED
        id: 05b7a5ef-b4ec-4dcc-ad08-04bae9a95ef6
        message: Unauthorized
    VEHICLE_NOT_FOUND:
      value:
        errorCode: VEHICLE_NOT_FOUND
        id: 05b7a5ef-b4ec-4dcc-ad08-04bae9a95ef6
        message: '[VEHICLE] Requested Vehicle not found'
    COMMAND_ALREADY_SUBMITTED:
      value:
        errorCode: COMMAND_ALREADY_SUBMITTED
        id: 05b7a5ef-b4ec-4dcc-ad08-04bae9a95ef6
        message: '[VEHICLE] Command has already been submitted'
    COMMAND_TYPE_NOT_ALLOWED:
      value:
        errorCode: COMMAND_TYPE_NOT_ALLOWED
        id: 05b7a5ef-b4ec-4dcc-ad08-04bae9a95ef6
        message: '[VEHICLE] Command type for this vehicle is not allowed'
    COMMAND_REQUEST_NOT_IMPLEMENTED:
      value:
        errorCode: COMMAND_REQUEST_NOT_IMPLEMENTED
        id: 05b7a5ef-b4ec-4dcc-ad08-04bae9a95ef6
        message: '[VEHICLE] Submitting command request is not implemented'
  securitySchemes:
    API_Key:
      description: API key used for authorization and authentication.
      in: header
      name: X-API-KEY
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.