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

Codecs API

Read, test, publish and delete LoRaWAN codecs over the API – routes, permissions, caching, rate limits and error codes.

The codecs API serves the codec library and your own codecs to people, scripts and licensed routers. Use it to keep codecs in version control, to publish them from a pipeline, or to test payloads from your own tools.

Paths below follow the usual form https://<your host>/tenant/<tenantId>/api/…. Send an API key as Authorization: Bearer <API key>. See REST API basics.

Routes

Method and pathPermissionAnswer
GET /api/iot/lorawan/codecsOptional (see below)The codec index: { version, scope, codecs: [...], sig: null }
GET /api/iot/lorawan/codecs/<codecId>OptionalOne codec: { id, rev, sha256, scope, document, outputSet }
GET /api/iot/lorawan/codecs/bundleOptionalEvery codec with its document, compressed: { version, codecs: [{ id, rev, sha256, scope, document }] }
GET /api/iot/lorawan/codec-libraryView codecsThe list the codecs drawer shows (paged, sortable, both sources)
POST /api/iot/lorawan/codecsManage codecsPublish a new codec (201)
PATCH /api/iot/lorawan/codecs/<codecId>Manage codecsPublish a new revision of your codec
DELETE /api/iot/lorawan/codecs/<codecId>Manage codecsDelete your codec
POST /api/iot/lorawan/codecs/<codecId>/testView codecsDecode one frame with a saved codec
POST /api/iot/lorawan/codecs/testView codecsCheck a codec document and optionally decode one frame; nothing is stored
GET /api/iot/lorawan/codecs/<codecId>/revisionsView codecsThe codec’s revisions

“View codecs” is the permission to view LoRaWAN codecs and run the test bench (users by default). “Manage codecs” is the permission to add, change and delete your own codecs (administrators by default).

Who sees what on the three read routes

Credential sentAnswer
NoneThe public library only. Cached for 5 minutes (Cache-Control: public, max-age=300).
A valid session or API key with the view permissionThe library plus your organisation’s codecs. Not cached (private, no-store).
A licensed router’s signed requestThe library plus the codecs of the router’s organisation.
A credential that is present but wrong (bad header, expired session, unknown key)401 with invalid_credentials, signature_expired or certificate_revoked. Never the public list.
A valid credential without the permission403

Filters and caching

The index takes q (search), vendor, model, oui, fport and scope. Each answer carries an ETag equal to the index version; send it back in If-None-Match to get 304 Not Modified when nothing changed.

GET …/codecs/<codecId>?sha256=<fingerprint> asks for one exact revision. A withdrawn codec answers 410 (codec_withdrawn).

Publish a codec

POST /tenant/<tenantId>/api/iot/lorawan/codecs
Content-Type: application/json

{ "document": { "id": "t.room-sensor", "title": "…", "vendor": "…", "kind": "layout", "frames": [ … ], "tests": [ … ] } }

Or copy a library codec:

{ "copyOf": "<library codec id>", "id": "t.my-copy" }

The answer is 201 { codec, indexVersion }. Library codecs cannot be changed or deleted through these routes: 403 codec_read_only.

Test a frame

POST /tenant/<tenantId>/api/iot/lorawan/codecs/t.room-sensor/test
Content-Type: application/json

{ "fport": 2, "hex": "0BC4010A32" }

fport is 1–255 and hex at most 255 bytes. An invalid frame answers Enter the FPort (1-255) and the payload as hexadecimal digits (at most 255 bytes).

Rate limits

CallerLimit
No credential: index and single codec60 requests a minute per address
No credential: bundle6 an hour per address
Signed-in users and API keys240 a minute; bundle 30 an hour
Licensed routers120 a minute per device certificate

Beyond a limit the API answers 429 (Too many requests. Try again later.).

Error codes

Statusdetails.reasonMeaning
404—Codec not found.
409codec_existsA codec with this id already exists. Choose another id.
410codec_withdrawnThis codec revision was withdrawn.
403codec_read_onlyLibrary codecs are not edited here: save a copy and change the copy.
422codec_format_not_supportedA JavaScript decoder was sent.
422codec_tests_failedTest vectors failed; the failing vectors are listed.
422codec_incompatibleThe new revision removes keys or changes units.
422codec_model_claimedAnother of your codecs covers this model.
422codec_choice_unknown(When a device or profile chooses a codec) the codec does not exist or was withdrawn.
401invalid_credentialsThe credentials sent with this request are not valid.

For the full LoRaWAN API (gateways, devices, keys, pairing, frames), see the LoRaWAN API.