preview
curl --request POST \
--url https://api.example.com/v1/devices/hvac/{id}/preview \
--header 'Content-Type: application/json' \
--header 'x-ws-api-key: <api-key>' \
--data '
{
"blocks": [],
"defaultCoolSetpoint": 74,
"defaultHeatSetpoint": 68,
"defaultMaxTemp": 75,
"defaultMinTemp": 65,
"defaultMode": "AUTO",
"tempUnits": "F"
}
'import requests
url = "https://api.example.com/v1/devices/hvac/{id}/preview"
payload = {
"blocks": [],
"defaultCoolSetpoint": 74,
"defaultHeatSetpoint": 68,
"defaultMaxTemp": 75,
"defaultMinTemp": 65,
"defaultMode": "AUTO",
"tempUnits": "F"
}
headers = {
"x-ws-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-ws-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
blocks: [],
defaultCoolSetpoint: 74,
defaultHeatSetpoint: 68,
defaultMaxTemp: 75,
defaultMinTemp: 65,
defaultMode: 'AUTO',
tempUnits: 'F'
})
};
fetch('https://api.example.com/v1/devices/hvac/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/devices/hvac/{id}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'blocks' => [
],
'defaultCoolSetpoint' => 74,
'defaultHeatSetpoint' => 68,
'defaultMaxTemp' => 75,
'defaultMinTemp' => 65,
'defaultMode' => 'AUTO',
'tempUnits' => 'F'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ws-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/devices/hvac/{id}/preview"
payload := strings.NewReader("{\n \"blocks\": [],\n \"defaultCoolSetpoint\": 74,\n \"defaultHeatSetpoint\": 68,\n \"defaultMaxTemp\": 75,\n \"defaultMinTemp\": 65,\n \"defaultMode\": \"AUTO\",\n \"tempUnits\": \"F\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ws-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/devices/hvac/{id}/preview")
.header("x-ws-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blocks\": [],\n \"defaultCoolSetpoint\": 74,\n \"defaultHeatSetpoint\": 68,\n \"defaultMaxTemp\": 75,\n \"defaultMinTemp\": 65,\n \"defaultMode\": \"AUTO\",\n \"tempUnits\": \"F\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/devices/hvac/{id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ws-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"blocks\": [],\n \"defaultCoolSetpoint\": 74,\n \"defaultHeatSetpoint\": 68,\n \"defaultMaxTemp\": 75,\n \"defaultMinTemp\": 65,\n \"defaultMode\": \"AUTO\",\n \"tempUnits\": \"F\"\n}"
response = http.request(request)
puts response.read_body{
"setPointSchedule": {
"blocks": [
{
"startDatetime": "2025-06-02T00:00:00.000Z",
"endDatetime": "2025-06-02T08:00:00.000Z",
"targetTemp": null,
"targetCoolSetpoint": 74,
"targetHeatSetpoint": 68,
"targetMode": "AUTO"
},
{
"startDatetime": "2025-06-02T08:00:00.000Z",
"endDatetime": "2025-06-03T00:00:00.000Z",
"targetTemp": null,
"targetCoolSetpoint": 76,
"targetHeatSetpoint": 66,
"targetMode": "COOL"
}
],
"startDatetime": "2025-06-02T00:00:00.000Z",
"endDatetime": "2025-06-03T00:00:00.000Z",
"tempUnits": "F"
},
"temperatureData": [
68,
69,
70,
71
],
"rates": [
0.24,
0.26,
0.28,
0.3
],
"estimatedSavings": 12.45
}hvac
preview
POST
/
v1
/
devices
/
hvac
/
{id}
/
preview
preview
curl --request POST \
--url https://api.example.com/v1/devices/hvac/{id}/preview \
--header 'Content-Type: application/json' \
--header 'x-ws-api-key: <api-key>' \
--data '
{
"blocks": [],
"defaultCoolSetpoint": 74,
"defaultHeatSetpoint": 68,
"defaultMaxTemp": 75,
"defaultMinTemp": 65,
"defaultMode": "AUTO",
"tempUnits": "F"
}
'import requests
url = "https://api.example.com/v1/devices/hvac/{id}/preview"
payload = {
"blocks": [],
"defaultCoolSetpoint": 74,
"defaultHeatSetpoint": 68,
"defaultMaxTemp": 75,
"defaultMinTemp": 65,
"defaultMode": "AUTO",
"tempUnits": "F"
}
headers = {
"x-ws-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-ws-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
blocks: [],
defaultCoolSetpoint: 74,
defaultHeatSetpoint: 68,
defaultMaxTemp: 75,
defaultMinTemp: 65,
defaultMode: 'AUTO',
tempUnits: 'F'
})
};
fetch('https://api.example.com/v1/devices/hvac/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/devices/hvac/{id}/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'blocks' => [
],
'defaultCoolSetpoint' => 74,
'defaultHeatSetpoint' => 68,
'defaultMaxTemp' => 75,
'defaultMinTemp' => 65,
'defaultMode' => 'AUTO',
'tempUnits' => 'F'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ws-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/devices/hvac/{id}/preview"
payload := strings.NewReader("{\n \"blocks\": [],\n \"defaultCoolSetpoint\": 74,\n \"defaultHeatSetpoint\": 68,\n \"defaultMaxTemp\": 75,\n \"defaultMinTemp\": 65,\n \"defaultMode\": \"AUTO\",\n \"tempUnits\": \"F\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ws-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/devices/hvac/{id}/preview")
.header("x-ws-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blocks\": [],\n \"defaultCoolSetpoint\": 74,\n \"defaultHeatSetpoint\": 68,\n \"defaultMaxTemp\": 75,\n \"defaultMinTemp\": 65,\n \"defaultMode\": \"AUTO\",\n \"tempUnits\": \"F\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/devices/hvac/{id}/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ws-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"blocks\": [],\n \"defaultCoolSetpoint\": 74,\n \"defaultHeatSetpoint\": 68,\n \"defaultMaxTemp\": 75,\n \"defaultMinTemp\": 65,\n \"defaultMode\": \"AUTO\",\n \"tempUnits\": \"F\"\n}"
response = http.request(request)
puts response.read_body{
"setPointSchedule": {
"blocks": [
{
"startDatetime": "2025-06-02T00:00:00.000Z",
"endDatetime": "2025-06-02T08:00:00.000Z",
"targetTemp": null,
"targetCoolSetpoint": 74,
"targetHeatSetpoint": 68,
"targetMode": "AUTO"
},
{
"startDatetime": "2025-06-02T08:00:00.000Z",
"endDatetime": "2025-06-03T00:00:00.000Z",
"targetTemp": null,
"targetCoolSetpoint": 76,
"targetHeatSetpoint": 66,
"targetMode": "COOL"
}
],
"startDatetime": "2025-06-02T00:00:00.000Z",
"endDatetime": "2025-06-03T00:00:00.000Z",
"tempUnits": "F"
},
"temperatureData": [
68,
69,
70,
71
],
"rates": [
0.24,
0.26,
0.28,
0.3
],
"estimatedSavings": 12.45
}Body
application/json
HVAC schedule preview. defaultCoolSetpoint and defaultHeatSetpoint are required when blocks is empty.
