Smartcar Charging API

EV charging management and status

OpenAPI Specification

smartcar-charging-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Smartcar Vehicles Charging API
  description: The Smartcar Vehicles API provides a standardized REST interface for accessing connected vehicle data and sending commands to vehicles across multiple OEMs through a single integration. Retrieve signals such as battery level, odometer, location, fuel, engine oil life, and lock status, or issue commands like lock/unlock doors, start/stop charging, set charge limits, and set navigation destinations. Authentication uses OAuth 2.0 with user-granted permissions per vehicle.
  version: 2.0.0
  termsOfService: https://smartcar.com/terms/
  contact:
    name: Smartcar Support
    url: https://smartcar.com/docs/
    email: support@smartcar.com
  license:
    name: Smartcar API License
    url: https://smartcar.com/terms/
servers:
- url: https://vehicle.api.smartcar.com/v2.0
  description: Smartcar Vehicle API v2.0
- url: https://management.api.smartcar.com/v3
  description: Smartcar Management API v3
security:
- BearerAuth: []
tags:
- name: Charging
  description: EV charging management and status
paths:
  /vehicles/{id}/charge:
    get:
      operationId: getChargeStatus
      summary: Get Charge Status
      description: Retrieves the current charging status of an EV including plug-in state and charge progression. Requires the read_charge permission.
      tags:
      - Charging
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Charging status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeStatus'
    post:
      operationId: controlCharge
      summary: Start Or Stop Charging
      description: Starts or stops charging for an electric vehicle. Requires the control_charge permission.
      tags:
      - Charging
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - action
              properties:
                action:
                  type: string
                  enum:
                  - START
                  - STOP
                  description: Whether to start or stop charging
      responses:
        '200':
          description: Command result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
  /vehicles/{id}/charge/limit:
    get:
      operationId: getChargeLimit
      summary: Get Charge Limit
      description: Retrieves the current charge limit setting for an EV.
      tags:
      - Charging
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Charge limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargeLimit'
    post:
      operationId: setChargeLimit
      summary: Set Charge Limit
      description: Sets the maximum battery charge level (as a percentage) for an EV. Requires the control_charge permission.
      tags:
      - Charging
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - limit
              properties:
                limit:
                  type: number
                  minimum: 0.5
                  maximum: 1.0
                  description: Charge limit as a decimal (0.5 to 1.0)
      responses:
        '200':
          description: Command result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
components:
  schemas:
    ChargeLimit:
      type: object
      properties:
        limit:
          type: number
          minimum: 0.5
          maximum: 1.0
          description: Maximum charge limit as a decimal
      required:
      - limit
    CommandResult:
      type: object
      properties:
        status:
          type: string
          enum:
          - success
          - error
          - pending
        message:
          type: string
          description: Human-readable result message
    ChargeStatus:
      type: object
      properties:
        isPluggedIn:
          type: boolean
          description: Whether the vehicle is currently plugged in
        state:
          type: string
          enum:
          - CHARGING
          - FULLY_CHARGED
          - NOT_CHARGING
          description: Current charging state
      required:
      - isPluggedIn
      - state
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 access token obtained via Authorization Code or Client Credentials flow