This article provides the stream event schema for policies managed in Policy Foundry. Use it as a reference for the data you can expect in a policy event when a policy's action is set to a stream.
Note: The emitted payload schema is owned by the platform's event pipeline and isn't fully verifiable from the application itself. Validate the complete field list and types against the platform event schema before relying on them. Items flagged below need engineering confirmation.
About events
- Generic metadata: appears on every event used for actions.
- Condition-specific metadata: appears on every event, and varies by condition.
Generic metadata
This metadata is consistent across all events.
| Field | Type | Description |
|---|---|---|
| companyId | string | ID of the company (account) |
| name | string | Name of the policy set in Policy Foundry |
| policyId | string | ID of the policy |
| timestamp | string | Event date and time |
| properties | object | Mapping of policy event properties |
Properties by triggered condition
Common to all event types: roomId — current room ID of the device.
| Condition group | Condition | Event type | Event data |
|---|---|---|---|
| Telemetry | Temperature | temperature |
threshold — max/min allowed temperature defined by the condition; trackingId — tracking ID of the measuring device; temperature — current temperature reading |
| Telemetry | Air Quality | air_quality |
threshold — max/min allowed air quality index defined by the condition; trackingId — tracking ID of the measuring device; airQuality — current air quality index (0–255) |
| Telemetry | Humidity | humidity |
threshold — max/min allowed humidity defined by the condition; trackingId — tracking ID of the measuring device; humidity — current relative humidity (0–100%) |
| Occupancy | Room Occupancy | room_occupancy |
occupancyLimit — max/min allowed count of people in the room defined by the condition; occupancy — current count of people in the room |
| Beacon Signals | Battery level | battery_level |
threshold — max/min allowed battery level defined by the condition; trackingId — tracking ID of the device; batteryLevel — current reported battery level |
| Beacon Signals | Button click — Default (Blue) or Second (Red) | button_click |
trackingId — tracking ID of the device |
| Positions | Exit location | location_exit |
trackingId — tracking ID of the device |
| Positions | Enter location | location_entry |
trackingId — tracking ID of the device |
Beacon Signals event data
Event data is the payload of a triggered event for a Beacon Signals condition set in a policy.
Button click event
| Field | Type | Description |
|---|---|---|
| body | object | |
| event | object | Generic metadata of the event. |
| companyId | string | ID of the account |
| name | string | Name of the policy |
| policyId | string | ID of the policy |
| timestamp | string | Event timestamp in ISO 8601 extended format, with fractions of a second and the time zone indicator. Date: 2023-10-12 (YYYY-MM-DD); Time: 13:35:48.661193515 (HH:MM:SS.SSSSSSSSS); Time zone: Z (Zulu time, equivalent to UTC). |
| properties | object | Condition-specific metadata of the policy event |
| floorId | integer | ID of the floor (Smart Location) |
| buildingName | string | Name of the building (Smart Location) |
| buttonClickType | string | Identifies the button that triggered the event: second_button (red) or default_button (blue) |
| campusName | string | Name of the campus (Smart Location) |
| deviceAlias | string | Device Notes field data (Device Management) |
| campusId | integer | ID of the campus (Smart Location) |
| floorName | string | Name of the floor (Smart Location) |
| roomId | integer | ID of the room (Smart Location) |
| roomName | string | Name of the room (Smart Location) |
| trackingId | string | MAC address of the device (Device Management) |
| buildingId | integer | ID of the building (Smart Location) |
| channelId | string | Mapping of the unique stream configuration |
| action | object | |
| configurationId | string | |
| actionName | string | |
| rateLimiters | array [object] | |
| number | integer | |
| duration | integer | |
| offset | string | |
| sequenceNumber | integer | |
| enqueuedTimeUtc | string | Timestamp in UTC format |
| systemProperties | object | Empty object |
Example: button click
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Red Button Click",
"policyId": "6526e1b7c14fa91a6c12b59c",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"buttonClickType": "second_button",
"campusName": "Demo Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
},
"channelId": "1116ddcf277bb802291fc794",
"action": {
"configurationId": "1116ddcf277bb802291fc794",
"actionName": "firehose",
"rateLimiters": [
{
"number": 1000,
"duration": 1
}
]
}
},
"offset": "792",
"sequenceNumber": 9,
"enqueuedTimeUtc": "2023-10-12T13:35:51.924Z",
"systemProperties": {}
}Battery level
Device battery level as a percentage (%).
Example: battery level
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Battery Level below 25",
"policyId": "6526e1b7c14fa91a6c12b59d",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"batteryLevel": 20,
"threshold": 25,
"campusName": "Demo Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
}
}
}Telemetry
Temperature
Temperature reading in Celsius.
Example: temperature
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Temperature Above 75",
"policyId": "6526e1b7c14fa91a6c12b59e",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"temperature": 80,
"threshold": 75,
"campusName": "Demo Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
}
}
}Humidity
Humidity reading as a percentage (%).
Example: humidity
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Humidity Above 45",
"policyId": "6526e1b7c14fa91a6c12b59f",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"humidity": 55,
"threshold": 45,
"campusName": "Demo Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
}
}
}Air quality
Index from 0 to 255. The higher the value, the worse the air pollution.
Example: air quality
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Air Quality Above 75",
"policyId": "6526e1b7c14fa91a6c12b5a0",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"airQuality": 125,
"threshold": 75,
"campusName": "Demo Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
}
}
}Positions
A Positions event (location_entry or location_exit) carries the device trackingId and the common location fields. The structure below is presented conservatively from the documented property set.
Example: enter location
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Enter Room A101",
"policyId": "6526e1b7c14fa91a6c12b5a1",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"campusName": "Demo Campus",
"deviceAlias": "John S Badge",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
}
}
}Occupancy
Example: occupancy
{
"body": {
"event": {
"companyId": "9b145841a575",
"name": "Occupancy Above 20",
"policyId": "6526e1b7c14fa91a6c12b5a2",
"timestamp": "2023-10-12T13:35:48.661193515Z",
"properties": {
"floorId": 303425,
"buildingName": "Demo Building",
"occupancy": 22,
"occupancyLimit": 20,
"campusName": "Demo Campus",
"campusId": 219607,
"floorName": "Floor 1",
"roomId": 357173,
"roomName": "Room A101",
"trackingId": "00:sa:t6:03:e1:43",
"buildingId": 303380
}
}
}
}