For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

The APIs, scripting runtime, and notations for working with akenza programmatically.

This section is the technical detail behind the rest of the documentation: the interfaces for reaching akenza from your own code, the runtime your scripts execute in, and the notations used in the interface.

Reaching akenza from your own code

The two answer different questions. The REST API is for asking what the state is, or for changing it: reading device data over a period, creating devices, managing a fleet from your own system. The WebSocket API is for being told when something arrives, so a client reacts to an uplink rather than checking for one.

Both are scoped to an organization and authenticated with credentials issued there.

API keys

Writing scripts

Scripting covers the JavaScript runtime that akenza executes as part of a data flow, in three places:

  • An uplink decoder turns a raw device payload into structured, readable data.

  • A downlink encoder turns a readable command back into the format a device expects.

  • A custom logic block evaluates logic in the rule engine to decide whether an action should fire.

All three implement the same consume(event) entry point and emit their result, so the shape of a script is the same wherever it runs.

Each execution loads the script fresh, so variables do not survive from one run to the next. Anything that has to persist between uplinks belongs in stateful operations.

Notations

Page
What it covers

The {{ }} syntax for inserting sample data and metadata into output connector payloads and rule actions, such as putting a measured value into an email subject.

The DateMath notation behind absolute, relative, and predefined time ranges.

Working with stored data

Several reference pages concern the data akenza has stored rather than the devices that sent it:

Page
What it covers

Reading measurements back, including the aggregations used for occupancy.

Narrowing what an API call returns.

How akenza derives the structure and measurement types of incoming data.

Obtaining and using a token for API requests.

Last updated

Was this helpful?