Skip to content
Suomi

What a scope covers, without saving it

POST
/v1/projects/{projectId}/inspection-plans/preview
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/inspection-plans/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "ifc_type": [ "example" ], "storey_name": [ "example" ], "global_ids": [ "example" ], "assigned": true, "excluded": true, "plan_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

A sample of at most 20 elements and the counts by IFC type and storey.

projectId
required
string format: uuid
Media typeapplication/json

The body of previewInspectionPlan.

object
ifc_type
Array<string>
>= 1 items <= 100 items
storey_name
Array<string>
>= 1 items <= 100 items
global_ids
Array<string>
>= 1 items <= 1000 items
assigned
boolean
excluded
boolean
plan_id

Resolve against this plan’s added and excluded elements

string format: uuid

The preview

Media typeapplication/json

InspectionPlanPreview: a scope resolved without saving it.

object
in_scope
required

Live elements in scope.

integer format: int32
sample
required

At most 20 of them.

Array<object>

One element of a preview’s sample.

object
global_id
required

The element.

string
name
required

Its name, cut at 120 characters.

string | null
ifc_type
required

Its IFC class.

string
storey_name
required

Its storey, cut at 120 characters.

string | null
by_type
required

At most 200 classes.

Array<object>

The elements in scope of one IFC class.

object
ifc_type
required

The IFC class.

string
count
required

Elements.

integer format: int32
by_storey
required

At most 200 storeys.

Array<object>

The elements in scope on one storey.

object
storey_name
required

The storey; null for elements without one.

string | null
count
required

Elements.

integer format: int32
added

With plan_id: the plan’s added elements.

integer format: int32
excluded

With plan_id: elements the edited filter matches that the plan leaves out.

integer format: int32

Example generated

{
"in_scope": 1,
"sample": [
{
"global_id": "example",
"name": "example",
"ifc_type": "example",
"storey_name": "example"
}
],
"by_type": [
{
"ifc_type": "example",
"count": 1
}
],
"by_storey": [
{
"storey_name": "example",
"count": 1
}
],
"added": 1,
"excluded": 1
}

Invalid body, parameters or Idempotency-Key

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 role the scopes give does not cover the write, or 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 plan, or a draft plan and the role is not admin

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"
}

IDEMPOTENCY_KEY_REUSED: the key was used with another body

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"
}