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

# Charge Schedule

> Sets the charging schedule for a vehicle.

<Snippet file="api-reference/note-bse-tesla.mdx" />

## Permission

`control_charge`

## Request

**Path**

<Snippet file="api-reference/path-bse.mdx" />

**Body**

<ParamField body="type" type="string" required>
  The type of schedule you want to set.

  <Expandable title="type" defaultOpen="true">
    <ResponseField name="START_TIME">
      When plugged in, the vehicle will delay starting a charging session until this time in `HH:mm`.
    </ResponseField>

    <ResponseField name="DEPARTURE_TIME">
      When plugged in, the vehicle may delay starting a charging session as long as it can reach its
      [charge limit](/api-reference/evs/get-charge-limit) by this time in `HH:mm`.
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField body="enable" type="boolean" required>
  Enables or disables the specified charging schedule.
</ParamField>

<ParamField body="time" type="string" required>
  The time for the provided schedule type in HH:mm.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.smartcar.com/v2.0/vehicles/{id}/{make}/charge/schedule" \
  -H "Authorization: Bearer {token}" \
  -X "POST" \
  -H "Content-Type: application/json" \
  -d '{"type": "START_TIME", "enable": true, "time": "23:30"}'
  ```

  ```python Python theme={null}
  chargeSchedule = vehicle.request(
    "POST", 
    "{make}/charge/schedule",
    {"type": "START_TIME", "enable": true, "time": "23:30"}
  )
  ```

  ```js Node theme={null}
  const chargeSchedule = vehicle.request(
    "POST", 
    "{make}/charge/schedule",
    {"type": "START_TIME", "enable": true, "time": "23:30"}
  );
  ```

  ```java Java theme={null}
  SmartcarVehicleRequest request = new SmartcarVehicleRequest.Builder()
        .method("POST")
        .path("{make}/charge/schedule")
        .addBodyParameter("type", "START_TIME")
        .addBodyParameter("enable", "true")
        .addBodyParameter("time", "23:30")
        .build();
  ChargeSchedule chargeSchedule = vehicle.request(request);
  ```

  ```ruby Ruby theme={null}
  chargeSchedule = vehicle.request(
    "POST", 
    "{make}/charge/schedule",
    {"type": "START_TIME", "enable": true, "time": "23:30"}
  )
  ```
</RequestExample>

## Response

<ResponseField name="departureTime" type="object">
  The departure time configuration for the charging schedule.

  <Expandable title="departureTime">
    <ResponseField name="enabled" type="boolean">
      Indicates whether this schedule type is enabled or disabled.
      Only one of `departureTime` or `departureTime` can be enabled at a time.
    </ResponseField>

    <ResponseField name="time" type="string | null">
      When plugged in, the vehicle **may** delay starting a charging session as long as it can reach its
      [charge limit](/api-reference/evs/get-charge-limit) by this time in HH:mm.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="startTime" type="object">
  The start time configuration for the charging schedule.

  <Expandable title="startTime">
    <ResponseField name="enabled" type="boolean">
      Indicates whether this schedule type is enabled or disabled.
      Only one of `departureTime` or `departureTime` can be enabled at a time.
    </ResponseField>

    <ResponseField name="time" type="string | null">
      When plugged in, the vehicle will delay starting a charging session until this time in HH:mm.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Example Response theme={null}
  {
    "departureTime": {
      "enabled": false,
      "time": null
    },
    "startTime": {
      "enabled": true,
      "time": "18:30"
    }
  }
  ```
</ResponseExample>
