List commands
curl --request GET \
--url https://api.kapa.energy/bat/v1/{id}/commands \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kapa.energy/bat/v1/{id}/commands"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kapa.energy/bat/v1/{id}/commands', 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.kapa.energy/bat/v1/{id}/commands",
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://api.kapa.energy/bat/v1/{id}/commands"
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://api.kapa.energy/bat/v1/{id}/commands")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapa.energy/bat/v1/{id}/commands")
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{
"commands": [
{
"command_id": "cmd_610",
"battery_id": "bat_1",
"action": "discharge",
"parameters": {
"min_wh": 1500,
"max_wh": null
},
"start": "2026-11-12T18:00:00Z",
"end": "2026-11-12T19:00:00Z",
"status": "scheduled",
"status_reason": null,
"batch_id": null,
"created_at": "2026-11-12T16:02:51Z",
"updated_at": "2026-11-12T16:03:20Z"
},
{
"command_id": "cmd_501",
"battery_id": "bat_1",
"action": "charge",
"parameters": {
"allow_import": true,
"max_wh": 12000
},
"start": "2026-11-12T13:00:00Z",
"end": "2026-11-12T15:00:00Z",
"status": "completed",
"status_reason": null,
"batch_id": null,
"created_at": "2026-11-12T12:41:07Z",
"updated_at": "2026-11-12T15:00:04Z"
}
],
"next_cursor": null
}{
"type": "https://api.kapa.energy/problems/invalid-time-window",
"title": "Invalid time window",
"status": 400,
"code": "invalid_time_window",
"detail": "end must be after start.",
"invalid_params": [
{
"name": "end",
"reason": "must be after start"
}
]
}{
"type": "https://api.kapa.energy/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized",
"detail": "The access token has expired."
}{
"type": "https://api.kapa.energy/problems/battery-not-found",
"title": "Battery not found",
"status": 404,
"code": "battery_not_found",
"detail": "No battery with id bat_9 is accessible to this client."
}Commands
List commands
Commands on this battery whose window overlaps [start, end), with their
current status, most recently created first.
GET
/
bat
/
v1
/
{id}
/
commands
List commands
curl --request GET \
--url https://api.kapa.energy/bat/v1/{id}/commands \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.kapa.energy/bat/v1/{id}/commands"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.kapa.energy/bat/v1/{id}/commands', 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.kapa.energy/bat/v1/{id}/commands",
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://api.kapa.energy/bat/v1/{id}/commands"
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://api.kapa.energy/bat/v1/{id}/commands")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapa.energy/bat/v1/{id}/commands")
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{
"commands": [
{
"command_id": "cmd_610",
"battery_id": "bat_1",
"action": "discharge",
"parameters": {
"min_wh": 1500,
"max_wh": null
},
"start": "2026-11-12T18:00:00Z",
"end": "2026-11-12T19:00:00Z",
"status": "scheduled",
"status_reason": null,
"batch_id": null,
"created_at": "2026-11-12T16:02:51Z",
"updated_at": "2026-11-12T16:03:20Z"
},
{
"command_id": "cmd_501",
"battery_id": "bat_1",
"action": "charge",
"parameters": {
"allow_import": true,
"max_wh": 12000
},
"start": "2026-11-12T13:00:00Z",
"end": "2026-11-12T15:00:00Z",
"status": "completed",
"status_reason": null,
"batch_id": null,
"created_at": "2026-11-12T12:41:07Z",
"updated_at": "2026-11-12T15:00:04Z"
}
],
"next_cursor": null
}{
"type": "https://api.kapa.energy/problems/invalid-time-window",
"title": "Invalid time window",
"status": 400,
"code": "invalid_time_window",
"detail": "end must be after start.",
"invalid_params": [
{
"name": "end",
"reason": "must be after start"
}
]
}{
"type": "https://api.kapa.energy/problems/unauthorized",
"title": "Unauthorized",
"status": 401,
"code": "unauthorized",
"detail": "The access token has expired."
}{
"type": "https://api.kapa.energy/problems/battery-not-found",
"title": "Battery not found",
"status": 404,
"code": "battery_not_found",
"detail": "No battery with id bat_9 is accessible to this client."
}Authorizations
OAuth 2.0 client credentials. Obtain a token from POST /token.
Path Parameters
Battery identifier.
Query Parameters
Lower bound of the window (inclusive). Omitted means no lower bound.
RFC 3339 timestamp in UTC, with a Z suffix.
Pattern:
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$Example:
"2026-11-12T18:00:00Z"
Upper bound of the window (exclusive). Omitted means no upper bound.
RFC 3339 timestamp in UTC, with a Z suffix.
Pattern:
^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$Example:
"2026-11-12T18:00:00Z"
Opaque cursor from next_cursor of the previous page. Keep the other parameters unchanged.
Maximum number of commands per page.
Required range:
1 <= x <= 500