The /peers/* endpoint is a dynamic dispatcher that lets you invoke any peers method through HTTP. It is the bridge between the REST world and the full peers API — instead of writing one HTTP route per method, the gateway parses the URL and forwards the call to the corresponding peers module.
This means every method documented in the peers reference is reachable through /peers/* without any extra setup.
/peers/{peer}/{module}/{method}
| Segment | Description | Typical value |
|---|---|---|
peer |
Target peer name on the mesh | supervision (the main gateway process — almost always this) |
module |
Module exposed by the peer | gateways, loggers, system, accounts, logics |
method |
Method to call on the module | writeValue, getLastValue, getGateways, … |
Example — write a value to a KNX address:
curl -b cookies.txt -X POST \
-H 'Content-Type: application/json' \
-d '{"args":["4/7/25",1]}' \
'https://gateway.example.com/peers/supervision/gateways/writeValue'
This is exactly equivalent to calling gateways.writeValue('4/7/25', 1, callback) from a peers client.
Each call is checked against the role of the account: a method the role does not allow answers 403 with { "err" : "Forbidden" }.
The dispatcher calls the method with positional arguments. There are three ways to pass them.
args parameterIn a POST, put the arguments in a JSON array named args. This is the recommended form: it works for every method, and numbers, booleans and objects keep their type.
# gateways.getLastValue('4/7/25', callback)
curl -b cookies.txt -X POST \
-H 'Content-Type: application/json' \
-d '{"args":["4/7/25"]}' \
'https://gateway.example.com/peers/supervision/gateways/getLastValue'
# gateways.writeValue('4/7/25', 1, callback)
curl -b cookies.txt -X POST \
-H 'Content-Type: application/json' \
-d '{"args":["4/7/25",1]}' \
'https://gateway.example.com/peers/supervision/gateways/writeValue'
In a GET, each args parameter of the query string is one argument, always passed as a string. A JSON array is not decoded here: use a POST for anything other than strings.
# gateways.getLastValue('4/7/25', callback)
curl -b cookies.txt -G 'https://gateway.example.com/peers/supervision/gateways/getLastValue' \
--data-urlencode 'args=4/7/25'
POST with a JSON bodyWithout args, a POST body is passed as the single argument of the method. Use it for methods that take one object.
# gateways.insertRoute(route, callback)
curl -b cookies.txt -X POST \
-H 'Content-Type: application/json' \
-d '{"name":"KNX to Modbus","source":{"address":"4/7/25"},"destination":{"address":"%M1"},"direction":"right","active":true}' \
'https://gateway.example.com/peers/supervision/gateways/insertRoute'
Segments after the method name become positional arguments. They are always strings, and a slash inside an argument must be encoded as %2F.
# gateways.getLastValue('4/7/25', callback)
curl -b cookies.txt 'https://gateway.example.com/peers/supervision/gateways/getLastValue/4%2F7%2F25'
The default response is a JSON envelope:
{ "result_field" : "..." }
On error:
{ "err" : "error message" }
?format=jsonForce standard JSON output. Use this when your client is a strict JSON parser that does not handle the few peers-specific extensions (Buffer, Date, …).
?format=json-no-evalSame as format=json but encodes types in a way that does not require any post-processing on the consumer side. Recommended for cross-language clients.
?streaming=1Some peers methods invoke their callback multiple times as a stream — loggers.query is the canonical example. When you call them through /peers/*, set streaming=1 to receive an NDJSON response: each chunk of data becomes one line, terminated by \r\n.
curl -b cookies.txt -N \
'https://gateway.example.com/peers/supervision/loggers/query?streaming=1' \
-H 'Content-Type: application/json' \
-d '{
"address" : "4/7/25",
"start" : "2026-04-07T00:00:00Z",
"end" : "2026-04-08T00:00:00Z",
"aggregate" : "15m"
}'
For loggers.query specifically, the dispatcher emits a JSON array ([, then each row separated by ,, then ]) instead of NDJSON — this matches what most cloud consumers expect.
If the exact method name does not exist on the target module, the dispatcher tries a few common prefixes based on the HTTP verb:
| HTTP method | Prefix tried |
|---|---|
GET |
get<Method> |
POST |
insert<Method> |
So GET /peers/supervision/gateways/Gateway?args=12 resolves to gateways.getGateway even though there is no method called Gateway. This is mostly useful when wiring the dispatcher behind a RESTful URL scheme — you don't have to encode the verb prefix in the URL.
If neither the literal name nor the prefixed variants match, the response is 400 with { "err": "Unknown method ..." }.
# gateways.writeValue
POST /peers/supervision/gateways/writeValue
Body: {"args":["4/7/25",1]}
# gateways.getLastValue
GET /peers/supervision/gateways/getLastValue?args=4/7/25
# gateways.readValue
GET /peers/supervision/gateways/readValue?args=4/7/25
# gateways.getGateways
GET /peers/supervision/gateways/getGateways
# gateways.getAddressesByGateway
POST /peers/supervision/gateways/getAddressesByGateway
Body: {"args":[12]}
# gateways.insertRoute
POST /peers/supervision/gateways/insertRoute
Body: {"name":"KNX to Modbus","source":{"address":"4/7/25"},"destination":{"address":"%M1"},"direction":"right","active":true}
# gateways.restartGateway
POST /peers/supervision/gateways/restartGateway
Body: {"args":[12]}
# loggers.query — set streaming=1
POST /peers/supervision/loggers/query?streaming=1
Body: {"address":"4/7/25","start":"...","end":"...","aggregate":"15m"}
For high-volume queries, prefer the dedicated /loggers/data endpoint which has been optimized for federation across multiple connectors.
| Use case | Best choice |
|---|---|
| Historical queries with site federation | /loggers/data |
| Live value subscriptions | /loggers/live |
| Pushing writes from the cloud | /loggers/function |
| Anything else (gateways, addresses, routes, system, accounts, …) | /peers/* dispatcher |
The dedicated endpoints are tuned for cloud federation and high throughput. The dispatcher is the catch-all for everything else — it gives you the entire peers surface without needing a per-method REST route.