Confirm instructions
curl --request POST \
--url https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"start_time": "2026-08-04T20:14:00Z",
"end_time": "2026-08-04T22:00:00Z",
"power_kw": -4.3
}
],
"record_reference_id": "nova-7d1c-2026-08-04T16:01"
}
'import requests
url = "https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm"
payload = {
"data": [
{
"start_time": "2026-08-04T20:14:00Z",
"end_time": "2026-08-04T22:00:00Z",
"power_kw": -4.3
}
],
"record_reference_id": "nova-7d1c-2026-08-04T16:01"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: [
{
start_time: '2026-08-04T20:14:00Z',
end_time: '2026-08-04T22:00:00Z',
power_kw: -4.3
}
],
record_reference_id: 'nova-7d1c-2026-08-04T16:01'
})
};
fetch('https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm', 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://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm",
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([
'data' => [
[
'start_time' => '2026-08-04T20:14:00Z',
'end_time' => '2026-08-04T22:00:00Z',
'power_kw' => -4.3
]
],
'record_reference_id' => 'nova-7d1c-2026-08-04T16:01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm"
payload := strings.NewReader("{\n \"data\": [\n {\n \"start_time\": \"2026-08-04T20:14:00Z\",\n \"end_time\": \"2026-08-04T22:00:00Z\",\n \"power_kw\": -4.3\n }\n ],\n \"record_reference_id\": \"nova-7d1c-2026-08-04T16:01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"start_time\": \"2026-08-04T20:14:00Z\",\n \"end_time\": \"2026-08-04T22:00:00Z\",\n \"power_kw\": -4.3\n }\n ],\n \"record_reference_id\": \"nova-7d1c-2026-08-04T16:01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": [\n {\n \"start_time\": \"2026-08-04T20:14:00Z\",\n \"end_time\": \"2026-08-04T22:00:00Z\",\n \"power_kw\": -4.3\n }\n ],\n \"record_reference_id\": \"nova-7d1c-2026-08-04T16:01\"\n}"
response = http.request(request)
puts response.read_body{
"id": "icf_6a284b7596d3f2b722544e70",
"object": "instruction_confirmation",
"live_mode": true,
"device_id": "dev_63a6087272941ef077a8fd3e",
"record_reference_id": "nova-7d1c-2026-08-04T16:01",
"data": [
{
"start_time": "2026-08-04T20:14:00Z",
"end_time": "2026-08-04T22:00:00Z",
"power_kw": -4.3,
"instructed_power_kw": -4.3,
"vpp_event_id": "vpe_7a1c3e5b9d2f4a6c8e0b1d3f",
"plan_id": null
}
],
"response": {
"pickup_seconds": 38,
"apply_seconds": 173,
"total_seconds": 211
},
"time_created": "2026-08-04T16:01:40Z",
"account_id": "acc_661677911f2197045e6cf1b1"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}Instructions
Confirm instructions
Confirms the power the device will deliver for each instruction segment. Confirm each time you fetch instructions, up to 72 hours ahead. Confirm the instruction windows only, not the rest of the device’s day. A later confirmation replaces earlier ones for the windows it covers. Power below the instruction is recorded as a deviation; delivery is still measured from meter records. Pass record_reference_id for idempotent retries.
POST
/
devices
/
{device_id}
/
instructions
/
confirm
Confirm instructions
curl --request POST \
--url https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"start_time": "2026-08-04T20:14:00Z",
"end_time": "2026-08-04T22:00:00Z",
"power_kw": -4.3
}
],
"record_reference_id": "nova-7d1c-2026-08-04T16:01"
}
'import requests
url = "https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm"
payload = {
"data": [
{
"start_time": "2026-08-04T20:14:00Z",
"end_time": "2026-08-04T22:00:00Z",
"power_kw": -4.3
}
],
"record_reference_id": "nova-7d1c-2026-08-04T16:01"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: [
{
start_time: '2026-08-04T20:14:00Z',
end_time: '2026-08-04T22:00:00Z',
power_kw: -4.3
}
],
record_reference_id: 'nova-7d1c-2026-08-04T16:01'
})
};
fetch('https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm', 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://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm",
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([
'data' => [
[
'start_time' => '2026-08-04T20:14:00Z',
'end_time' => '2026-08-04T22:00:00Z',
'power_kw' => -4.3
]
],
'record_reference_id' => 'nova-7d1c-2026-08-04T16:01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm"
payload := strings.NewReader("{\n \"data\": [\n {\n \"start_time\": \"2026-08-04T20:14:00Z\",\n \"end_time\": \"2026-08-04T22:00:00Z\",\n \"power_kw\": -4.3\n }\n ],\n \"record_reference_id\": \"nova-7d1c-2026-08-04T16:01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"start_time\": \"2026-08-04T20:14:00Z\",\n \"end_time\": \"2026-08-04T22:00:00Z\",\n \"power_kw\": -4.3\n }\n ],\n \"record_reference_id\": \"nova-7d1c-2026-08-04T16:01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/devices/{device_id}/instructions/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": [\n {\n \"start_time\": \"2026-08-04T20:14:00Z\",\n \"end_time\": \"2026-08-04T22:00:00Z\",\n \"power_kw\": -4.3\n }\n ],\n \"record_reference_id\": \"nova-7d1c-2026-08-04T16:01\"\n}"
response = http.request(request)
puts response.read_body{
"id": "icf_6a284b7596d3f2b722544e70",
"object": "instruction_confirmation",
"live_mode": true,
"device_id": "dev_63a6087272941ef077a8fd3e",
"record_reference_id": "nova-7d1c-2026-08-04T16:01",
"data": [
{
"start_time": "2026-08-04T20:14:00Z",
"end_time": "2026-08-04T22:00:00Z",
"power_kw": -4.3,
"instructed_power_kw": -4.3,
"vpp_event_id": "vpe_7a1c3e5b9d2f4a6c8e0b1d3f",
"plan_id": null
}
],
"response": {
"pickup_seconds": 38,
"apply_seconds": 173,
"total_seconds": 211
},
"time_created": "2026-08-04T16:01:40Z",
"account_id": "acc_661677911f2197045e6cf1b1"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}Body
application/json
What the device will deliver for each instruction segment you fetched.
Response
Instruction confirmation response.
What the device will deliver for its instructions, as you confirmed it.
Was this page helpful?

