The resource API gives REST-style URLs to the most used peers methods: GET /peers/api/supervision/gateways instead of a call to gateways.getGateways. Every route is described in an OpenAPI document that the gateway serves with an interactive reference. The same family of URLs also carries a live event stream (Server-Sent Events) at /peers/api/events.
Use it from any HTTP client: scripts, building management systems, low-code tools. For the generic /peers/{peer}/{module}/{method} dispatcher, see Peers dispatcher; for historical data, see Loggers.
https://<device>/peers/api/<peer>/<module>/<resource>[/<key>][/<action>]
| Part | Example | Meaning |
|---|---|---|
<peer> |
supervision, network, tinc |
The process that runs the module |
<module> |
gateways, system, accounts, loggers, logics, usb, api |
The module, as in the peers API |
<resource> |
addresses, routes, informations |
The resource |
<key> |
125, Room%20temperature |
Id or name of one object (see 3.1) |
<action> |
start, read, cacheValue |
An action on that object |
Each route is mapped to one peers method. For example:
| HTTP | Peers method |
|---|---|
GET /peers/api/supervision/gateways |
gateways.getGateways() |
GET /peers/api/supervision/gateways/{gateway_key} |
gateways.getGateway(key) |
POST /peers/api/supervision/gateways/{gateway_key}/restart |
gateways.restartGateway(key) |
GET /peers/api/supervision/gateways/addresses/{address_key}/cacheValue |
gateways.getLastValue(key) |
GET /peers/api/supervision/system/informations |
system.getInformations() |
The method behind each route is the one documented on the peers pages (gateways, system, accounts, logics, loggers): arguments, results and errors are the same.
Each device serves the full list of routes:
| URL | Content |
|---|---|
https://<device>/api/docs |
Interactive reference (Swagger UI), with a Try it out button on each route |
https://<device>/api/api.json |
The OpenAPI 3 document, to import in Postman, Insomnia or a code generator |
The reference lists about 210 routes. It is the authoritative list for the revision installed on the device; this page explains how to use them.
Some request bodies in the reference show no schema. In that case, the body is the argument of the peers method named in the route description: see the matching peers page.
The resource API uses the same authentication as the rest of the REST API (see Authentication):
POST /auth/rest;X-API-Key: wbx_...;curl -u 'user:password').A route runs with the rights of the account, like the peers method it calls. Without a session the answer is 401; when the role of the account does not allow the method, the answer is 403 with { "err" : "Forbidden" }.
Give each integration its own account with a role restricted to what it needs (for example read-only on gateways and loggers), and its own API key. See Accounts.
curl -H 'X-API-Key: wbx_...' https://gateway.example.com/peers/api/supervision/system/informations
| Parameter | Value |
|---|---|
{gateway_key} |
Id of the gateway, or its name |
{address_key} |
Id of the address, its name, or <gateway id or name>¬<address name> |
{route_id}, {view_id}, {function_id}, {account_id}, {crash_id} |
Id of the object |
Encode the value as a URL path segment. A / inside a name (a KNX group address, for instance) must be sent as %2F, a space as %20, ¬ as %C2%AC:
# Last value of the address named 4/7/25
curl -b cookies.txt https://gateway.example.com/peers/api/supervision/gateways/addresses/4%2F7%2F25/cacheValue
PATCH /peers/api/supervision/gateways/{gateway_key} needs the numeric id of the gateway; a name is refused with Invalid gateway id.
In a GET request, send each query value as JSON, URL-encoded:
address="4/7/25";address=["4/7/25","4/7/26"];start=1732492800000, before=true.curl -G -b cookies.txt https://gateway.example.com/peers/api/supervision/loggers/query \
--data-urlencode 'address=["4/7/25","4/7/26"]' \
--data-urlencode 'start=1732406400000' \
--data-urlencode 'end=1732492800000'
curl -G --data-urlencode does the URL encoding for you.
Send the body as JSON with Content-Type: application/json.
POST /peers/api/supervision/gateways takes the gateway to insert, PATCH /peers/api/supervision/gateways/addresses takes the address to update (with its id)./gateways/{gateway_key}, /accounts/{account_id}, /accounts/{account_id}/password): the id is taken from the path when the body has none.# Rename gateway 12 (the gateway restarts, see gateways.updateGateway)
curl -b cookies.txt -X PATCH https://gateway.example.com/peers/api/supervision/gateways/12 \
-H 'Content-Type: application/json' \
-d '{"name":"KNX first floor"}'
For methods that take several arguments, such as writing a value, the peers dispatcher with its args array is the simplest way: see Write a value.
The reference at /api/docs groups the routes by tag. The main routes of each family:
| Family | Main routes | Peers module |
|---|---|---|
| Session | GET /peers/api/session/account (my account), GET /peers/api/session/permissions (rights of my role) |
— |
| Accounts | GET /supervision/accounts, POST /supervision/account, PATCH /supervision/accounts/{account_id}, PATCH /supervision/accounts/{account_id}/password, DELETE /supervision/accounts/{account_id} |
accounts |
| Gateways | GET /supervision/gateways, GET /supervision/gateways/light, GET /supervision/gateways/{gateway_key}, POST /supervision/gateways, PATCH and DELETE /supervision/gateways/{gateway_key}, POST /supervision/gateways/{gateway_key}/start /stop /restart /test, GET /supervision/gateways/{gateway_key}/stats /schema |
gateways |
| Addresses | GET /supervision/gateways/addresses, GET /supervision/gateways/{gateway_key}/addresses, GET /supervision/gateways/addresses/{address_key}, GET …/{address_key}/cacheValue (last known value), GET …/{address_key}/read (asks the driver), POST /supervision/gateways/addresses, PATCH /supervision/gateways/addresses, POST /supervision/gateways/addresses/import, DELETE …/{address_key} |
gateways |
| Routes | GET /supervision/gateways/routes, GET /supervision/gateways/routes/{route_id}, POST /supervision/gateways/routes/insert, PATCH …/routes/{route_id}/update, POST …/routes/{route_id}/delete, GET /supervision/gateways/routes/status, POST /supervision/gateways/routes/pause /resume |
gateways |
| Routing functions | GET /supervision/gateways/routing-functions, POST …/routing-functions/insert, POST …/routing-functions/{function_id}/update /rename /delete |
gateways |
| Views | GET /supervision/gateways/views, POST …/views/insert, POST …/views/{view_id}/start /stop |
gateways |
| Loggers | GET /supervision/loggers, GET /supervision/loggers/query |
loggers |
| System | GET /supervision/system/informations, GET /supervision/system/uptime /freemem /totalmem /cpus /loadavg, GET /supervision/system/serial-ports, GET /supervision/system/network-interfaces, GET and POST /supervision/system/date, GET /supervision/system/firmware-revision /supervision-revision, POST /supervision/system/reboot /reload |
system |
| Logics | GET /supervision/logics/getLogics, GET /supervision/logics/getLogic, POST /supervision/logics/startLogic /stopLogic /restartLogic |
logics |
| USB | GET /supervision/usb/getDevices |
usb |
| Network | GET /network/api/getConfig, GET /network/api/getInterfaces, POST /network/api/extendConfig, POST /network/api/restart |
network |
| Tinc | GET /tinc/api/getInfo, GET /tinc/api/getTunnels |
tinc (VPN) |
| Events | GET /peers/api/events |
see 6 |
All paths in the table start with /peers/api (left out for readability). Routes named after a method (…/logics/getLogics) call that method directly, like the dispatcher.
The Network routes change the IP configuration of the device. A wrong setting can make the device unreachable: test on a device you can reach on site.
| Case | Status | Body |
|---|---|---|
| Success | 200 |
The result of the peers method, as JSON |
| Error returned by the method, unknown method, bad parameter | 400 |
{ "err" : "…" } |
| No session | 401 |
{ "err" : "You must be connected to access to the REST API" } |
| Role does not allow the method | 403 |
{ "err" : "Forbidden" } |
The format parameter of the dispatcher (json, json-no-eval) also works here: see Response formats.
GET /peers/api/events?event=/<peer>/<module>/<event name>[&event=…]
event is mandatory and can be repeated to listen to several events on the same connection.400 with { "err" : "no event set" }.newValue 125 becomes newValue%20125. Use the address id in such names (a name containing / would add segments).The event names are those of the modules, listed on the peers pages, for example in gateways › Events:
event value |
Sent when | Data |
|---|---|---|
/supervision/gateways/newValue |
Any address gets a new value | [id, value, value_string, value_date] |
/supervision/gateways/newValue%20125 |
Address 125 gets a new value | [value, value_string, value_date] |
/supervision/gateways/newStatus |
The status of an address changes | [id, status, status_date] |
/supervision/gateways/routeWrite |
A route writes a value | [routeId, sourceId, destinationId, origin, value] |
The response has Content-Type: text/event-stream and stays open. Each event is:
event: /supervision/gateways/newValue
data: [125,21.5,"21.5",1732520410123]
event: repeats the event value you asked for;data: is a JSON array with the arguments of the event;:heartbeat is sent every 30 seconds to keep the connection open;event: error with data: failed to get <event>:<reason>.The listeners are removed when the client closes the connection.
curl -N -H 'X-API-Key: wbx_...' \
'https://gateway.example.com/peers/api/events?event=/supervision/gateways/newValue&event=/supervision/gateways/newStatus'
From a browser page served by the device (the session cookie is sent automatically):
var es = new EventSource('/peers/api/events?event=/supervision/gateways/newValue')
es.addEventListener('/supervision/gateways/newValue', function(e){
var args = JSON.parse(e.data) // [id, value, value_string, value_date]
console.log('address', args[0], '=', args[1])
})
newValuewithout a key sends every value change of the device. On a device with many addresses, listen tonewValue <id>for the addresses you need.
GET /peers/api/supervision/loggers/query calls loggers.query with the query parameters: address (one key or a JSON array), start and end (milliseconds since 1970), and optionally aggregate, fill, limit, before, after, anchor. See loggers.query for their meaning.
For historical data over HTTP, the dedicated endpoint GET /loggers/data is the recommended choice: it streams the rows line by line.
| Need | Use |
|---|---|
| Common objects (gateways, addresses, routes, accounts, system information) with readable URLs and an OpenAPI description | Resource API /peers/api/* |
| Any peers method, including methods with several arguments | Peers dispatcher /peers/{peer}/{module}/{method} |
| Historical data | /loggers/data |
| Live values over HTTP | /peers/api/events (events) or /loggers/live (values of chosen addresses) |
| Many calls and events in one connection | Peers API over WebSocket |
| Symptom | Cause and fix |
|---|---|
401 on every call |
No session: log in with POST /auth/rest and keep the cookie, or send X-API-Key |
403 { "err" : "Forbidden" } |
The role of the account does not include the method behind the route: check the role in Administration › Access |
400 with an error that mentions getAddress |
The key in the path is wrong or not encoded: encode / as %2F, or use the address id |
400 Invalid gateway id on PATCH /gateways/{gateway_key} |
Use the numeric id of the gateway, not its name |
400 { "err" : "no event set" } on /peers/api/events |
Each event value needs three segments: /supervision/gateways/newValue |
| The SSE stream stops after a while behind a proxy | The proxy buffers or times out the response: disable buffering for text/event-stream and allow long-lived connections; the device sends a heartbeat every 30 s |