New: the AI firewall watches every module and explains each incident in plain words. See how it works

LoRaWAN API

REST routes for LoRaWAN gateways, devices, keys, sessions, ABP counters, pairing mode, profile settings and the frames log, with permissions and answers.

This page lists the REST routes of Hermetry’s LoRaWAN network server in one place. Each topic has a page in the LoRaWAN section with the full field meanings; this page links to them. Paths are under https://<your host>/tenant/<tenantId>. Every answer of these routes is sent with Cache-Control: no-store.

Permissions

PermissionDefault roleAllows
iot_lorawan.gateways.readUserRead gateways and the network server address
iot_lorawan.gateways.manageAdminAdd, edit, disable and delete gateways, rotate their tokens
iot_lorawan.devices.readUserRead LoRaWAN devices, profile settings and pairing
iot_lorawan.devices.manageAdminAdd, edit and delete devices, set keys, end sessions, pairing
iot_lorawan.keys.readAdminReveal a device’s AppKey
iot_lorawan.frames.readUserRead the live frames log

Setup

GET /api/iot/lorawan/setup (gateways read) answers the network server address and the discovery address a Basics Station gateway needs, whether a tc.trust file is offered, and the region. Nothing secret. See Your network server address.

Gateways

MethodPathPermissionDoes
GET/api/iot/lorawan/gatewaysgateways readList: { data, total, canManage }
POST/api/iot/lorawan/gatewaysgateways manageAdd a Basics Station gateway: { gateway, token, stationConfig }
GET/api/iot/lorawan/gateways/{gatewayId}gateways read{ gateway, live, devicesHeard }
PATCH/api/iot/lorawan/gateways/{gatewayId}gateways managename, status (ACTIVE or DISABLED), latitude, longitude, altitude
DELETE/api/iot/lorawan/gateways/{gatewayId}gateways manageClose its connection, release its EUI, remove it
POST/api/iot/lorawan/gateways/{gatewayId}/credentialsgateways manageNew token: { gateway, token, stationConfig }

The list takes page (from 0), pageSize, search, sort (name, eui, protocol, mode, status, region, lastSeen, createdAt; default name:asc) and the filters protocol, mode, status, region, deviceId, online.

Create body:

{ "eui": "AA555A0000000101", "name": "Roof gateway", "latitude": 41.0151, "longitude": 28.9795, "altitude": 45 }

eui is required (16 hexadecimal characters; dashes, colons and spaces are ignored), name 1 to 128 characters. The protocol defaults to Basics Station, the mode to cloud and the region to EU868, the only region offered. The token is in this answer only. Licensed routers are not added here: they switch to cloud mode on their own panel, see Licensed routers as LoRaWAN gateways. Rotating the token of a gateway without one is refused: “This gateway does not use a token.” See Add a gateway and Gateway credentials, disable and delete.

Devices

MethodPathPermissionDoes
GET/api/iot/lorawan/devicesdevices readList: { data, total, canManage }
POST/api/iot/lorawan/devicesdevices manageAdd an OTAA or ABP device (201 { device })
GET/api/iot/lorawan/devices/{deviceId}devices read{ device }: the record and its live session, never a key
PATCH/api/iot/lorawan/devices/{deviceId}devices managename, joinEui, appKey, macVersion, class, anyJoinEui, codecId; for ABP devAddr, nwkSKey, appSKey together
DELETE/api/iot/lorawan/devices/{deviceId}devices manageRemove the device, its sessions and its DevEUI claim
POST/api/iot/lorawan/devices/{deviceId}/keykeys readReveal the AppKey: { appKey }; every call is audited
DELETE/api/iot/lorawan/devices/{deviceId}/sessiondevices manageEnd the session; the device must join again
DELETE/api/iot/lorawan/devices/{deviceId}/countersdevices manageReset an ABP device’s frame counters
POST/api/iot/lorawan/devices/{deviceId}/approvedevices manageApprove a device that pairing mode added

The list takes page (from 0), pageSize, search, sort (name, devEui, macVersion, class, createdAt; default createdAt:desc), and the filters macVersion, class and joinState (joined, refused, never).

Add an OTAA device

{
  "name": "Cold room 3",
  "devEui": "1122334455667701",
  "appKey": "2B7E151628AED2A6ABF7158809CF4F3C",
  "joinEui": "0000000000000000",
  "macVersion": "1.0.3",
  "class": "A",
  "codecId": "auto",
  "anyJoinEui": false
}

Only name, devEui and appKey are required; the rest shows the defaults. macVersion is 1.0.2, 1.0.3 or 1.0.4; class is A or C. The answer never carries the AppKey, only hasAppKey: true. A new AppKey resets the device’s join nonce history. See Add an OTAA device.

Add an ABP device

{
  "name": "Water meter 12",
  "activation": "ABP",
  "devEui": "1122334455667712",
  "devAddr": "26011F3A",
  "nwkSKey": "…32 hexadecimal characters…",
  "appSKey": "…32 hexadecimal characters…"
}

An ABP body with an appKey, or an OTAA body with session keys, is refused. See Add an ABP device.

Profile settings and pairing

MethodPathPermissionDoes
GET/api/iot/lorawan/profiles/{profileId}/settingsdevices read{ settings } of the profile’s LoRaWAN tab
PUT/api/iot/lorawan/profiles/{profileId}/settingsdevices manageChange them; sharedAppKey is write-only
GET/api/iot/lorawan/profiles/{profileId}/pairingdevices read{ pairing }: the window and the devices it added
POST/api/iot/lorawan/profiles/{profileId}/pairingdevices manage{ "minutes": 1–120 } opens the window, or moves its end
DELETE/api/iot/lorawan/profiles/{profileId}/pairingdevices manageClose the window now

The settings fields, including those only the API sets, are listed in LoRaWAN device profiles. Pairing is explained in Pairing mode and Approving paired devices.

Frames log

GET /api/iot/lorawan/frames?deviceId={deviceId}&gatewayId={gatewayId}&limit=200

{ frames }: your recent frames, newest first, from a short live log that is not stored. A dropped frame of a device of another organisation shows only its reason. See The frames log.

  • Application downlinks are commands with the method lora.downlink: { "fPort": 1–223, "data": "<hex or base64>", "confirmed": false }, sent with the Commands API. See Downlinks.
  • Codecs have their own routes: Codec API.

Refusals

LoRaWAN refusals carry plain messages, for example “A Basics Station gateway always runs in cloud mode.”, “This gateway does not use a token.” or a key that is not 32 hexadecimal characters. Field rules that fail are a 400 with issues. See Errors and rate limits.