Skip to content

Temporal

The history of what devices have reported, as opposed to their current values. A series is one property of one device, identified by tags — deviceId, serviceId, and on array properties the element index, since each element is stored as its own point. Values come back as parallel t/v arrays rather than one object per point.

Current values come from the flake module, names, units and display formats for the raw ids from the schema module. Nothing here emits events — the recorded ones come from other modules, and live changes arrive as OBJECT_UPDATED over the websocket. Worked requests and responses: Historical Data.

POSTQuery historical series/api/v1/temporal/query
GETList stored series/api/v1/temporal/schema
POSTQuery recorded events/api/v1/temporal/events
GETRead one property's history/api/v1/temporal/devices/:deviceId/properties/:propertyId
POSTBulk-import history (migration)/api/v1/temporal/import

Query historical series

Reads many series at once — several properties, devices and services — with automatic downsampling toward maxPoints. The route chart views should use.

POST/api/v1/temporal/query

Body

NameDescription
propertiesarraystringThe properties in play: in a service listing their current values, added from depth 1; in a history query the ids to read — at least one, because every property is stored as its own series.
devicesarraystringoptionalRestrict to these devices. Omit for every device the caller may read.
servicesarraystringoptionalThe services in play: in a device listing the device's own services, added from depth 1; in a history query the service identifiers the read is narrowed to.
valueClassoptionalenumRestrict the read to one storage family. Omit to read whichever families hold the requested properties — a request covering both is answered by one statement per family and costs one extra scan. Set it only to rule a family out.
Possible values: numeric, text
fromintegeroptionalStart of the range, epoch milliseconds. Defaults to an hour before to.
min 0
tointegeroptionalRecipient address when sending a mail; on a history query the end of the range instead, in UTC epoch milliseconds, defaulting to now.
min 0
orderoptionalenumOutput order of each series.
Default: asc
Possible values: asc, desc
boundarybooleanoptionalAlso return each series' newest point before from, so a step-shaped chart can start at the window edge instead of at the first in-range sample. Requires an explicit devices list; series count and lookback are capped.
Default: false
boundaryLookbackintegeroptionalHow far before from the boundary scan may reach, in milliseconds. Size it from the property's lastUpdate when known; defaults and caps are server-side.
> 0
limitintegeroptionalMaximum points per series.
Default: 5000
> 0 · max 50000
maxPointsintegeroptionalTarget points per series. A range that would exceed it is bucketed automatically. Set to 0 to opt out and receive raw points.
Default: 2000
min 0
intervalintegeroptionalExplicit bucket width in milliseconds. Disables automatic downsampling.
> 0
fnoptionalenumHow points within a bucket are combined. Only meaningful with interval.
Possible values: avg, sum, min, max, count, first, last
groupByarrayoptionalTags that identify a series. Defaults to deviceId + serviceId + index; index matters because an array property writes one point per element.

Response

NameDescription
fromnumberStart of the range, epoch milliseconds. Defaults to an hour before to.
tonumberRecipient address when sending a mail; on a history query the end of the range instead, in UTC epoch milliseconds, defaulting to now.
intervalnumberoptionalExplicit bucket width in milliseconds. Disables automatic downsampling.
seriesarrayOne series: parallel arrays rather than one object per point.
mstringThe property this series belongs to.
Pattern: ^0x[0-9A-Fa-f]{4}$
keydictionaryTag values identifying the series. A tag the series carries no value for is omitted rather than sent as null, so groupBy bounds which keys can appear, not which ones do — index is present only on array properties, holding the element position. Values are strings even when they read as numbers.
typeenumHow to read v. A boolean series returns true/false, except when the request spans several storage types or aggregates, where it is 1/0.
Possible values: number, boolean, string
nintegerPoints matching before limit was applied — greater than t.length means truncated.
tarraynumberTimestamps in epoch milliseconds, index-aligned with v.
vValues, index-aligned with t.
Alternative 1arrayValues, index-aligned with t.
Alternative 2arrayValues, index-aligned with t.
Alternative 3arrayValues, index-aligned with t.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The query is malformed; message names the field to fix.message: string
400The query would scan more than the server allows — narrow the range, devices or properties; message names the knob to turn.message: string
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

List stored series

Which properties actually have stored history in this tenant, and how to read their values.

GET/api/v1/temporal/schema

Response

NameDescription
servicestringService the property belongs to.
propertystringProperty identifier in the form 0x00AB.
Pattern: ^0x[0-9A-Fa-f]{4}$
typeenumDiscriminator of the variant that follows — which answer a device gave, which second factor was enrolled, how a stored series is to be read. Read it before the fields beside it.
Possible values: number, boolean, string
declaredTypestringoptionalThe device's own type name — uint16, datetime, bool. Distinguishes what type cannot: a timestamp from a plain integer.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Query recorded events

Reads recorded events, newest first by default; filter by names, devices, services and range.

POST/api/v1/temporal/events

Body

NameDescription
namesarraystringoptionalRestrict to these event names.
devicesarraystringoptionalRestrict to these devices. Omit for every device the caller may read.
servicesarraystringoptionalThe services in play: in a device listing the device's own services, added from depth 1; in a history query the service identifiers the read is narrowed to.
fromintegeroptionalStart of the range, epoch milliseconds. Defaults to an hour before to.
min 0
tointegeroptionalRecipient address when sending a mail; on a history query the end of the range instead, in UTC epoch milliseconds, defaulting to now.
min 0
orderoptionalenumOutput order of each series.
Default: desc
Possible values: asc, desc
limitintegeroptionalMaximum points per series.
Default: 100
> 0 · max 10000

Response

NameDescription
namestringName of the addressed item — a block or template, a device method, a recorded event. A method name is limited to letters, digits, _ and -, because it becomes a segment of the message CRN.
attributesdictionaryFree-form attributes recorded with the event.
tagsdictionaryString tags identifying the event's origin.
timestampnumberWhen the event was recorded, UTC epoch milliseconds.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Read one property's history

One series, addressed by path, for the cases that need no body; from/to default to the last hour.

GET/api/v1/temporal/devices/Yk3pL7rWq2/properties/0x3030?order=asc&limit=5000&maxPoints=2000

Path Parameters

NameDescription
deviceIdstringThe device id, or its IMEI.
min length 1
propertyIdstringProperty id in canonical hexadecimal form, e.g. 0x0800.
Pattern: ^0x[0-9A-Fa-f]{4}$

Query Parameters

NameDescription
fromintegeroptionalStart of the range, epoch milliseconds. Defaults to an hour before to.
min 0
tointegeroptionalRecipient address when sending a mail; on a history query the end of the range instead, in UTC epoch milliseconds, defaulting to now.
min 0
orderoptionalenumOutput order of each series.
Default: asc
Possible values: asc, desc
limitintegeroptionalMaximum points per series.
Default: 5000
> 0 · max 50000
maxPointsintegeroptionalTarget points per series. A range that would exceed it is bucketed automatically. Set to 0 to opt out and receive raw points.
Default: 2000
min 0
intervalintegeroptionalExplicit bucket width in milliseconds. Disables automatic downsampling.
> 0
fnoptionalenumHow points within a bucket are combined. Only meaningful with interval.
Possible values: avg, sum, min, max, count, first, last

Response

NameDescription
fromnumberStart of the range, epoch milliseconds. Defaults to an hour before to.
tonumberRecipient address when sending a mail; on a history query the end of the range instead, in UTC epoch milliseconds, defaulting to now.
intervalnumberoptionalExplicit bucket width in milliseconds. Disables automatic downsampling.
seriesarrayOne series: parallel arrays rather than one object per point.
mstringThe property this series belongs to.
Pattern: ^0x[0-9A-Fa-f]{4}$
keydictionaryTag values identifying the series. A tag the series carries no value for is omitted rather than sent as null, so groupBy bounds which keys can appear, not which ones do — index is present only on array properties, holding the element position. Values are strings even when they read as numbers.
typeenumHow to read v. A boolean series returns true/false, except when the request spans several storage types or aggregates, where it is 1/0.
Possible values: number, boolean, string
nintegerPoints matching before limit was applied — greater than t.length means truncated.
tarraynumberTimestamps in epoch milliseconds, index-aligned with v.
vValues, index-aligned with t.
Alternative 1arrayValues, index-aligned with t.
Alternative 2arrayValues, index-aligned with t.
Alternative 3arrayValues, index-aligned with t.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
404No device with this identifier in the tenant.
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Bulk-import history (migration)

Temporary migration route: writes historical points in bulk, columnar per series. Nothing else writes history through the API — it is a by-product of devices reporting.

POST/api/v1/temporal/import

Body

NameDescription
deviceIdstringThe device id, or its IMEI.
min length 1
seriesarrayOne series: parallel arrays rather than one object per point.
serviceIdstringService the property belongs to.
min length 1
namestringProperty the series belongs to, as 0x00AB.
Pattern: ^0x[0-9A-Fa-f]{4}$
storageenumWhich storage table the points land in.
Possible values: float, int, bool
typestringoptionalHow to read v. A boolean series returns true/false, except when the request spans several storage types or aggregates, where it is 1/0.
min length 1
tarrayintegerTimestamps in epoch milliseconds, index-aligned with v.
varrayValues, index-aligned with t.

Response

NameDescription
pointsintegerPoints accepted and flushed to the store.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
404No device with this identifier in the tenant.
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50