Skip to content
Suomi

Open an element's inspection, as a scan does

POST
/v1/projects/{projectId}/inspections
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/inspections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "global_id": "example", "plan_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Returns the element’s open inspection under the plan that covers it, and creates it with its number when it has none. Without a covering plan the project’s default template opens. Opening again returns the same inspection.

projectId
required
string format: uuid
Media typeapplication/json

The body of openInspection.

object
global_id
required

A live element of the project

string
>= 1 characters <= 64 characters
plan_id

Needed when several active plans cover the element (409 PLAN_CHOICE_REQUIRED)

string format: uuid

Example generated

{
"global_id": "example",
"plan_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

The inspection

Media typeapplication/json

A live inspection.

object
id
required

The inspection.

string format: uuid
project_id
required

The project.

string format: uuid
global_id
required

The element’s IFC GlobalId.

string
plan_id
required

The plan it belongs to.

string | null format: uuid
template_id
required

Its template.

string format: uuid
status
required

Its status.

string
current_step
required

The step under way.

integer format: int32
topic_guid
required

Its topic.

string | null format: uuid
number
required

The inspection number, INSP-00001 onwards per project; null until the inspection is opened

string | null
steps
required

Its steps in the template’s order.

Array<object>

A step of an inspection.

object
id
required

The step result.

string format: uuid
step_id
required

The template step.

string format: uuid
status
required

Its status.

string
inspected_by
required

Who recorded it.

string | null
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
inspected_by_name
required

Their name, read when answering.

string | null
created_via
required
One of:

Integration or app when it was recorded through this API; shown as Integraatio · {name}

string
Allowed values: agent integration app
via_client_id
required

The integration’s id or the app’s client id when created_via is integration or app

string | null
inspected_at
required

When it was recorded.

string | null
occurred_at
required

When it happened.

string | null
entered_later
required

True when recorded after the fact.

boolean
notes
required

Its notes.

string | null
fail_reason
required

Why it failed.

string | null
first_failed_at
required

Its first failing verdict.

string | null
check_list_version_id
required

The check-list version the step is pinned to; its items are the checks recordCheck takes

string | null format: uuid
checks
required

Its checks.

Array<object>

A check of an inspection step.

object
id
required

The check result.

string format: uuid
item_id
required

The check-list item it answers.

string format: uuid
status
required

Its status.

string
previously_failed
required

True when it failed before.

boolean
inspected_by
required

Who recorded it.

string | null
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
inspected_by_name
required

Their name, read when answering.

string | null
created_via
required
One of:

Integration or app when it was recorded through this API; shown as Integraatio · {name}

string
Allowed values: agent integration app
via_client_id
required

The integration’s id or the app’s client id when created_via is integration or app

string | null
inspected_at
required

When it was recorded.

string
occurred_at
required

When it happened.

string | null
entered_later
required

True when recorded after the fact.

boolean
note
required

Its note.

string | null
fail_reason
required

Why it failed.

string | null
changed_at
required

The row’s change time.

string
deleted
required
boolean

Example

{
"steps": [
{
"created_via": "agent",
"checks": [
{
"created_via": "agent"
}
]
}
],
"deleted": false
}

PLAN_NOT_COVERING: the plan is not active or does not cover the element; VALIDATION_ERROR

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 element, or no plan covers the element and the project has no default template

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

PLAN_CHOICE_REQUIRED with the covering plans in details; CONFLICT once the project is handed over to maintenance

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