Skip to main content
POST
/
vehicles
/
{vehicleId}
/
charge-schedules
/
daily
Set daily charge schedule
curl --request POST \
  --url https://vehicle.api.smartcar.com/v3/vehicles/{vehicleId}/charge-schedules/daily \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'sc-user-id: <sc-user-id>' \
  --data '
{
  "data": {
    "attributes": {
      "location": {
        "latitude": 37.7749,
        "longitude": -122.4194
      },
      "startTime": "08:00",
      "stopTime": "10:00"
    }
  }
}
'
{
  "data": {
    "id": "exec_9876543210",
    "type": "charge-schedule-execution",
    "attributes": {
      "action": "create",
      "scheduleType": "daily",
      "status": {
        "value": "SUCCESS"
      },
      "executionMode": "sync",
      "scheduleId": "sched_abc123",
      "parameters": {
        "location": {
          "latitude": 37.7749,
          "longitude": -122.4194
        },
        "startTime": "08:00",
        "stopTime": "10:00"
      }
    },
    "links": {
      "schedule": "/vehicles/vid_abc/charge-schedules/sched_abc123"
    },
    "meta": {
      "executedAt": "2024-01-01T12:00:00Z",
      "completedAt": "2024-01-01T12:00:02Z",
      "durationInSeconds": 2
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://smartcar.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

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 daily charge schedule request

data
object
required

Response

200 OK - Schedule created synchronously

Response to a charge schedule create or delete request. data.attributes.action identifies the operation ("create" or "delete"). On success, data.attributes.scheduleId contains the id of the affected schedule. For "create", data.links.schedule contains the path to GET or DELETE the new resource.

data
object
required