> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seam.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating and Managing Thermostat Schedules

> Learn how to create, list, get, update, and delete thermostat schedules for thermostats.

Once you have created a set of [climate presets](/capability-guides/thermostats/creating-and-managing-climate-presets/index) for a thermostat, you can define schedules using the [`/thermostats/schedules/create`](/api/thermostats/schedules/create) endpoint. The Seam API's scheduling mechanism is flexible and intelligent. It can prioritize and handle multiple scheduled climate presets. For example, you could [set a fallback](/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) energy-saving climate preset for whenever a short-term rental property is unoccupied. Then, you could schedule—in advance—a "comfort" climate preset to correspond to each upcoming guest's stay.

***

## Thermostat Schedule Properties

Each thermostat schedule can contain the following properties:

<table>
  <thead>
    <tr>
      <th width="339">Property</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <code>name</code>
      </td>

      <td>
        (Optional) User-friendly name to identify the thermostat schedule.
      </td>
    </tr>

    <tr>
      <td>
        <code>climate\_preset\_key</code>
      </td>

      <td>
        (Required) Key of the climate preset to use for the thermostat schedule.
      </td>
    </tr>

    <tr>
      <td>
        <code>is\_override\_allowed</code>
      </td>

      <td>
        (Optional) Indicates whether a person at the thermostat or using the API
        can change (that is, override) the thermostat's settings from an active
        scheduled climate preset.
      </td>
    </tr>

    <tr>
      <td>
        <code>max\_override\_period\_minutes</code>
      </td>

      <td>
        Number of minutes for which a person at the thermostat or using the API
        can change (that is, override) the thermostat's settings after the
        activation of the scheduled climate preset.

        <br />

        <strong>Note:</strong> If you set this value to <code>null</code>, there
        is no enforced maximum override period. That is, the override applies
        until another climate preset becomes active.

        <br />

        Default: <code>null</code>

        <br />

        See also{' '}

        <a href="#specifying-manual-override-permissions">
          Specifying Manual Override Permissions
        </a>

        .
      </td>
    </tr>

    <tr>
      <td>
        <code>starts\_at</code>
      </td>

      <td>
        (Required) Date and time at which the thermostat schedule starts, in{' '}

        <a href="https://www.iso.org/iso-8601-date-and-time-format.html">
          ISO 8601
        </a>

        {' '}

        format.
      </td>
    </tr>

    <tr>
      <td>
        <code>ends\_at</code>
      </td>

      <td>
        (Required) Date and time at which the thermostat schedule ends, in{' '}

        <a href="https://www.iso.org/iso-8601-date-and-time-format.html">
          ISO 8601
        </a>

        {' '}

        format.
      </td>
    </tr>
  </tbody>
</table>

***

## Setting the Schedule

In the Seam API, use the `starts_at` and `ends_at` parameters to define the time period during which to apply an existing climate preset. For example, a short-term rental host could set `starts_at` to the beginning of a guest reservation or perhaps even slightly before the reservation starts so that the property reaches a comfortable temperature in time for guest arrival. The host could set `ends_at` to coincide with the end of the reservation.

`starts_at` is required and must be unique within all the schedules for the thermostat. However, if you want to schedule a climate preset that starts immediately, set `start_at` to a time in the past. Alternately, you can [activate a climate preset](/capability-guides/thermostats/creating-and-managing-climate-presets/activating-a-climate-preset) immediately.

After a scheduled climate preset starts, Seam emits a [`thermostat.temperature_reached_set_point` event](/api/events/object) when the thermostat reports a temperature within 1° Celsius of the heating or cooling [set point](/capability-guides/thermostats/understanding-thermostat-concepts/set-points) specified in this climate preset. You can configure a [webhook](../../developer-tools/webhooks) to watch for this event.

***

## Specifying Manual Override Permissions

When creating a schedule for a thermostat, you can specify `is_override_allowed` and `max_override_period_minutes`. The `is_override_allowed` parameter indicates whether a person at the thermostat or using the Seam API can change the thermostat's settings for the active duration of the thermostat schedule. Setting `max_override_period_minutes` defines the length of the allowed override period. If an override period is allowed, at the end of this period, Seam sets the thermostat back to the climate preset defined by the thermostat schedule. The override period starts again each time a person makes a change at the thermostat or using the API.

Through these override period settings, the Seam API provides you with the flexibility to customize the thermostat behavior to suit your needs. For example, a multifamily property manager may want to give complete control of the thermostat to a unit's residents as soon as they move into the unit. However, a short-term rental host may want to enforce stricter rules to ensure that their guests are using the associated HVAC system in a reasonable manner.

To allow complete control at the thermostat, set `is_override_allowed` to `true` and `max_override_period_minutes` to `null`. To disable manual overrides entirely, set `is_override_allowed` to `false`.

***

## Create a Thermostat Schedule

To create a thermostat schedule, issue a [`/thermostats/schedules/create`](/api/thermostats/schedules/create) request, providing the `device_id` of the desired thermostat, as well as the `climate_preset_key`, and the `starts_at` and `ends_at` timestamps. You can also specify a `name` for the thermostat schedule and the desired `is_override_allowed` and `max_override_period_minutes` values.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.thermostats.schedules.create({
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
    name: "Jim's stay",
    climate_preset_key: 'occupied',
    starts_at: '2024-11-01T15:00:00Z',
    ends_at: '2024-11-05T12:00:00Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/create' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
      "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
      "name":  "Jim'\''s stay",
      "climate_preset_key": "occupied",
      "starts_at": "2024-11-01T15:00:00Z",
      "ends_at": "2024-11-05T12:00:00Z",
      "is_override_allowed": true,
      "max_override_period_minutes": 90
  }'
  ```

  ```python Python theme={null}
  seam.thermostats.schedules.create(
    device_id = "2d488679-6f07-4810-aed2-e726872c1dd5",
    name = "Jim's stay",
    climate_preset_key = "occupied",
    starts_at = "2024-11-01T15:00:00Z",
    ends_at = "2024-11-05T12:00:00Z",
    is_override_allowed = True,
    max_override_period_minutes = 90
  )
  ```

  ```ruby Ruby theme={null}
  seam.thermostats.schedules.create({
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5",
    name: "Jim's stay",
    climate_preset_key: "occupied",
    starts_at: "2024-11-01T15:00:00Z",
    ends_at: "2024-11-05T12:00:00Z",
    is_override_allowed: true,
    max_override_period_minutes: 90
  )
  ```

  ```php PHP theme={null}
  $seam->thermostats->schedules->create(
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5",
    name: "Jim's stay",
    climate_preset_key: "occupied",
    starts_at: "2024-11-01T15:00:00Z",
    ends_at: "2024-11-05T12:00:00Z",
    is_override_allowed: true,
    max_override_period_minutes: 90
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    thermostat_schedule_id: '4a5bd61f-b402-41a5-9757-d92ba1e20708',
    name: "Jim's stay",
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key: 'occupied',
    starts_at: '2024-11-01T15:00:00.000Z',
    ends_at: '2024-11-05T12:00:00.000Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
    ...
  }
  ```

  ```json cURL theme={null}
  {
    "thermostat_schedule": {
      "thermostat_schedule_id": "56d29fcf-0674-4db5-8e03-b2370a77460a",
      "name": "Jim's stay",
      "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key": "occupied",
      "starts_at": "2024-11-01T15:00:00.000Z",
      "ends_at": "2024-11-05T12:00:00.000Z",
      "is_override_allowed": true,
      "max_override_period_minutes": 90,
      ...
    },
    "ok": true
  }
  ```

  ```json Python theme={null}
  ThermostatSchedule(
    thermostat_schedule_id='56d29fcf-0674-4db5-8e03-b2370a77460a',
    name="Jim's stay",
    device_id='2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key='occupied',
    starts_at='2024-11-01T15:00:00.000Z',
    ends_at='2024-11-05T12:00:00.000Z',
    is_override_allowed=True,
    max_override_period_minutes=90,
    ...
  )
  ```

  ```json Ruby theme={null}
  <Seam::Resources::ThermostatSchedule:0x005f0
    thermostat_schedule_id="4a5bd61f-b402-41a5-9757-d92ba1e20708"
    name="Jim's stay"
    device_id="2d488679-6f07-4810-aed2-e726872c1dd5"
    climate_preset_key="occupied"
    starts_at=2024-11-01 15:00:00 UTC
    ends_at=2024-11-05 12:00:00 UTC
    is_override_allowed=true
    max_override_period_minutes=90
    ...
  >
  ```

  ```json PHP theme={null}
  {
    "thermostat_schedule_id": "a05960b9-d787-4621-a7b0-ab76a566e5e8",
    "name": "Jim's stay",
    "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
    "climate_preset_key": "occupied",
    "starts_at": "2024-11-01T15:00:00.000Z",
    "ends_at": "2024-11-05T12:00:00.000Z",
    "is_override_allowed": true,
    "max_override_period_minutes": 90,
    ...
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Schedule Multiple Climate Presets

Suppose a short-term rental host wants to set a fallback "unoccupied" climate preset that takes effect immediately, as well as scheduling an "occupied" climate preset for two periods that correspond to guest reservations.

<img
  src="https://mintcdn.com/seam/d6yLSFlGuXxmvz_6/images/multiple-climate-schedules.png?fit=max&auto=format&n=d6yLSFlGuXxmvz_6&q=85&s=ce8dad1b59007c902567a10c5590f7a3"
  alt="Seam handles a fallback climate preset, along with multiple thermostat
schedules."
  width="1325"
  height="173"
  data-path="images/multiple-climate-schedules.png"
/>

The following example shows how to set up these schedules:

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  // Get the thermostat.
  const thermostat = await seam.devices.get({
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
  })

  // Set the fallback climate preset.
  await seam.thermostats.setFallbackClimatePreset({
    device_id: thermostat.device_id,
    climate_preset_key: 'unoccupied',
  })

  // Create the thermostat schedule for the first reservation.
  await seam.thermostats.schedules.create({
    device_id: thermostat.device_id,
    name: "Joe's stay",
    climate_preset_key: 'occupied',
    starts_at: '2024-11-10T15:00:00Z',
    ends_at: '2024-11-15T12:00:00Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
  })

  // Create the thermostat schedule for the second reservation.
  await seam.thermostats.schedules.create({
    device_id: thermostat.device_id,
    name: "Jane's stay",
    climate_preset_key: 'occupied',
    starts_at: '2024-11-16T15:00:00Z',
    ends_at: '2024-11-18T12:00:00Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
  })
  ```

  ```bash cURL theme={null}
  # Get the thermostat.
  thermostat=$(
    # Use GET or POST.
    curl -X 'GET' \
      'https://connect.getseam.com/devices/get' \
      -H 'accept: application/json' \
      -H "Authorization: Bearer ${SEAM_API_KEY}" \
      -H 'Content-Type: application/json' \
      -d '{
        "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5"
    }')

  # Set the fallback climate preset.
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/set_fallback_climate_preset' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
      \"device_id\": \"$(jq -r '.device.device_id' <<< ${thermostat})\",
      \"climate_preset_key\": \"unoccupied\"
  }"

  # Create the thermostat schedule for the first reservation.
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/create' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
      \"device_id\": \"$(jq -r '.device.device_id' <<< ${thermostat})\",
      \"name\":  \"Joe's stay\",
      \"climate_preset_key\": \"occupied\",
      \"starts_at\": \"2024-11-10T15:00:00Z\",
      \"ends_at\": \"2024-11-15T12:00:00Z\",
      \"is_override_allowed\": true,
      \"max_override_period_minutes\": 90
  }"

  # Create the thermostat schedule for the second reservation.
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/create' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d "{
      \"device_id\": \"$(jq -r '.device.device_id' <<< ${thermostat})\",
      \"name\":  \"Jane's stay\",
      \"climate_preset_key\": \"occupied\",
      \"starts_at\": \"2024-11-16T15:00:00Z\",
      \"ends_at\": \"2024-11-18T12:00:00Z\",
      \"is_override_allowed\": true,
      \"max_override_period_minutes\": 90
  }"
  ```

  ```python Python theme={null}
  # Get the thermostat.
  thermostat = seam.devices.get(
    device_id = "2d488679-6f07-4810-aed2-e726872c1dd5"
  )

  # Set the fallback climate preset.
  seam.thermostats.set_fallback_climate_preset(
    device_id = thermostat.device_id,
    climate_preset_key = "unoccupied"
  )

  # Create the thermostat schedule for the first reservation.
  seam.thermostats.schedules.create(
    device_id = thermostat.device_id,
    name = "Joe's stay",
    climate_preset_key = "occupied",
    starts_at = "2024-11-10T15:00:00Z",
    ends_at = "2024-11-15T12:00:00Z",
    is_override_allowed = True,
    max_override_period_minutes = 90
  )

  # Create the thermostat schedule for the second reservation.
  seam.thermostats.schedules.create(
    device_id = thermostat.device_id,
    name = "Jane's stay",
    climate_preset_key = "occupied",
    starts_at = "2024-11-16T15:00:00Z",
    ends_at = "2024-11-18T12:00:00Z",
    is_override_allowed = True,
    max_override_period_minutes = 90
  )
  ```

  ```ruby Ruby theme={null}
  # Get the thermostat.
  thermostat = seam.devices.get(
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5"
  )

  # Set the fallback climate preset.
  seam.thermostats.set_fallback_climate_preset(
    device_id: thermostat.device_id,
    climate_preset_key: "unoccupied"
  )

  # Create the thermostat schedule for the first reservation.
  seam.thermostats.schedules.create(
    device_id: thermostat.device_id,
    name: "Joe's stay",
    climate_preset_key: "occupied",
    starts_at: "2024-11-10T15:00:00Z",
    ends_at: "2024-11-15T12:00:00Z",
    is_override_allowed: true,
    max_override_period_minutes: 90
  )

  # Create the thermostat schedule for the second reservation.
  seam.thermostats.schedules.create(
    device_id: thermostat.device_id,
    name: "Jane's stay",
    climate_preset_key: "occupied",
    starts_at: "2024-11-16T15:00:00Z",
    ends_at: "2024-11-18T12:00:00Z",
    is_override_allowed: true,
    max_override_period_minutes: 90
  )
  ```

  ```php PHP theme={null}
  // Get the thermostat.
  $thermostat = $seam->devices->get(
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5"
  );

  // Set the fallback climate preset.
  $seam->thermostats->set_fallback_climate_preset(
    device_id: $thermostat->device_id,
    climate_preset_key: "unoccupied"
  );

  // Create the thermostat schedule for the first reservation.
  $seam->thermostats->schedules->create(
    device_id: $thermostat->device_id,
    name: "Joe's stay",
    climate_preset_key: "occupied",
    starts_at: "2024-11-10T15:00:00Z",
    ends_at: "2024-11-15T12:00:00Z",
    is_override_allowed: true,
    max_override_period_minutes: 90
  );

  // Create the thermostat schedule for the second reservation.
  $seam->thermostats->schedules->create(
    device_id: $thermostat->device_id,
    name: "Jane's stay",
    climate_preset_key: "occupied",
    starts_at: "2024-11-16T15:00:00Z",
    ends_at: "2024-11-18T12:00:00Z",
    is_override_allowed: true,
    max_override_period_minutes: 90
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    thermostat_schedule_id: '4082a585-cf6e-4f6c-889d-d208fde226d0',
    name: "Joe's stay",
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key: 'occupied',
    starts_at: '2024-11-10T15:00:00.000Z',
    ends_at: '2024-11-15T12:00:00.000Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
    ...
  }
  {
    thermostat_schedule_id: '9d2b1c55-68cc-4c86-8478-dea3249e26b7',
    name: "Jane's stay",
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key: 'occupied',
    starts_at: '2024-11-16T15:00:00.000Z',
    ends_at: '2024-11-18T12:00:00.000Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
    ...
  }
  ```

  ```json cURL theme={null}
  {
    "thermostat_schedule":{
      "thermostat_schedule_id":"a46b96bf-7b4c-408d-b7c6-74ff7c747ff1",
      "name":"Joe's stay",
      "device_id":"2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key":"occupied",
      "starts_at":"2024-11-10T15:00:00.000Z",
      "ends_at":"2024-11-15T12:00:00.000Z",
      "is_override_allowed":true,
      "max_override_period_minutes":90,
      ...
    },
    "ok":true
  }
  {
    "thermostat_schedule":{
      "thermostat_schedule_id":"5acded62-dc35-4d37-b94c-35bc68352ea5",
      "name":"Jane's stay",
      "device_id":"2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key":"occupied",
      "starts_at":"2024-11-16T15:00:00.000Z",
      "ends_at":"2024-11-18T12:00:00.000Z",
      "is_override_allowed":true,
      "max_override_period_minutes":90,
      ...
    },
    "ok":true
  }
  ```

  ```json Python theme={null}
  ThermostatSchedule(
    thermostat_schedule_id='c02a3cc5-87f2-409d-b21d-164f2c94d37c'
    name="Joe's stay",
    device_id='2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key='occupied',
    starts_at='2024-11-10T15:00:00.000Z',
    ends_at='2024-11-15T12:00:00.000Z',
    is_override_allowed=True,
    max_override_period_minutes=90,
    ...
  )
  ThermostatSchedule(
    thermostat_schedule_id='ed14ed8d-c012-4d89-af96-053e0c16197d',
    name="Jane's stay",
    device_id='2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key='occupied',
    starts_at='2024-11-16T15:00:00.000Z',
    ends_at='2024-11-18T12:00:00.000Z',
    is_override_allowed=True,
    max_override_period_minutes=90,
    ...
  )
  ```

  ```json Ruby theme={null}
  <Seam::Resources::ThermostatSchedule:0x005f0
    thermostat_schedule_id="4082a585-cf6e-4f6c-889d-d208fde226d0"
    name="Joe's stay"
    device_id="2d488679-6f07-4810-aed2-e726872c1dd5"
    climate_preset_key="occupied"
    starts_at=2024-11-10 15:00:00 UTC
    ends_at=2024-11-15 12:00:00 UTC
    is_override_allowed=true
    max_override_period_minutes=90
    ...
  >
  <Seam::Resources::ThermostatSchedule:0x005f0
    thermostat_schedule_id="9d2b1c55-68cc-4c86-8478-dea3249e26b7"
    name="Jane's stay"
    device_id="2d488679-6f07-4810-aed2-e726872c1dd5"
    climate_preset_key="occupied"
    starts_at=2024-11-16 15:00:00 UTC
    ends_at=2024-11-18 12:00:00 UTC
    is_override_allowed=true
    max_override_period_minutes=90
    ...
  >
  ```

  ```json PHP theme={null}
  {
    "thermostat_schedule_id": "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
    "name": "Joe's stay",
    "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
    "climate_preset_key": "occupied",
    "starts_at": "2024-11-10T15:00:00.000Z",
    "ends_at": "2024-11-15T12:00:00.000Z",
    "is_override_allowed": true,
    "max_override_period_minutes": 90,
    ...
  }
  {
    "thermostat_schedule_id": "665553d1-94f9-4e92-9739-06ac6362c959",
    "name": "Jane's stay",
    "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
    "climate_preset_key": "occupied",
    "starts_at": "2024-11-16T15:00:00.000Z",
    "ends_at": "2024-11-18T12:00:00.000Z",
    "is_override_allowed": true,
    "max_override_period_minutes": 90,
    ...
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## List All Thermostat Schedules for a Thermostat

To retrieve all thermostat schedules for a thermostat, issue a [`/thermostats/schedules/list`](/api/thermostats/schedules/list) request, specifying the `device_id` of the desired thermostat.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.thermostats.schedules.list({
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/list' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
      "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5"
  }'
  ```

  ```python Python theme={null}
  seam.thermostats.schedules.list(
    device_id = "2d488679-6f07-4810-aed2-e726872c1dd5"
  )
  ```

  ```ruby Ruby theme={null}
  seam.thermostats.schedules.list(
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5"
  )
  ```

  ```php PHP theme={null}
  $seam->thermostats->schedules->list(
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5"
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  [
    {
      thermostat_schedule_id: '89d3507e-60e3-4101-bd1b-ba066ec30ad4',
      name: "Joe's stay",
      device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
      climate_preset_key: 'occupied',
      starts_at: '2024-11-10T15:00:00.000Z',
      ends_at: '2024-11-15T12:00:00.000Z',
      is_override_allowed: true,
      max_override_period_minutes: 90,
      ...
    },
    {
      thermostat_schedule_id: '665553d1-94f9-4e92-9739-06ac6362c959',
      name: "Jane's stay",
      device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
      climate_preset_key: 'occupied',
      starts_at: '2024-11-16T15:00:00.000Z',
      ends_at: '2024-11-18T12:00:00.000Z',
      is_override_allowed: true,
      max_override_period_minutes: 90,
      ...
    }
  ]
  ```

  ```json cURL theme={null}
  {
    "thermostat_schedules": [
      {
        "thermostat_schedule_id":"89d3507e-60e3-4101-bd1b-ba066ec30ad4",
        "name":"Joe's stay",
        "device_id":"2d488679-6f07-4810-aed2-e726872c1dd5",
        "climate_preset_key":"occupied",
        "starts_at":"2024-11-10T15:00:00.000Z",
        "ends_at":"2024-11-15T12:00:00.000Z",
        "is_override_allowed": true,
        "max_override_period_minutes":90,
        ...
      },
      {
        "thermostat_schedule_id":"665553d1-94f9-4e92-9739-06ac6362c959",
        "name":"Jane's stay",
        "device_id":"2d488679-6f07-4810-aed2-e726872c1dd5",
        "climate_preset_key":"occupied",
        "starts_at":"2024-11-16T15:00:00.000Z",
        "ends_at":"2024-11-18T12:00:00.000Z",
        "is_override_allowed": true,
        "max_override_period_minutes":90,
        ...
      }
    ],
    "ok":true
  }
  ```

  ```json Python theme={null}
  [
    ThermostatSchedule(
      thermostat_schedule_id='89d3507e-60e3-4101-bd1b-ba066ec30ad4',
      name="Joe's stay",
      device_id='2d488679-6f07-4810-aed2-e726872c1dd5',
      climate_preset_key='occupied',
      starts_at='2024-11-10T15:00:00.000Z',
      ends_at='2024-11-15T12:00:00.000Z',
      is_override_allowed=True,
      max_override_period_minutes=90,
      ...
    ),
    ThermostatSchedule(
      thermostat_schedule_id='665553d1-94f9-4e92-9739-06ac6362c959',
      name="Jane's stay",
      device_id='2d488679-6f07-4810-aed2-e726872c1dd5',
      climate_preset_key='occupied',
      starts_at='2024-11-16T15:00:00.000Z',
      ends_at='2024-11-18T12:00:00.000Z',
      is_override_allowed=True,
      max_override_period_minutes=90,
      ...
    )
  ]
  ```

  ```json Ruby theme={null}
  [
    <Seam::Resources::ThermostatSchedule:0x005f0
      thermostat_schedule_id="4082a585-cf6e-4f6c-889d-d208fde226d0"
      name="Joe's stay"
      device_id="2d488679-6f07-4810-aed2-e726872c1dd5"
      climate_preset_key="occupied"
      starts_at=2024-11-10 15:00:00 UTC
      ends_at=2024-11-15 12:00:00 UTC
      is_override_allowed=true
      max_override_period_minutes=90
      ...
    >,
    <Seam::Resources::ThermostatSchedule:0x005f0
      thermostat_schedule_id="9d2b1c55-68cc-4c86-8478-dea3249e26b7"
      name="Jane's stay"
      device_id="2d488679-6f07-4810-aed2-e726872c1dd5"
      climate_preset_key="occupied"
      starts_at=2024-11-16 15:00:00 UTC
      ends_at=2024-11-18 12:00:00 UTC
      is_override_allowed=true
      max_override_period_minutes=90
      ...
    >
  ]
  ```

  ```json PHP theme={null}
  [
    {
      "thermostat_schedule_id": "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
      "name": "Joe's stay",
      "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key": "occupied",
      "starts_at": "2024-11-10T15:00:00.000Z",
      "ends_at": "2024-11-15T12:00:00.000Z",
      "is_override_allowed": true,
      "max_override_period_minutes": 90,
      ...
    },
    {
      "thermostat_schedule_id": "665553d1-94f9-4e92-9739-06ac6362c959",
      "name": "Jane's stay",
      "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key": "occupied",
      "starts_at": "2024-11-16T15:00:00.000Z",
      "ends_at": "2024-11-18T12:00:00.000Z",
      "is_override_allowed": true,
      "max_override_period_minutes": 90,
      ...
    }
  ]
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Get an Individual Thermostat Schedule

To get a specific thermostat schedule, issue a [`/thermostats/schedules/get`](/api/thermostats/schedules/get) request, including the `thermostat_schedule_id` of the desired thermostat schedule.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.thermostats.schedules.get({
    thermostat_schedule_id: '89d3507e-60e3-4101-bd1b-ba066ec30ad4',
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/get' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
      "thermostat_schedule_id": "89d3507e-60e3-4101-bd1b-ba066ec30ad4"
  }'
  ```

  ```python Python theme={null}
  seam.thermostats.schedules.get(
    thermostat_schedule_id = "89d3507e-60e3-4101-bd1b-ba066ec30ad4"
  )
  ```

  ```ruby Ruby theme={null}
  seam.thermostats.schedules.get(
    thermostat_schedule_id: "89d3507e-60e3-4101-bd1b-ba066ec30ad4"
  )
  ```

  ```php PHP theme={null}
  $seam->thermostats->schedules->get(
    thermostat_schedule_id: "89d3507e-60e3-4101-bd1b-ba066ec30ad4"
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    thermostat_schedule_id: '89d3507e-60e3-4101-bd1b-ba066ec30ad4',
    name: "Joe's stay",
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key: 'occupied',
    starts_at: '2024-11-10T15:00:00.000Z',
    ends_at: '2024-11-15T12:00:00.000Z',
    is_override_allowed: true,
    max_override_period_minutes: 90,
    ...
  }
  ```

  ```json cURL theme={null}
  {
    "thermostat_schedule": {
      "thermostat_schedule_id":"89d3507e-60e3-4101-bd1b-ba066ec30ad4",
      "name":"Joe's stay",
      "device_id":"2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key":"occupied",
      "starts_at":"2024-11-10T15:00:00.000Z",
      "ends_at":"2024-11-15T12:00:00.000Z",
      "is_override_allowed":true,
      "max_override_period_minutes":90,
      ...
    },
    "ok":true
  }
  ```

  ```json Python theme={null}
  ThermostatSchedule(
    thermostat_schedule_id='89d3507e-60e3-4101-bd1b-ba066ec30ad4',
    name="Joe's stay",
    device_id='2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key='occupied',
    starts_at='2024-11-10T15:00:00.000Z',
    ends_at='2024-11-15T12:00:00.000Z',
    is_override_allowed=True,
    max_override_period_minutes=90,
    ...
  )
  ```

  ```json Ruby theme={null}
  <Seam::Resources::ThermostatSchedule:0x005f0
    thermostat_schedule_id="89d3507e-60e3-4101-bd1b-ba066ec30ad4"
    name="Joe's stay"
    device_id="2d488679-6f07-4810-aed2-e726872c1dd5"
    climate_preset_key="occupied"
    starts_at=2024-11-10 15:00:00 UTC
    ends_at=2024-11-15 12:00:00 UTC
    is_override_allowed=true
    max_override_period_minutes=90
    ...
  >
  ```

  ```json PHP theme={null}
  {
    "thermostat_schedule_id": "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
    "name": "Joe's stay",
    "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
    "climate_preset_key": "occupied",
    "starts_at": "2024-11-10T15:00:00.000Z",
    "ends_at": "2024-11-15T12:00:00.000Z",
    "is_override_allowed": true,
    "max_override_period_minutes": 90,
    ...
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Update a Thermostat Schedule

To update a thermostat schedule, issue a [`/thermostats/schedules/update`](/api/thermostats/schedules/update) request, providing the `thermostat_schedule_id` of the desired thermostat schedule and the desired updated settings.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.thermostats.schedules.update({
    thermostat_schedule_id: '89d3507e-60e3-4101-bd1b-ba066ec30ad4',
    ends_at: '2024-11-15T15:00:00Z',
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/update' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
      "thermostat_schedule_id": "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
      "ends_at": "2024-11-15T15:00:00Z"
  }'
  ```

  ```python Python theme={null}
  seam.thermostats.schedules.update(
    thermostat_schedule_id = "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
    ends_at = "2024-11-15T15:00:00Z"
  )
  ```

  ```ruby Ruby theme={null}
  seam.thermostats.schedules.update(
    thermostat_schedule_id: "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
    ends_at: "2024-11-15T15:00:00Z"
  )
  ```

  ```php PHP theme={null}
  $seam->thermostats->schedules->update(
    thermostat_schedule_id: "89d3507e-60e3-4101-bd1b-ba066ec30ad4",
    ends_at: "2024-11-15T15:00:00Z"
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  void
  ```

  ```json cURL theme={null}
  {
    "ok": true
  }
  ```

  ```json Python theme={null}
  None
  ```

  ```json Ruby theme={null}
  nil
  ```

  ```json PHP theme={null}
  void
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Delete a Thermostat Schedule

To delete a thermostat schedule, issue a [`/thermostats/schedules/delete`](/api/thermostats/schedules/delete) request, providing the `thermostat_schedule_id` of the desired thermostat schedule.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.thermostats.schedules.delete({
    thermostat_schedule_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/schedules/delete' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
      "thermostat_schedule_id": "2d488679-6f07-4810-aed2-e726872c1dd5"
  }'
  ```

  ```python Python theme={null}
  seam.thermostats.schedules.delete(
    thermostat_schedule_id = "2d488679-6f07-4810-aed2-e726872c1dd5"
  )
  ```

  ```ruby Ruby theme={null}
  seam.thermostats.schedules.delete(
    thermostat_schedule_id: "2d488679-6f07-4810-aed2-e726872c1dd5"
  )
  ```

  ```php PHP theme={null}
  $seam->thermostats->schedules->delete(
    thermostat_schedule_id: "2d488679-6f07-4810-aed2-e726872c1dd5"
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  void
  ```

  ```json cURL theme={null}
  {
    "ok": true
  }
  ```

  ```json Python theme={null}
  None
  ```

  ```json Ruby theme={null}
  nil
  ```

  ```json PHP theme={null}
  void
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>
