Retrieve a device state
curl --request GET \
--url https://energy-api.flatpeak.com/devices/{device_id}/state \
--header 'Authorization: Bearer <token>'import requests
url = "https://energy-api.flatpeak.com/devices/{device_id}/state"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://energy-api.flatpeak.com/devices/{device_id}/state', 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}/state",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://energy-api.flatpeak.com/devices/{device_id}/state"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://energy-api.flatpeak.com/devices/{device_id}/state")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/devices/{device_id}/state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "dsr_6a284b7596d3f2b722544e70",
"object": "device_state",
"location_id": "loc_641b90b758fb8e6293716e40",
"time_recorded": "2026-02-01T10:30:00Z",
"time_created": "2026-02-01T10:33:00Z",
"account_id": "acc_661677911f2197045e6cf1b1",
"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
}
}{
"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
Retrieve a device state
Retrieves the latest submitted device state.
GET
/
devices
/
{device_id}
/
state
Retrieve a device state
curl --request GET \
--url https://energy-api.flatpeak.com/devices/{device_id}/state \
--header 'Authorization: Bearer <token>'import requests
url = "https://energy-api.flatpeak.com/devices/{device_id}/state"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://energy-api.flatpeak.com/devices/{device_id}/state', 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}/state",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://energy-api.flatpeak.com/devices/{device_id}/state"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://energy-api.flatpeak.com/devices/{device_id}/state")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/devices/{device_id}/state")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "dsr_6a284b7596d3f2b722544e70",
"object": "device_state",
"location_id": "loc_641b90b758fb8e6293716e40",
"time_recorded": "2026-02-01T10:30:00Z",
"time_created": "2026-02-01T10:33:00Z",
"account_id": "acc_661677911f2197045e6cf1b1",
"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
}
}{
"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"
}Response
Device state response.
The most recent operational state of a device, grouped by subsystem.
Was this page helpful?

