Skip to main content
POST
/
vehicles
/
{vehicleId}
/
commands
/
charge
/
set-limit
Set charge limit
curl --request POST \
  --url https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/commands/charge/set-limit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'sc-user-id: <sc-user-id>' \
  --data '
{
  "data": {
    "attributes": {
      "percent": 80
    }
  }
}
'
{
  "data": {
    "id": "exec_9876543210",
    "type": "command-execution",
    "attributes": {
      "commandType": "charge-set-limit",
      "status": {
        "value": "SUCCESS"
      },
      "executionMode": "sync",
      "parameters": {
        "percent": 80
      }
    },
    "meta": {
      "executedAt": "2024-01-01T12:00:00Z",
      "completedAt": "2024-01-01T12:00:02Z",
      "durationInSeconds": 2
    }
  }
}

Authorizations

Authorization
string
header
required

The Authorization header must be provided with a valid bearer token. Example: Authorization: Bearer {token}

Headers

sc-user-id
string
required

The identifier of the vehicle user on whose behalf the command is being executed. Vehicle commands require both the vehicleId (path) and sc-user-id (header) to identify the specific vehicle and the user who has granted permission to act on it. The bearer token is a machine-to-machine token and does not carry per-user context, so this header must be provided explicitly for every command request.

Path Parameters

vehicleId
string
required

The unique identifier for the vehicle.

Body

application/json

Set charge limit command request

Request for setting a charging limit.

data
object
required

Response

200 OK - Command executed synchronously and successfully

Response for a command execution.

data
object
required