Creates a for a specified .
Copy POST /thermostats/schedules/create ⇒ { thermostat_schedule }
Authentication MethodsPersonal access token
Must also include the seam-workspace
header in the request.
To learn more, see .
Request Parameters
climate_preset_key
String (Required)
Key of the to use for the thermostat schedule.
device_id
String (Required)
ID of the desired thermostat device.
ends_at
String (Required)
Date and time at which the thermostat schedule ends, in format.
starts_at
String (Required)
is_override_allowed
Boolean
max_override_period_minutes
Number
name
String
User-friendly name to identify the thermostat schedule.
Response
Copy {
JSON representation of thermostat_schedule
}
Examples
Create a thermostat schedule
Specify the device_id
of the desired thermostat and the climate_preset_key
of the desired climate preset, as well as the desired starts_at
and ends_at
times.
Code
Copy await seam.thermostats.schedules.create({
device_id: "123e4567-e89b-12d3-a456-426614174000",
name: "Reservation 1",
climate_preset_key: "occupied",
starts_at: "2024-11-01T15:00:00Z",
ends_at: "2024-11-05T12:00:00Z",
max_override_period_minutes: 90,
});
Output
Copy {
"thermostat_schedule_id": "56d29fcf-0674-4db5-8e03-b2370a77460a",
"name": "Reservation 1",
"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",
"max_override_period_minutes": 90
}
Code
Copy seam.thermostats.schedules.create(
device_id="123e4567-e89b-12d3-a456-426614174000",
name="Reservation 1",
climate_preset_key="occupied",
starts_at="2024-11-01T15:00:00Z",
ends_at="2024-11-05T12:00:00Z",
max_override_period_minutes=90,
)
Output
Copy ThermostatSchedule(
thermostat_schedule_id="56d29fcf-0674-4db5-8e03-b2370a77460a",
name="Reservation 1",
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",
max_override_period_minutes=90,
)
Code
Copy seam.thermostats.schedules.create(
device_id: "123e4567-e89b-12d3-a456-426614174000",
name: "Reservation 1",
climate_preset_key: "occupied",
starts_at: "2024-11-01T15:00:00Z",
ends_at: "2024-11-05T12:00:00Z",
max_override_period_minutes: 90,
)
Output
Copy {
"thermostat_schedule_id" => "56d29fcf-0674-4db5-8e03-b2370a77460a",
"name" => "Reservation 1",
"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",
"max_override_period_minutes" => 90,
}
Code
Copy <?php
$seam->thermostats->schedules->create(
device_id: "123e4567-e89b-12d3-a456-426614174000",
name: "Reservation 1",
climate_preset_key: "occupied",
starts_at: "2024-11-01T15:00:00Z",
ends_at: "2024-11-05T12:00:00Z",
max_override_period_minutes: 90
);
Output
Copy <?php
[
"thermostat_schedule_id" => "56d29fcf-0674-4db5-8e03-b2370a77460a",
"name" => "Reservation 1",
"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",
"max_override_period_minutes" => 90,
];
Code
Copy seam thermostats schedules create --device_id "123e4567-e89b-12d3-a456-426614174000" --name "Reservation 1" --climate_preset_key "occupied" --starts_at "2024-11-01T15:00:00Z" --ends_at "2024-11-05T12:00:00Z" --max_override_period_minutes 90
Output
Copy {
"thermostat_schedule_id": "56d29fcf-0674-4db5-8e03-b2370a77460a",
"name": "Reservation 1",
"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",
"max_override_period_minutes": 90
}
Code
Copy package main
import api "github.com/seamapi/go"
import schedules "github.com/seamapi/go/schedules"
func main() {
client.Thermostats.Schedules.Create(
context.Background(),
schedules.SchedulesCreateRequest{
DeviceId: api.String("123e4567-e89b-12d3-a456-426614174000"),
Name: api.String("Reservation 1"),
ClimatePresetKey: api.String("occupied"),
StartsAt: api.String("2024-11-01T15:00:00Z"),
EndsAt: api.String("2024-11-05T12:00:00Z"),
MaxOverridePeriodMinutes: api.Float64(90),
},
)
}
Output
Copy api.ThermostatSchedule{ThermostatScheduleId: "56d29fcf-0674-4db5-8e03-b2370a77460a", Name: "Reservation 1", DeviceId: "2d488679-6f07-4810-aed2-e726872c1dd5", ClimatePresetKey: "occupied", StartsAt: "2024-11-01T15:00:00.000Z", EndsAt: "2024-11-05T12:00:00.000Z", MaxOverridePeriodMinutes: 90}
Code
Copy curl --include --request POST "https://connect.getseam.com/thermostats/schedules/create" \
--header "Authorization: Bearer $SEAM_API_KEY" \
--json @- <<EOF
{
"device_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Reservation 1",
"climate_preset_key": "occupied",
"starts_at": "2024-11-01T15:00:00Z",
"ends_at": "2024-11-05T12:00:00Z",
"max_override_period_minutes": 90
}
EOF
Output
Copy {
"thermostat_schedule": {
"thermostat_schedule_id": "56d29fcf-0674-4db5-8e03-b2370a77460a",
"name": "Reservation 1",
"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",
"max_override_period_minutes": 90
}
}