Submit device states
curl --request POST \
--url https://energy-api.flatpeak.com/device-states \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"device_id": "dev_63a6087272941ef077a8fd3e",
"time_recorded": "2026-02-01T10:30:00Z",
"record_reference_id": "MET1234567890",
"battery": {
"state_of_charge_percent": 34.2,
"target_state_of_charge_percent": 80,
"power_kw": -3.4,
"energy_remaining_kwh": 8.3,
"temperature_c": 18.5,
"backup_reserve_percent": 20,
"strategy": "SELF_POWER",
"storm_mode_enabled": true,
"storm_mode_active": false,
"export_rule": "BATTERY_OK",
"charge_from_grid_enabled": true,
"grid_status": "ON_GRID"
},
"vehicle": {
"state_of_charge_percent": 62,
"charge_limit_percent": 80,
"energy_remaining_kwh": 39.7,
"plugged_in": true,
"charging_state": "CHARGING",
"time_departure": "2026-02-01T07:30:00Z",
"range_km": 180,
"max_charging_power_kw": 7.4
},
"evse": {
"plugged_in": true,
"charging_state": "CHARGING",
"power_kw": 7.2,
"max_charging_power_kw": 7.4
},
"pv": {
"power_kw": 4.2
}
}
]
}
'import requests
url = "https://energy-api.flatpeak.com/device-states"
payload = { "data": [
{
"device_id": "dev_63a6087272941ef077a8fd3e",
"time_recorded": "2026-02-01T10:30:00Z",
"record_reference_id": "MET1234567890",
"battery": {
"state_of_charge_percent": 34.2,
"target_state_of_charge_percent": 80,
"power_kw": -3.4,
"energy_remaining_kwh": 8.3,
"temperature_c": 18.5,
"backup_reserve_percent": 20,
"strategy": "SELF_POWER",
"storm_mode_enabled": True,
"storm_mode_active": False,
"export_rule": "BATTERY_OK",
"charge_from_grid_enabled": True,
"grid_status": "ON_GRID"
},
"vehicle": {
"state_of_charge_percent": 62,
"charge_limit_percent": 80,
"energy_remaining_kwh": 39.7,
"plugged_in": True,
"charging_state": "CHARGING",
"time_departure": "2026-02-01T07:30:00Z",
"range_km": 180,
"max_charging_power_kw": 7.4
},
"evse": {
"plugged_in": True,
"charging_state": "CHARGING",
"power_kw": 7.2,
"max_charging_power_kw": 7.4
},
"pv": { "power_kw": 4.2 }
}
] }
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: [
{
device_id: 'dev_63a6087272941ef077a8fd3e',
time_recorded: '2026-02-01T10:30:00Z',
record_reference_id: 'MET1234567890',
battery: {
state_of_charge_percent: 34.2,
target_state_of_charge_percent: 80,
power_kw: -3.4,
energy_remaining_kwh: 8.3,
temperature_c: 18.5,
backup_reserve_percent: 20,
strategy: 'SELF_POWER',
storm_mode_enabled: true,
storm_mode_active: false,
export_rule: 'BATTERY_OK',
charge_from_grid_enabled: true,
grid_status: 'ON_GRID'
},
vehicle: {
state_of_charge_percent: 62,
charge_limit_percent: 80,
energy_remaining_kwh: 39.7,
plugged_in: true,
charging_state: 'CHARGING',
time_departure: '2026-02-01T07:30:00Z',
range_km: 180,
max_charging_power_kw: 7.4
},
evse: {
plugged_in: true,
charging_state: 'CHARGING',
power_kw: 7.2,
max_charging_power_kw: 7.4
},
pv: {power_kw: 4.2}
}
]
})
};
fetch('https://energy-api.flatpeak.com/device-states', 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/device-states",
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' => [
[
'device_id' => 'dev_63a6087272941ef077a8fd3e',
'time_recorded' => '2026-02-01T10:30:00Z',
'record_reference_id' => 'MET1234567890',
'battery' => [
'state_of_charge_percent' => 34.2,
'target_state_of_charge_percent' => 80,
'power_kw' => -3.4,
'energy_remaining_kwh' => 8.3,
'temperature_c' => 18.5,
'backup_reserve_percent' => 20,
'strategy' => 'SELF_POWER',
'storm_mode_enabled' => true,
'storm_mode_active' => false,
'export_rule' => 'BATTERY_OK',
'charge_from_grid_enabled' => true,
'grid_status' => 'ON_GRID'
],
'vehicle' => [
'state_of_charge_percent' => 62,
'charge_limit_percent' => 80,
'energy_remaining_kwh' => 39.7,
'plugged_in' => true,
'charging_state' => 'CHARGING',
'time_departure' => '2026-02-01T07:30:00Z',
'range_km' => 180,
'max_charging_power_kw' => 7.4
],
'evse' => [
'plugged_in' => true,
'charging_state' => 'CHARGING',
'power_kw' => 7.2,
'max_charging_power_kw' => 7.4
],
'pv' => [
'power_kw' => 4.2
]
]
]
]),
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/device-states"
payload := strings.NewReader("{\n \"data\": [\n {\n \"device_id\": \"dev_63a6087272941ef077a8fd3e\",\n \"time_recorded\": \"2026-02-01T10:30:00Z\",\n \"record_reference_id\": \"MET1234567890\",\n \"battery\": {\n \"state_of_charge_percent\": 34.2,\n \"target_state_of_charge_percent\": 80,\n \"power_kw\": -3.4,\n \"energy_remaining_kwh\": 8.3,\n \"temperature_c\": 18.5,\n \"backup_reserve_percent\": 20,\n \"strategy\": \"SELF_POWER\",\n \"storm_mode_enabled\": true,\n \"storm_mode_active\": false,\n \"export_rule\": \"BATTERY_OK\",\n \"charge_from_grid_enabled\": true,\n \"grid_status\": \"ON_GRID\"\n },\n \"vehicle\": {\n \"state_of_charge_percent\": 62,\n \"charge_limit_percent\": 80,\n \"energy_remaining_kwh\": 39.7,\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"time_departure\": \"2026-02-01T07:30:00Z\",\n \"range_km\": 180,\n \"max_charging_power_kw\": 7.4\n },\n \"evse\": {\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"power_kw\": 7.2,\n \"max_charging_power_kw\": 7.4\n },\n \"pv\": {\n \"power_kw\": 4.2\n }\n }\n ]\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/device-states")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"device_id\": \"dev_63a6087272941ef077a8fd3e\",\n \"time_recorded\": \"2026-02-01T10:30:00Z\",\n \"record_reference_id\": \"MET1234567890\",\n \"battery\": {\n \"state_of_charge_percent\": 34.2,\n \"target_state_of_charge_percent\": 80,\n \"power_kw\": -3.4,\n \"energy_remaining_kwh\": 8.3,\n \"temperature_c\": 18.5,\n \"backup_reserve_percent\": 20,\n \"strategy\": \"SELF_POWER\",\n \"storm_mode_enabled\": true,\n \"storm_mode_active\": false,\n \"export_rule\": \"BATTERY_OK\",\n \"charge_from_grid_enabled\": true,\n \"grid_status\": \"ON_GRID\"\n },\n \"vehicle\": {\n \"state_of_charge_percent\": 62,\n \"charge_limit_percent\": 80,\n \"energy_remaining_kwh\": 39.7,\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"time_departure\": \"2026-02-01T07:30:00Z\",\n \"range_km\": 180,\n \"max_charging_power_kw\": 7.4\n },\n \"evse\": {\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"power_kw\": 7.2,\n \"max_charging_power_kw\": 7.4\n },\n \"pv\": {\n \"power_kw\": 4.2\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/device-states")
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 \"device_id\": \"dev_63a6087272941ef077a8fd3e\",\n \"time_recorded\": \"2026-02-01T10:30:00Z\",\n \"record_reference_id\": \"MET1234567890\",\n \"battery\": {\n \"state_of_charge_percent\": 34.2,\n \"target_state_of_charge_percent\": 80,\n \"power_kw\": -3.4,\n \"energy_remaining_kwh\": 8.3,\n \"temperature_c\": 18.5,\n \"backup_reserve_percent\": 20,\n \"strategy\": \"SELF_POWER\",\n \"storm_mode_enabled\": true,\n \"storm_mode_active\": false,\n \"export_rule\": \"BATTERY_OK\",\n \"charge_from_grid_enabled\": true,\n \"grid_status\": \"ON_GRID\"\n },\n \"vehicle\": {\n \"state_of_charge_percent\": 62,\n \"charge_limit_percent\": 80,\n \"energy_remaining_kwh\": 39.7,\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"time_departure\": \"2026-02-01T07:30:00Z\",\n \"range_km\": 180,\n \"max_charging_power_kw\": 7.4\n },\n \"evse\": {\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"power_kw\": 7.2,\n \"max_charging_power_kw\": 7.4\n },\n \"pv\": {\n \"power_kw\": 4.2\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "device_state_batch",
"live_mode": true,
"accepted_count": 998,
"rejected": [
{
"index": 41,
"device_id": "dev_9c1f70a4e2b6485db3f0c8a1",
"code": "device_not_found",
"message": "No device dev_9c1f70a4e2b6485db3f0c8a1 on this account."
}
],
"time_created": "2026-08-04T16:00:05Z"
}{
"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"
}Device state
Submit device states
Submits state samples for up to 1,000 devices in one call. Each sample is validated alone: valid samples are stored even when others are rejected.
POST
/
device-states
Submit device states
curl --request POST \
--url https://energy-api.flatpeak.com/device-states \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": [
{
"device_id": "dev_63a6087272941ef077a8fd3e",
"time_recorded": "2026-02-01T10:30:00Z",
"record_reference_id": "MET1234567890",
"battery": {
"state_of_charge_percent": 34.2,
"target_state_of_charge_percent": 80,
"power_kw": -3.4,
"energy_remaining_kwh": 8.3,
"temperature_c": 18.5,
"backup_reserve_percent": 20,
"strategy": "SELF_POWER",
"storm_mode_enabled": true,
"storm_mode_active": false,
"export_rule": "BATTERY_OK",
"charge_from_grid_enabled": true,
"grid_status": "ON_GRID"
},
"vehicle": {
"state_of_charge_percent": 62,
"charge_limit_percent": 80,
"energy_remaining_kwh": 39.7,
"plugged_in": true,
"charging_state": "CHARGING",
"time_departure": "2026-02-01T07:30:00Z",
"range_km": 180,
"max_charging_power_kw": 7.4
},
"evse": {
"plugged_in": true,
"charging_state": "CHARGING",
"power_kw": 7.2,
"max_charging_power_kw": 7.4
},
"pv": {
"power_kw": 4.2
}
}
]
}
'import requests
url = "https://energy-api.flatpeak.com/device-states"
payload = { "data": [
{
"device_id": "dev_63a6087272941ef077a8fd3e",
"time_recorded": "2026-02-01T10:30:00Z",
"record_reference_id": "MET1234567890",
"battery": {
"state_of_charge_percent": 34.2,
"target_state_of_charge_percent": 80,
"power_kw": -3.4,
"energy_remaining_kwh": 8.3,
"temperature_c": 18.5,
"backup_reserve_percent": 20,
"strategy": "SELF_POWER",
"storm_mode_enabled": True,
"storm_mode_active": False,
"export_rule": "BATTERY_OK",
"charge_from_grid_enabled": True,
"grid_status": "ON_GRID"
},
"vehicle": {
"state_of_charge_percent": 62,
"charge_limit_percent": 80,
"energy_remaining_kwh": 39.7,
"plugged_in": True,
"charging_state": "CHARGING",
"time_departure": "2026-02-01T07:30:00Z",
"range_km": 180,
"max_charging_power_kw": 7.4
},
"evse": {
"plugged_in": True,
"charging_state": "CHARGING",
"power_kw": 7.2,
"max_charging_power_kw": 7.4
},
"pv": { "power_kw": 4.2 }
}
] }
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: [
{
device_id: 'dev_63a6087272941ef077a8fd3e',
time_recorded: '2026-02-01T10:30:00Z',
record_reference_id: 'MET1234567890',
battery: {
state_of_charge_percent: 34.2,
target_state_of_charge_percent: 80,
power_kw: -3.4,
energy_remaining_kwh: 8.3,
temperature_c: 18.5,
backup_reserve_percent: 20,
strategy: 'SELF_POWER',
storm_mode_enabled: true,
storm_mode_active: false,
export_rule: 'BATTERY_OK',
charge_from_grid_enabled: true,
grid_status: 'ON_GRID'
},
vehicle: {
state_of_charge_percent: 62,
charge_limit_percent: 80,
energy_remaining_kwh: 39.7,
plugged_in: true,
charging_state: 'CHARGING',
time_departure: '2026-02-01T07:30:00Z',
range_km: 180,
max_charging_power_kw: 7.4
},
evse: {
plugged_in: true,
charging_state: 'CHARGING',
power_kw: 7.2,
max_charging_power_kw: 7.4
},
pv: {power_kw: 4.2}
}
]
})
};
fetch('https://energy-api.flatpeak.com/device-states', 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/device-states",
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' => [
[
'device_id' => 'dev_63a6087272941ef077a8fd3e',
'time_recorded' => '2026-02-01T10:30:00Z',
'record_reference_id' => 'MET1234567890',
'battery' => [
'state_of_charge_percent' => 34.2,
'target_state_of_charge_percent' => 80,
'power_kw' => -3.4,
'energy_remaining_kwh' => 8.3,
'temperature_c' => 18.5,
'backup_reserve_percent' => 20,
'strategy' => 'SELF_POWER',
'storm_mode_enabled' => true,
'storm_mode_active' => false,
'export_rule' => 'BATTERY_OK',
'charge_from_grid_enabled' => true,
'grid_status' => 'ON_GRID'
],
'vehicle' => [
'state_of_charge_percent' => 62,
'charge_limit_percent' => 80,
'energy_remaining_kwh' => 39.7,
'plugged_in' => true,
'charging_state' => 'CHARGING',
'time_departure' => '2026-02-01T07:30:00Z',
'range_km' => 180,
'max_charging_power_kw' => 7.4
],
'evse' => [
'plugged_in' => true,
'charging_state' => 'CHARGING',
'power_kw' => 7.2,
'max_charging_power_kw' => 7.4
],
'pv' => [
'power_kw' => 4.2
]
]
]
]),
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/device-states"
payload := strings.NewReader("{\n \"data\": [\n {\n \"device_id\": \"dev_63a6087272941ef077a8fd3e\",\n \"time_recorded\": \"2026-02-01T10:30:00Z\",\n \"record_reference_id\": \"MET1234567890\",\n \"battery\": {\n \"state_of_charge_percent\": 34.2,\n \"target_state_of_charge_percent\": 80,\n \"power_kw\": -3.4,\n \"energy_remaining_kwh\": 8.3,\n \"temperature_c\": 18.5,\n \"backup_reserve_percent\": 20,\n \"strategy\": \"SELF_POWER\",\n \"storm_mode_enabled\": true,\n \"storm_mode_active\": false,\n \"export_rule\": \"BATTERY_OK\",\n \"charge_from_grid_enabled\": true,\n \"grid_status\": \"ON_GRID\"\n },\n \"vehicle\": {\n \"state_of_charge_percent\": 62,\n \"charge_limit_percent\": 80,\n \"energy_remaining_kwh\": 39.7,\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"time_departure\": \"2026-02-01T07:30:00Z\",\n \"range_km\": 180,\n \"max_charging_power_kw\": 7.4\n },\n \"evse\": {\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"power_kw\": 7.2,\n \"max_charging_power_kw\": 7.4\n },\n \"pv\": {\n \"power_kw\": 4.2\n }\n }\n ]\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/device-states")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"device_id\": \"dev_63a6087272941ef077a8fd3e\",\n \"time_recorded\": \"2026-02-01T10:30:00Z\",\n \"record_reference_id\": \"MET1234567890\",\n \"battery\": {\n \"state_of_charge_percent\": 34.2,\n \"target_state_of_charge_percent\": 80,\n \"power_kw\": -3.4,\n \"energy_remaining_kwh\": 8.3,\n \"temperature_c\": 18.5,\n \"backup_reserve_percent\": 20,\n \"strategy\": \"SELF_POWER\",\n \"storm_mode_enabled\": true,\n \"storm_mode_active\": false,\n \"export_rule\": \"BATTERY_OK\",\n \"charge_from_grid_enabled\": true,\n \"grid_status\": \"ON_GRID\"\n },\n \"vehicle\": {\n \"state_of_charge_percent\": 62,\n \"charge_limit_percent\": 80,\n \"energy_remaining_kwh\": 39.7,\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"time_departure\": \"2026-02-01T07:30:00Z\",\n \"range_km\": 180,\n \"max_charging_power_kw\": 7.4\n },\n \"evse\": {\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"power_kw\": 7.2,\n \"max_charging_power_kw\": 7.4\n },\n \"pv\": {\n \"power_kw\": 4.2\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/device-states")
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 \"device_id\": \"dev_63a6087272941ef077a8fd3e\",\n \"time_recorded\": \"2026-02-01T10:30:00Z\",\n \"record_reference_id\": \"MET1234567890\",\n \"battery\": {\n \"state_of_charge_percent\": 34.2,\n \"target_state_of_charge_percent\": 80,\n \"power_kw\": -3.4,\n \"energy_remaining_kwh\": 8.3,\n \"temperature_c\": 18.5,\n \"backup_reserve_percent\": 20,\n \"strategy\": \"SELF_POWER\",\n \"storm_mode_enabled\": true,\n \"storm_mode_active\": false,\n \"export_rule\": \"BATTERY_OK\",\n \"charge_from_grid_enabled\": true,\n \"grid_status\": \"ON_GRID\"\n },\n \"vehicle\": {\n \"state_of_charge_percent\": 62,\n \"charge_limit_percent\": 80,\n \"energy_remaining_kwh\": 39.7,\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"time_departure\": \"2026-02-01T07:30:00Z\",\n \"range_km\": 180,\n \"max_charging_power_kw\": 7.4\n },\n \"evse\": {\n \"plugged_in\": true,\n \"charging_state\": \"CHARGING\",\n \"power_kw\": 7.2,\n \"max_charging_power_kw\": 7.4\n },\n \"pv\": {\n \"power_kw\": 4.2\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"object": "device_state_batch",
"live_mode": true,
"accepted_count": 998,
"rejected": [
{
"index": 41,
"device_id": "dev_9c1f70a4e2b6485db3f0c8a1",
"code": "device_not_found",
"message": "No device dev_9c1f70a4e2b6485db3f0c8a1 on this account."
}
],
"time_created": "2026-08-04T16:00:05Z"
}{
"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
Response
Device state batch response.
The result of a device state batch. Accepted samples are stored; each rejected one is listed with why.
Was this page helpful?

