Density Public API (beta)

Download OpenAPI specification:Download

This service provides a layer of abstraction on top of the Density data API's.

It is intended for use by the general public.

Metrics

Floor Data Completion Status

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
Request Body schema: application/json
required

Request body input.

end_date
required
string

end of the query date range, inclusive. Must be after 2024-06-01T00:00:00Z.

floor_ids
Array of strings
start_date
required
string

start of the query date range, max range is 10 days, min range is 5 minutes.

Responses
200

success

post/v3/analytics/data-status
Request samples
application/json
{
  • "end_date": "2024-06-28T23:59:59Z",
  • "floor_ids": [
    ],
  • "start_date": "2024-06-28T00:00:00Z"
}
Response samples
application/json
{
  • "spc_10987654321": {
    },
  • "spc_12345678901": {
    }
}

Occupancy

Calculates the occupancy for a set of spaces or for all spaces in a portfolio.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

end_date
required
string

end of the query date range, inclusive

space_ids
Array of strings

specific spaces to query

start_date
required
string

start of the query date range

time_resolution
string
Default: "total"

time resolution for the query results

Enum: "total" "hour" "day" "week" "month" "year" "weekday" "hour_of_day" "minute" "10minute"
Responses
200

success

400

request data was missing or invalid

401

unable to authorize the given bearer token

403

access to this api is not allowed

404

resource not found

500

unexpected error

post/v3/analytics/occupancy
Request samples
application/json
{
  • "end_date": "2024-02-28T23:59:59Z",
  • "space_ids": [
    ],
  • "start_date": "2024-02-28T00:00:00Z",
  • "time_resolution": "total"
}
Response samples
application/json
{
  • "spc_10987654321": {
    },
  • "spc_12345678901": {
    }
}

Time Used

Calculates the time used for a set of spaces or for all spaces in a portfolio.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

end_date
required
string

end of the query date range, inclusive

space_ids
Array of strings

specific spaces to query

start_date
required
string

start of the query date range

time_resolution
string
Default: "total"

time resolution for the query results

Enum: "total" "hour" "day" "week" "month" "year" "weekday" "hour_of_day" "minute" "10minute"
Responses
200

success

400

request data was missing or invalid

401

unable to authorize the given bearer token

403

access to this api is not allowed

404

resource not found

500

unexpected error

post/v3/analytics/time-used
Request samples
application/json
{
  • "end_date": "2024-02-28T23:59:59Z",
  • "space_ids": [
    ],
  • "start_date": "2024-02-28T00:00:00Z",
  • "time_resolution": "total"
}
Response samples
application/json
{
  • "spc_10987654321": {
    },
  • "spc_12345678901": {
    }
}

Utilization

Calculates the utilization for a set of spaces or for all spaces in a portfolio.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

end_date
required
string

end of the query date range, inclusive

space_ids
Array of strings

specific spaces to query

start_date
required
string

start of the query date range

time_resolution
string
Default: "total"

time resolution for the query results

Enum: "total" "hour" "day" "week" "month" "year" "weekday" "hour_of_day" "minute" "10minute"
Responses
200

success

400

request data was missing or invalid

401

unable to authorize the given bearer token

403

access to this api is not allowed

404

resource not found

500

unexpected error

post/v3/analytics/utilization
Request samples
application/json
{
  • "end_date": "2024-02-28T23:59:59Z",
  • "space_ids": [
    ],
  • "start_date": "2024-02-28T00:00:00Z",
  • "time_resolution": "total"
}
Response samples
application/json
{
  • "spc_10987654321": {
    },
  • "spc_12345678901": {
    }
}

Live

Current Occupancy

Returns the most current occupancy for a set of spaces or for all spaces in a portfolio. Only entry spaces are supported.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

space_ids
Array of strings

specific spaces to query

Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

500

unexpected error

post/v3/analytics/occupancy/current
Request samples
application/json
{
  • "space_ids": [
    ]
}
Response samples
application/json
{
  • "spc_10987654321": {
    },
  • "spc_12345678901": {
    }
}

Presence

Returns the current occupied status for a set of spaces or for all spaces in a portfolio.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

space_ids
Array of strings

specific spaces to query

Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

500

unexpected error

post/v3/analytics/presence
Request samples
application/json
{
  • "space_ids": [
    ]
}
Response samples
application/json
{
  • "spc_10987654321": false,
  • "spc_12345678901": true
}

Health Aware Presence

Returns the current occupied and space health status for a set of spaces or for all spaces in a portfolio.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

space_ids
Array of strings

specific spaces to query

Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

500

unexpected error

post/v3/analytics/presence-health
Request samples
application/json
{
  • "space_ids": [
    ]
}
Response samples
application/json
{
  • "spc_10987654321": {
    },
  • "spc_12345678901": {
    }
}

Short-Term Analytics

Determines short-term Presence for a set of spaces or for all spaces in an organization. Only OA spaces and floors are supported.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

minutes_lookback
integer <uint32>
Default: 0

the length of time in minutes for which historical presence information will be fetched. 0 value will return the current minute. 5 will return the current minute, plus 5 mins before. Max value is 240 minutes.

space_ids
Array of strings

specific spaces to query. Only areas and floors will be processed.

Responses
200

success

400

request data was missing or invalid

401

unable to authorize the given bearer token

403

access to this api is not allowed

404

resource not found

500

unexpected error

post/v3/analytics/short-term
Request samples
application/json
{
  • "minutes_lookback": 60,
  • "space_ids": [
    ]
}
Response samples
application/json
{
  • "data": [
    ]
}

Create Presence WebSocket

Returns a WebSocket endpoint to receive presence messages for spaces on a floor. See https://developers.density.io/websockets for websocket payload details.

SecurityapiKey or application
Request
path Parameters
floor_id
required
string

space id for a floor.

Responses
200

success

400

BadRequestError is an error returned when the request is malformed or invalid.

401

UnauthorizedError is an error returned when the request is unauthorized.

403

ForbiddenError is an error returned when the request is forbidden.

404

NotFoundError is an error returned when the requested resource is not found.

500

InternalServerError is an error returned when the server encounters an error.

post/v3/analytics/ws/floor/{floor_id}/presence
Request samples
Response samples
application/json
{
  • "ws_url": "string"
}

Create Entry occupancy WebSocket

Returns a WebSocket endpoint to receive count updates for a space and its children with entry sensors. See https://developers.density.io/websockets for websocket payload details.

SecurityapiKey or application
Request
path Parameters
space_id
required
string

space id of a space node to query.

Responses
200

success

400

BadRequestError is an error returned when the request is malformed or invalid.

401

UnauthorizedError is an error returned when the request is unauthorized.

403

ForbiddenError is an error returned when the request is forbidden.

404

NotFoundError is an error returned when the requested resource is not found.

500

InternalServerError is an error returned when the server encounters an error.

post/v3/analytics/ws/space/{space_id}/occupancy
Request samples
Response samples
application/json
{
  • "ws_url": "string"
}

Spaces

Doorways

Get all doorways for an organization.

SecurityapiKey or application
Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

500

unexpected error

get/v3/doorways
Request samples
Response samples
application/json
[
  • {
    }
]

Labels

Gets all labels.

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

get/v3/labels
Request samples
Response samples
application/json
[
  • {
    }
]

Create Label

Creates a new label, not attached to any space.

Request
Request Body schema: application/json
required

Only name is required.

name
string

name of label

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

post/v3/labels
Request samples
application/json
{
  • "name": "string"
}
Response samples
application/json
{
  • "group": {
    },
  • "id": "string",
  • "name": "string",
  • "spaces": [
    ]
}

Deletes a label

Request
path Parameters
label_id
required
string

unique identifier of a label

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

delete/v3/labels/{label_id}
Request samples

Update Label

Updates the name and/or group of a label

Request
path Parameters
label_id
required
string

unique identifier of a label

Request Body schema: application/json
required

name and/or group of the new label

group
string

group id of label

name
string

name of label

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

patch/v3/labels/{label_id}
Request samples
application/json
{
  • "group": "string",
  • "name": "string"
}
Response samples
application/json
{
  • "group": {
    },
  • "id": "string",
  • "name": "string",
  • "spaces": [
    ]
}

Label Groups

Gets all label groups.

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

get/v3/labels/groups
Request samples
Response samples
application/json
[
  • {
    }
]

Create Label Group

Creates a new label group, not attached to any labels.

Request
Request Body schema: application/json
required

Only name is required.

Array of objects (Label)
name
string
Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

post/v3/labels/groups
Request samples
application/json
{
  • "labels": [
    ],
  • "name": "string"
}
Response samples
application/json
{
  • "id": "string",
  • "labels": [
    ],
  • "name": "string"
}

Deletes a label group

Request
path Parameters
group_id
required
string

unique identifier of a label group

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

delete/v3/labels/groups/{group_id}
Request samples

Update Label Group

Updates the name of label group

Request
path Parameters
group_id
required
string

unique identifier of a label

Request Body schema: application/json
required

name of label group

name
string

name of label

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

patch/v3/labels/groups/{group_id}
Request samples
application/json
{
  • "name": "string"
}
Response samples
application/json
{
  • "id": "string",
  • "labels": [
    ],
  • "name": "string"
}

Spaces

Get all spaces for an organization.

SecurityapiKey or application
Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

500

unexpected error

get/v3/spaces
Request samples
Response samples
application/json
[
  • {
    }
]

Update Space

Updates a space entity.

Request
path Parameters
space_id
required
string

unique identifier of a space

Request Body schema: application/json
required

space values to update

address
string
capacity
integer <int64>
function
string
Enum: "wellness_room" "utility_room" "theater" "servery" "retail" "restroom" "reception" "phone_booth" "outdoor" "other" "open_workspace" "open_collaboration_space" "meeting_room" "lounge" "library" "lab" "kitchen" "gym" "games_room" "event_space" "enclosed_workspace" "desk_neighborhood" "desk" "cafe" "break_room"
iwms_id
string
name
string
time_zone
string
Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

patch/v3/spaces/{space_id}
Request samples
application/json
{
  • "address": "string",
  • "capacity": 0,
  • "function": "wellness_room",
  • "iwms_id": "string",
  • "name": "string",
  • "time_zone": "string"
}
Response samples
application/json
{
  • "address": "string",
  • "capacity": 0,
  • "children": [
    ],
  • "children_ids": [
    ],
  • "cost_per_sqft": 0,
  • "counting_mode": "string",
  • "daily_reset": "string",
  • "function": null,
  • "go_live_date_utc": "string",
  • "id": "string",
  • "iwms_id": "string",
  • "labels": [
    ],
  • "name": "string",
  • "size_area": 0,
  • "space_type": "portfolio",
  • "status": "string",
  • "time_zone": "string"
}

Update Space Labels

Adds and removes elements to the list of labels for the space.

Request
path Parameters
space_id
required
string

unique identifier of a space

Request Body schema: application/json
required
add
Array of strings

label ID's to add to a space

create
Array of strings

label names to possibly create, then add to a space

delete
Array of strings

label ID's to remove to a space

Responses
200

success

default

UnexpectedError is an error not expected to ever be returned but may be returned under unexpected circumstances.

patch/v3/spaces/{space_id}/labels
Request samples
application/json
{
  • "add": [
    ],
  • "create": [
    ],
  • "delete": [
    ]
}
Response samples
application/json
[
  • {
    }
]

Info

Hello World

Validate your access to the Density public API.

Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

get/v3/hello-world
Request samples
Response samples
text/plain
Do… or do not. There is no try. - Yoda

API Version

API version.

Responses
200

success

401

unable to authorize the given bearer token

403

access to this api is not allowed

get/version
Request samples
Response samples
text/plain
1.0.2

Auth

Density Access Token

OAuth token flow for machine-to-machine users. Generate an access token using client credentials.

Request
Request Body schema: application/json
required

request body input

client_id
required
string
client_secret
required
string
grant_type
required
string
Value: "client_credentials"
Responses
200

success

400

bad request

401

unable to authorize client

500

unexpected error

post/v3/oauth/token
Request samples
application/json
{
  • "client_id": "string",
  • "client_secret": "string",
  • "grant_type": "client_credentials"
}
Response samples
application/json
{
  • "access_token": "string",
  • "expires_in": "string",
  • "token_type": "string"
}

Sensors

Sensors

Lists sensors

Request
Request Body schema: application/json
required

Request body input. Can filter by either serial numbers or space ids.

serial_numbers
Array of strings
space_ids
Array of strings
Responses
200

success

400

BadRequestError is an error returned when the request is malformed or invalid.

401

UnauthorizedError is an error returned when the request is unauthorized.

403

ForbiddenError is an error returned when the request is forbidden.

404

NotFoundError is an error returned when the requested resource is not found.

500

InternalServerError is an error returned when the server encounters an error.

post/v3/sensors
Request samples
application/json
{
  • "serial_numbers": [
    ],
  • "space_ids": [
    ]
}
Response samples
application/json
[
  • {
    }
]

Historical Sensor Health

Lists sensor health changes over the requested period of time.

Request
Request Body schema: application/json
required

Request body input. Can filter by either serial numbers or space ids.

end_date
required
string

end of the query date range, inclusive

serial_numbers
Array of strings
space_ids
Array of strings
start_date
required
string

start of the query date range, max range is 10 days

Responses
200

success

post/v3/sensors/health
Request samples
application/json
{
  • "end_date": "2024-02-28T23:59:59Z",
  • "serial_numbers": [
    ],
  • "space_ids": [
    ],
  • "start_date": "2024-02-28T00:00:00Z"
}
Response samples
application/json
{
  • "A1B6Z10": [
    ]
}

Current Sensor Health

Lists sensor current health

Request
Request Body schema: application/json
required

Request body input. Can filter by either serial numbers or space ids.

serial_numbers
Array of strings
space_ids
Array of strings
Responses
200

success

400

BadRequestError is an error returned when the request is malformed or invalid.

401

UnauthorizedError is an error returned when the request is unauthorized.

403

ForbiddenError is an error returned when the request is forbidden.

404

NotFoundError is an error returned when the requested resource is not found.

500

InternalServerError is an error returned when the server encounters an error.

post/v3/sensors/health/current
Request samples
application/json
{
  • "serial_numbers": [
    ],
  • "space_ids": [
    ]
}
Response samples
application/json
{
  • "data": [
    ]
}

Users

Read Users

Read a list of users in your organization. Only available for Machine to Machine tokens with correct permissions.

SecurityapiKey or application
Responses
200

success

400

bad request

401

unable to authorize client

403

forbidden

500

unexpected error

get/v3/users
Request samples
Response samples
application/json
[
  • {
    }
]

Create User

Create a user. Only available for Machine to Machine tokens with correct permissions.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

email
string
full_name
string
role
string

role for the user

Enum: "owner" "admin" "editor" "readonly"
spaces
Array of strings
Responses
201

success

400

bad request

401

unable to authorize client

403

forbidden

500

unexpected error

post/v3/users
Request samples
application/json
{
  • "email": "string",
  • "full_name": "string",
  • "role": "owner",
  • "spaces": [
    ]
}
Response samples
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "email": "string",
  • "full_name": "string",
  • "id": "string",
  • "role": "owner",
  • "spaces": [
    ]
}

Delete User

Delete user. Only available for Machine to Machine tokens with correct permissions.

SecurityapiKey or application
Responses
204

success

400

bad request

401

unable to authorize client

403

forbidden

500

unexpected error

delete/v3/users/:user_id
Request samples
Response samples
application/json
{
  • "code": 0,
  • "message": "string"
}

Read User

Read a user in your organization. Only available for Machine to Machine tokens with correct permissions.

SecurityapiKey or application
Responses
200

success

400

bad request

401

unable to authorize client

403

forbidden

500

unexpected error

get/v3/users/:user_id
Request samples
Response samples
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "email": "string",
  • "full_name": "string",
  • "id": "string",
  • "role": "owner",
  • "spaces": [
    ]
}

Update User

Update user role, name, or spaces. Only available for Machine to Machine tokens with correct permissions.

SecurityapiKey or application
Request
Request Body schema: application/json
required

request body input

full_name
string
role
string

role for the user

Enum: "owner" "admin" "editor" "readonly"
spaces
Array of strings
Responses
200

success

400

bad request

401

unable to authorize client

403

forbidden

500

unexpected error

put/v3/users/:user_id
Request samples
application/json
{
  • "full_name": "string",
  • "role": "owner",
  • "spaces": [
    ]
}
Response samples
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "email": "string",
  • "full_name": "string",
  • "id": "string",
  • "role": "owner",
  • "spaces": [
    ]
}