Skip to content
Suomi

Elements filtered by type, storey, name and property values

POST
/v1/projects/{projectId}/elements/query
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/elements/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model_version_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ifc_type": "example", "storey_name": "example", "search": "example", "properties": [], "limit": 200, "cursor": "example", "include_total": true }'

The filter of the app’s element list. Live elements of the current models, or of one model version. A page holds at most limit elements; pass next_cursor as cursor with the same filter for the next.

projectId
required
string format: uuid
Media typeapplication/json

The filter of an element query and the page to read.

object
model_version_id
string | null format: uuid
ifc_type
string | null
<= 255 characters
storey_name
string | null
<= 255 characters
search

Part of the name, type name or GlobalId

string | null
<= 255 characters
properties

Every condition must hold

Array<object>
default: <= 10 items

One condition on a property of the elements.

object
pset
required
string
>= 1 characters <= 255 characters
property
required
string
>= 1 characters <= 255 characters
op
required

eq, prefix and contains take value; in takes values; exists neither

string
Allowed values: eq prefix contains in exists
value
string
<= 255 characters
values
Array<string>
>= 1 items <= 5000 items
limit
integer format: int64
default: 200 >= 1 <= 200
cursor

The next_cursor of the previous page; the other fields must be the same

string | null
<= 2048 characters
include_total
boolean
default: true

One page

Media typeapplication/json

ElementQueryPage: one page of queryElements.

object
data
required
Array<object>

ElementMatch: an element of a query page with the conditions’ values on it.

object
global_id
required
string
project_id
required
string format: uuid
name
required
string | null
ifc_type
required
string
predefined_type
required
string | null
storey_name
required
string | null
building_name
required
string | null
type_name
required
string | null
archived_at
required
string | null
matched
required

The conditions’ values on this element, keyed pset.property

object
key
additional properties
model_version_id
required
string format: uuid
total
required

Null with include_total: false and on every page after the first

integer | null format: int64
next_cursor
required
string | null
value_counts

First page with an in condition: each of its values with the elements that have it, in the order sent

Array<object>

ElementPropertyValueCount: one value and the elements that have it.

object
value
required
string
count
required
integer format: int64

Example generated

{
"data": [
{
"global_id": "example",
"project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"ifc_type": "example",
"predefined_type": "example",
"storey_name": "example",
"building_name": "example",
"type_name": "example",
"archived_at": "example",
"matched": {
"additionalProperty": "example"
},
"model_version_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
],
"total": 1,
"next_cursor": "example",
"value_counts": [
{
"value": "example",
"count": 1
}
]
}

VALIDATION_ERROR for a malformed id or parameter; INVALID_PROPERTY_FILTER for a property condition the filter cannot use

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

Missing, malformed, expired or revoked token

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project is not the integration’s; PUBLIC_API_DISABLED when the project’s owning organisation has turned the API off

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

No such project or element

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}

RATE_LIMITED; wait for Retry-After seconds

Media typeapplication/json

The error body of every /v1 answer of 400 or more.

object
error
required

A sentence for people; it may change

string
code
required

Part of the contract

string
details

What the code names, where it names something

request_id
required

The X-Request-Id of the call

string

Example generated

{
"error": "example",
"code": "example",
"details": "example",
"request_id": "example"
}