Skip to content
Suomi

Publish a pending draft as a finding

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

The integration becomes the finding’s author; its first comment names the integration that made the draft. The draft’s photos become the finding’s photos. A decided draft answers 409 DRAFT_DECIDED.

projectId
required
string format: uuid
draftId
required
string format: uuid
Media typeapplication/json
object
language

The language of the comment that names the drafting integration; default fi

string
Allowed values: fi en

The published draft and its finding

Media typeapplication/json

The published draft and the finding it became.

object
draft
required

A draft as /v1 answers it; for the document only.

object
id
required
string format: uuid
project_id
required
string format: uuid
title
required
string
description
required
string | null
priority
required
string | null
labels
required
Array<string>
element_global_ids
required
Array<string>
storey_global_id
required
string | null
point
required
One of:

Metres in the model’s coordinates, z at the storey’s floor

object
x
required
number format: double
y
required
number format: double
z
required
number format: double
source_ref
required
string | null
status
required
string
Allowed values: pending published rejected
created_by
required
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}$/
created_by_name
required
string | null
created_via
required
string | null
via_client_id
required
string | null
created_at
required
string
decided_by
required
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}$/
decided_by_name
required
string | null
decided_at
required
string | null
topic_guid
required
string | null format: uuid
photo_keys
required

The photos the draft carries; each becomes a photo of the published finding

Array<string>
finding
required

A live topic.

object
guid
required

The topic.

string format: uuid
project_id
required

The project.

string format: uuid
server_assigned_id
required

Its number.

string | null
title
required

Its title.

string
topic_type
required

Its BCF type.

string | null
topic_status
required

Its BCF status.

string | null
priority
required

Its priority.

string | null
assigned_to
required

Who it is assigned to.

string | null
labels
required

Its labels.

Array<string> | null
description
required

Its description.

string | null
stage
required

Its stage.

string | null
creation_author
required

Who created it.

string
creation_date
required

When it was created.

string
modified_author
required

Who changed it last.

string | null
modified_date
required

When it was changed last.

string
due_date
required

When it is due.

string | null
closed_at
required

When it was closed.

string | null
created_via
required

How it was created.

string | null
via_client_id
required

The client that created it.

string | null
entered_later
required

True when recorded after the fact.

boolean
recorded_at
required

When it was recorded.

string | null
is_finding
required

True for a finding.

boolean
elements
required

The GlobalIds of its first viewpoint.

Array<string>
changed_at
required

The row’s change time.

string
deleted
required
boolean

Example

{
"draft": {
"status": "pending"
},
"finding": {
"deleted": false
}
}

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, finding, comment, viewpoint, draft 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"
}

DRAFT_DECIDED

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