Skip to content
Suomi

Start a model upload

POST
/v1/projects/{projectId}/model-versions
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/model-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "filename": "rakenne.ifc", "content_type": "application/octet-stream", "model_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Records a pending model version and answers a presigned PUT for the IFC file. Upload the file, then call ingestModelVersion. Without model_id the file starts a new model; with it the file becomes the model’s next version once ingested. A repeat with the same Idempotency-Key and body returns the same model version with a fresh upload URL, with 200.

projectId
required
string format: uuid
idempotency-key
string
/^[\x21-\x7e]{1,255}$/

A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.

Media typeapplication/json
object
filename
required

Letters, digits, underscore, dot, dash and space; ends with .ifc

string
>= 1 characters <= 255 characters

Example

rakenne.ifc
content_type

Default application/octet-stream; send the same Content-Type with the PUT

string
Allowed values: application/octet-stream model/ifc
model_id

Upload a new version of this model; without it the file starts a new model

string format: uuid

The model version and where to upload its file an earlier call with the same Idempotency-Key wrote

Media typeapplication/json

ModelUpload: the version and where to upload its file.

object
model_version
required

A live model version.

object
id
required

The version’s id; the upload that made it

string format: uuid
project_id
required

The project.

string format: uuid
model_id
required

Every version of one model shares it; the first upload’s id

string format: uuid
filename
required

The file’s name.

string
status
required

pending until ingestModelVersion, processing, then complete or failed. New statuses may come.

string
Allowed values: pending processing complete failed
version
required

The version number once complete; the highest complete version is the current model

integer | null format: int64
element_count
required

Elements in the file.

integer | null format: int64
error
required

Why the ingest failed.

string | null
diff
required
One of:

Elements compared with the previous version: kept, added, removed, and the removed ones with labels, inspections or other data. New counts may come.

object
kept

Kept.

integer format: int64
added

Added.

integer format: int64
removed

Removed.

integer format: int64
removed_with_labels

Removed with labels.

integer format: int64
removed_with_inspections

Removed with inspections.

integer format: int64
removed_with_data

Removed with other data.

integer format: int64
skipped_other_model

Left out as another model’s.

integer format: int64
ifc_schema
required

The IFC schema.

string | null
ifc_file_description
required

The IFC file description.

string | null
ifc_model_kind
required

The kind of model.

string | null
created_at
required

When it was uploaded.

string
completed_at
required

When its ingest finished.

string | null
changed_at
required

The row’s change time.

string
deleted
required
boolean
upload_url
required

Null on a repeat once the version has left pending: its file is in place

string | null
method
required
string
Allowed values: PUT
headers
required

Send exactly these headers with the PUT

object
key
additional properties
string
expires_in
required

Seconds the upload URL stays valid

integer format: int64

Example

{
"model_version": {
"status": "pending",
"deleted": false
},
"method": "PUT"
}

The model version and where to upload its file

Media typeapplication/json

ModelUpload: the version and where to upload its file.

object
model_version
required

A live model version.

object
id
required

The version’s id; the upload that made it

string format: uuid
project_id
required

The project.

string format: uuid
model_id
required

Every version of one model shares it; the first upload’s id

string format: uuid
filename
required

The file’s name.

string
status
required

pending until ingestModelVersion, processing, then complete or failed. New statuses may come.

string
Allowed values: pending processing complete failed
version
required

The version number once complete; the highest complete version is the current model

integer | null format: int64
element_count
required

Elements in the file.

integer | null format: int64
error
required

Why the ingest failed.

string | null
diff
required
One of:

Elements compared with the previous version: kept, added, removed, and the removed ones with labels, inspections or other data. New counts may come.

object
kept

Kept.

integer format: int64
added

Added.

integer format: int64
removed

Removed.

integer format: int64
removed_with_labels

Removed with labels.

integer format: int64
removed_with_inspections

Removed with inspections.

integer format: int64
removed_with_data

Removed with other data.

integer format: int64
skipped_other_model

Left out as another model’s.

integer format: int64
ifc_schema
required

The IFC schema.

string | null
ifc_file_description
required

The IFC file description.

string | null
ifc_model_kind
required

The kind of model.

string | null
created_at
required

When it was uploaded.

string
completed_at
required

When its ingest finished.

string | null
changed_at
required

The row’s change time.

string
deleted
required
boolean
upload_url
required

Null on a repeat once the version has left pending: its file is in place

string | null
method
required
string
Allowed values: PUT
headers
required

Send exactly these headers with the PUT

object
key
additional properties
string
expires_in
required

Seconds the upload URL stays valid

integer format: int64

Example

{
"model_version": {
"status": "pending",
"deleted": false
},
"method": "PUT"
}

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, model, model version or reference document

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

UPLOAD_NOT_CLAIMABLE: the model has no complete version yet; MODEL_BUSY: a version of it is being processed

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

RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it

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

UPLOAD_NOT_READY: try again in a moment

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