Download OpenAPI specification:Download
This service provides a layer of abstraction on top of the Density data APIs.
It is intended for use by the general public.
time_used_raw is raw detected occupancy time in milliseconds. For human-readable reporting,
convert to hours with time_used_raw / 1000 / 3600. Example: 2421000 ms is about 40 minutes.
time_used_percentage is the share of the requested time bucket that registered occupancy,
represented from 0 to 1.
utilization is occupancy divided by space capacity. If capacity is 0, utilization values are
returned as 0. If capacity is not set, utilization returns null. Confirm capacity on /v3/spaces
before relying on utilization.
is_capped and capped_count_limit indicate that a sensor hit its hardware detection ceiling.
For Waffle sensors, counts are capped at 3+; always check is_capped before treating a peak count
as exact.
up_time is the ratio of the requested time bucket where the sensor was online and able to provide
data. Use low up_time as a data-quality warning.
Saturation is a reporting concept, but it is not a public-api response field. If you use saturation in customer reporting, treat it as a derived metric rather than an API field.
Metrics and Raw Sessions are processed differently. Compare these endpoints when investigating
anomalies, especially for Waffle spaces where metrics can show small amounts of time_used even
when Raw Sessions does not show a meaningful occupied session.
v3 analytics and resource endpoints do not expose pagination parameters. Use endpoint-specific filters and date windows to keep responses manageable.
Public API traffic is rate-limited at the edge to 15 requests per second per IP, with a burst allowance of 100 requests. Some endpoints may also return rate-limit headers when application-level quota middleware applies.
Lists the percentage of completeness of floor data over the specified time period from [0-1]. Data Status API is available for floors with Open Area Sensors. With this information, you can determine whether historical metric data is ready to pull for the floor and spaces on the floor during the requested time period. For more information on how to interpret this data see: https://developers.density.io/understand_historical_data.
Request body input.
success
{- "end_date": "2024-06-28T23:59:59Z",
- "floor_ids": [
- "spc_12345678901",
- "spc_10987654321"
], - "start_date": "2024-06-28T00:00:00Z"
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/FloorHealthDataV3"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/FloorHealthDataV3"
}
}Calculates the occupancy, utilization and time used metrics for a set of spaces or for all spaces in a portfolio.
Operating hours: operating_hours.days uses 0 = Sunday, 1 = Monday, 2 = Tuesday,
3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday. start_hour and end_hour
are 24-hour integers. Example Mon-Fri 8 AM-6 PM:
{"days":[1,2,3,4,5],"start_hour":8,"end_hour":18}.
Common pitfalls:
time_used_raw is milliseconds; divide by 3,600,000 to get hours.utilization_avg and utilization_max require capacity. If capacity is 0,
the API returns 0; if capacity is not set, utilization returns null.up_time is a data-quality signal. Low up_time means the bucket may be incomplete.space_ids are flattened by analytics handlers. In practice, a building or floor
request can return descendant spaces rather than one rolled-up parent row.request body input
success
request data was missing or invalid
unable to authorize the given bearer token
access to this api is not allowed
resource not found
unexpected error
{- "end_date": "2024-02-28T23:59:59",
- "metrics": [
- "occupancy",
- "time_used",
- "utilization"
], - "operating_hours": {
- "days": [
- 0
], - "end_hour": 0,
- "start_hour": 0
}, - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
], - "start_date": "2024-02-28T00:00:00",
- "time_resolution": "total"
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/AllMetricsDatum"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/AllMetricsDatum"
}
}Calculates the occupancy for a set of spaces or for all spaces in a portfolio.
request body input
success
request data was missing or invalid
unable to authorize the given bearer token
access to this api is not allowed
resource not found
unexpected error
{- "end_date": "2024-02-28T23:59:59Z",
- "operating_hours": {
- "days": [
- 0
], - "end_hour": 0,
- "start_hour": 0
}, - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
], - "start_date": "2024-02-28T00:00:00Z",
- "time_resolution": "total"
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/OccupancyDatum"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/OccupancyDatum"
}
}Returns raw session data for a set of spaces or for all spaces in a portfolio. Supports both waffle (entry) and OA (open area) spaces. The API automatically detects the space types and processes them accordingly. Start and end times are generic and not tied to time zones. Sessions will be returned with time zones according to the space the session occurred in.
60-day maximum range. Requests where end_date minus start_date exceeds 60 days return a
400 validation error. To retrieve longer periods, make multiple calls with non-overlapping
windows of 60 days or less.
Timestamp format: Raw Sessions examples should use local timestamps without a trailing Z, for
example 2024-05-01T09:00:00.
success
request data was missing or invalid
unable to authorize the given bearer token
access to this api is not allowed
resource not found
unexpected error
{- "end_date": "2024-05-01T17:00:00",
- "space_ids": [
- "spc_2007812342638969000",
- "spc_5639204718362957014"
], - "start_date": "2024-05-01T09:00:00"
}{- "sessions": [
- {
- "end_time": "2019-08-24T14:15:22Z",
- "session_type": "0",
- "start_time": "2019-08-24T14:15:22Z"
}
]
}Calculates the time used for a set of spaces or for all spaces in a portfolio.
request body input
success
request data was missing or invalid
unable to authorize the given bearer token
access to this api is not allowed
resource not found
unexpected error
{- "end_date": "2024-02-28T23:59:59Z",
- "operating_hours": {
- "days": [
- 0
], - "end_hour": 0,
- "start_hour": 0
}, - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
], - "start_date": "2024-02-28T00:00:00Z",
- "time_resolution": "total"
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/TimeUsedDatum"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/TimeUsedDatum"
}
}Calculates the utilization for a set of spaces or for all spaces in a portfolio.
Definition: Utilization is occupancy divided by capacity.
The API returns a utilization value of 0 when capacity is 0. This can look the same as genuine
zero utilization, so integrations should confirm capacity on /v3/spaces before relying on
utilization.
If capacity is not set, utilization will return null.
Waffle-specific fields: is_capped, capped_count_limit, and up_time can appear here as well
and should use the same definitions as Occupancy.
request body input
success
request data was missing or invalid
unable to authorize the given bearer token
access to this api is not allowed
resource not found
unexpected error
{- "end_date": "2024-02-28T23:59:59Z",
- "operating_hours": {
- "days": [
- 0
], - "end_hour": 0,
- "start_hour": 0
}, - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
], - "start_date": "2024-02-28T00:00:00Z",
- "time_resolution": "total"
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/UtilizationDatum"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/UtilizationDatum"
}
}Returns the most current occupancy for a set of spaces or for all spaces in a portfolio. Current Occupancy supports OA, Entry, and Waffle-backed spaces.
Note: Waffle sensors are primarily presence sensors and cap counts at 3+.
success
unable to authorize the given bearer token
access to this api is not allowed
unexpected error
{- "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
]
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/CurrentCountDatumV3"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/CurrentCountDatumV3"
}
}Returns the current occupied status for a set of spaces or for all spaces in a portfolio.
This endpoint returns raw presence as space_id -> boolean. If your integration needs to
distinguish an unoccupied space from an unhealthy/offline sensor, use /v3/analytics/presence-health
instead.
Presence is available for OA and Waffle-backed spaces.
Deprecated: use /v3/analytics/presence-health for health-aware presence.
success
unable to authorize the given bearer token
access to this api is not allowed
unexpected error
{- "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
]
}{- "spc_10987654321": false,
- "spc_12345678901": true
}Returns the current occupied and space health status for a set of spaces or for all spaces in a portfolio.
Density recommends using this API instead of the standard Live Presence API.
success
unable to authorize the given bearer token
access to this api is not allowed
unexpected error
{- "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
]
}{- "spc_10987654321": {
- "$ref": "#/components/schemas/HealthAwarePresenceDatumV3"
}, - "spc_12345678901": {
- "$ref": "#/components/schemas/HealthAwarePresenceDatumV3"
}
}Determines short-term Presence for a set of spaces or for all spaces in an organization. Only OA spaces and floors are supported.
request body input
success
request data was missing or invalid
unable to authorize the given bearer token
access to this api is not allowed
resource not found
unexpected error
{- "minutes_lookback": 60,
- "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
]
}{- "data": [
- {
- "metrics": [
- {
- "presence": true,
- "timestamp": "2023-05-17T00:00:00Z"
}
], - "space_id": "spc_1234567890"
}
]
}Returns a WebSocket endpoint to receive presence messages for spaces with OA or Waffle sensors on a floor. See https://developers.density.io/websockets for websocket payload details.
Note: This endpoint does not open a WebSocket directly. Make a Bearer-authenticated REST POST
first. The response returns a ws_url; connect to that returned URL as-is with a WebSocket client.
update_type: "refresh" is a full snapshot sent on connect and periodically. update_type: "live"
is sent when presence changes.
success
BadRequestError is an error returned when the request is malformed or invalid.
UnauthorizedError is an error returned when the request is unauthorized.
ForbiddenError is an error returned when the request is forbidden.
NotFoundError is an error returned when the requested resource is not found.
InternalServerError is an error returned when the server encounters an error.
{- "ws_url": "string"
}Returns a WebSocket endpoint to receive count updates for a space and its children with entry or waffle sensors. See https://developers.density.io/websockets for websocket payload details.
Note: Like the Presence WebSocket endpoint, send a POST request to receive a ws_url, then connect
with a WebSocket client. See Presence WebSocket above for full explanation.
success
BadRequestError is an error returned when the request is malformed or invalid.
UnauthorizedError is an error returned when the request is unauthorized.
ForbiddenError is an error returned when the request is forbidden.
NotFoundError is an error returned when the requested resource is not found.
InternalServerError is an error returned when the server encounters an error.
{- "ws_url": "string"
}Get all doorways for an organization. A doorway represents a physical entry point monitored by
an Entry sensor. Each doorway is linked to one or more spaces. Use this endpoint to find
doorway_id values needed for the Doorway Events WebSocket.
success
unable to authorize the given bearer token
access to this api is not allowed
unexpected error
[- {
- "created_at": "string",
- "deleted_at": "string",
- "id": "string",
- "name": "string",
- "sensor_serial_number": "string",
- "spaces": [
- {
- "id": "string",
- "name": "string",
- "sensor_placement": 0
}
]
}
][- {
- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
]Creates a new label, not attached to any space.
success
unexpected error
{- "name": "string"
}{- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}Updates the name and/or group of a label
success
unexpected error
{- "group": "string",
- "name": "string"
}{- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}[- {
- "id": "string",
- "labels": [
- {
- "group": { },
- "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
], - "name": "string"
}
]Creates a new label group, not attached to any labels.
success
unexpected error
{- "labels": [
- {
- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
], - "name": "string"
}{- "id": "string",
- "labels": [
- {
- "group": { },
- "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
], - "name": "string"
}{- "name": "string"
}{- "id": "string",
- "labels": [
- {
- "group": { },
- "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
], - "name": "string"
}Get all spaces for an organization. Spaces are organized in a hierarchy. All levels share the
same spc_ ID format. Use the space_type field in the response to identify a space's level
in the hierarchy.
success
unable to authorize the given bearer token
access to this api is not allowed
unexpected error
[- {
- "address": "string",
- "binary_occupancy": true,
- "capacity": 0,
- "children": [
- { }
], - "children_ids": [
- "string"
], - "cost_per_sqft": 0,
- "counting_mode": "oa",
- "daily_reset": "string",
- "function": null,
- "go_live_date_utc": "string",
- "id": "string",
- "iwms_id": "string",
- "labels": [
- {
- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
], - "name": "string",
- "size_area": 0,
- "space_type": "space",
- "status": "string",
- "time_zone": "string"
}
]Updates a space entity.
space values to update
success
unexpected error
{- "address": "string",
- "capacity": 0,
- "function": "wellness_room",
- "iwms_id": "string",
- "name": "string",
- "time_zone": "string"
}{- "address": "string",
- "binary_occupancy": true,
- "capacity": 0,
- "children": [
- { }
], - "children_ids": [
- "string"
], - "cost_per_sqft": 0,
- "counting_mode": "oa",
- "daily_reset": "string",
- "function": null,
- "go_live_date_utc": "string",
- "id": "string",
- "iwms_id": "string",
- "labels": [
- {
- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
], - "name": "string",
- "size_area": 0,
- "space_type": "space",
- "status": "string",
- "time_zone": "string"
}Adds and removes elements to the list of labels for the space.
success
unexpected error
{- "add": [
- "string"
], - "create": [
- "string"
], - "delete": [
- "string"
]
}[- {
- "group": {
- "id": "string",
- "labels": [
- { }
], - "name": "string"
}, - "id": "string",
- "name": "string",
- "spaces": [
- {
- "current_count": 0,
- "id": "string",
- "name": "string"
}
]
}
]Validate your access to the Density public API. Use this as a first call to confirm your Bearer token is valid and your network can reach the API before building more complex integrations. A successful response returns a 200 with a plain text message.
success
unable to authorize the given bearer token
access to this api is not allowed
Do… or do not. There is no try. - Yoda
OAuth token flow for machine-to-machine users. Generate an access token using client credentials.
Most v3 resource endpoints require a Bearer token in the Authorization header. Two token types are supported. Static API token (starts with tok_) Short-lived OAuth token (usually starts with eyJ)
Both token types use the same Authorization: Bearer header format.
success
bad request
unable to authorize client
unexpected error
{- "audience": "string",
- "client_id": "string",
- "client_secret": "string",
- "grant_type": "string",
- "token_duration": 0
}{- "access_token": "string",
- "expires_in": "string",
- "token_type": "string"
}Lists sensors for your organization. Can filter by serial_numbers or space_ids. If neither is
provided, all sensors in the organization are returned.
Note: Do not send serial_numbers and space_ids in the same request; the request validator
treats them as mutually exclusive.
success
BadRequestError is an error returned when the request is malformed or invalid.
UnauthorizedError is an error returned when the request is unauthorized.
ForbiddenError is an error returned when the request is forbidden.
NotFoundError is an error returned when the requested resource is not found.
InternalServerError is an error returned when the server encounters an error.
{- "serial_numbers": [
- "string"
], - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
]
}[- {
- "created_at": "2019-08-24T14:15:22Z",
- "firmware_version": "string",
- "hardware_type": "ob1",
- "location": {
- "building_ids": [
- "spc_12345678901"
], - "floor_ids": [
- "spc_10987654321"
], - "space_ids": [
- "spc_50985556621"
]
}, - "network_addresses": [
- {
- "address": "string",
- "family": "string",
- "if": "string",
- "mac": "string"
}
], - "sensor_type": "oa",
- "serial_number": "A1B6Z10",
- "updated_at": "2019-08-24T14:15:22Z"
}
]Lists sensor health status changes over the requested period of time. The maximum range from start_date
to end_date is 10 days.
Request body input. Can filter by either serial numbers or space ids.
success
{- "end_date": "2024-02-28T23:59:59Z",
- "serial_numbers": [
- "string"
], - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
], - "start_date": "2024-02-28T00:00:00Z"
}{- "A1B6Z10": [
- {
- "health_status": "healthy",
- "timestamp": "2024-01-01T00:00:00Z"
}, - {
- "health_status": "offline",
- "timestamp": "2024-01-02T00:00:00Z"
}
]
}Lists sensor current health.
success
BadRequestError is an error returned when the request is malformed or invalid.
UnauthorizedError is an error returned when the request is unauthorized.
ForbiddenError is an error returned when the request is forbidden.
NotFoundError is an error returned when the requested resource is not found.
InternalServerError is an error returned when the server encounters an error.
{- "serial_numbers": [
- "string"
], - "space_ids": [
- "spc_12345678901",
- "spc_10987654321"
]
}{- "data": [
- {
- "health_status": "healthy",
- "last_status_change": "2019-08-24T14:15:22Z",
- "serial_number": "string"
}
]
}Read a list of users in your organization. Only available for Machine to Machine tokens with correct permissions.
success
bad request
unable to authorize client
forbidden
unexpected error
[- {
- "created_at": "2019-08-24T14:15:22Z",
- "email": "string",
- "full_name": "string",
- "id": "string",
- "role": "owner",
- "spaces": [
- "string"
]
}
]Create a user. Only available for Machine to Machine tokens with correct permissions.
success
bad request
unable to authorize client
forbidden
unexpected error
{- "email": "string",
- "full_name": "string",
- "role": "owner",
- "spaces": [
- "string"
]
}{- "created_at": "2019-08-24T14:15:22Z",
- "email": "string",
- "full_name": "string",
- "id": "string",
- "role": "owner",
- "spaces": [
- "string"
]
}Delete user. Only available for Machine to Machine tokens with correct permissions.
success
bad request
unable to authorize client
forbidden
unexpected error
{- "code": 0,
- "message": "string"
}Read a user in your organization. Only available for Machine to Machine tokens with correct permissions.
success
bad request
unable to authorize client
forbidden
unexpected error
{- "created_at": "2019-08-24T14:15:22Z",
- "email": "string",
- "full_name": "string",
- "id": "string",
- "role": "owner",
- "spaces": [
- "string"
]
}Update user role, name, or spaces. Only available for Machine to Machine tokens with correct permissions.
success
bad request
unable to authorize client
forbidden
unexpected error
{- "full_name": "string",
- "role": "owner",
- "spaces": [
- "string"
]
}{- "created_at": "2019-08-24T14:15:22Z",
- "email": "string",
- "full_name": "string",
- "id": "string",
- "role": "owner",
- "spaces": [
- "string"
]
}Issue a short-lived, display-scoped access token for wayfinding signage. Authenticates via client credentials (RFC 6749 Section 4.4).
success
bad request
invalid credentials
grant_type=string&client_id=string&client_secret=string&display_id=string
{- "access_token": "string",
- "expires_in": 0,
- "scope": "string",
- "token_type": "string"
}