Skip to content
Suomi

Carry removed elements' data to live ones (spec 048)

POST
/v1/projects/{projectId}/models/{modelId}/carry-overs
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/carry-overs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "pairs": [ { "from": "example", "to": "example" } ], "batch_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Moves each pair’s label, inspections, plan rows and element events from the removed element to the live one in one transaction, and adds the live one to findings. A pair that would put two labels or two inspections with results on one element, or that is no longer valid, comes back refused with its code; the rest are carried. The removed element stays archived. Each carry-over comes in listCarryOvers. A repeat with the same Idempotency-Key and body returns the carry-overs the first call made and carries nothing again. A carry-over still running 25 seconds after the request arrived answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in details and carries nothing: carry fewer pairs at a time.

projectId
required
string format: uuid
modelId
required
string format: uuid

The model’s id

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
pairs
required

from a removed element of the model, to a live one of its current version

Array<object>
>= 1 items <= 500 items

A removed element and the live one its data goes to.

object
from
required
string
>= 1 characters <= 200 characters
to
required
string
>= 1 characters <= 200 characters
batch_id

Groups the pairs for undoCarryOvers; default derived from the Idempotency-Key, or new

string format: uuid

Example generated

{
"pairs": [
{
"from": "example",
"to": "example"
}
],
"batch_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Carried and refused pairs

Media typeapplication/json
object
batch_id
required
string
pairs
required
Array<object>

One pair of a carry-over’s answer.

object
from
required
string
to
required
string
status
required

A pair’s status.

string
Allowed values: carried refused
carry_over_id
string
tier

The tier of a carried pair: the proposal’s, or manual when the pair was not the proposal.

string
Allowed values: varma todennakoinen manual
moved
One of:

What moved to the new element. New counts may come.

object
labels

Labels.

integer format: int64
workflows

Inspections.

integer format: int64
placeholders

Placeholders.

integer format: int64
plan_rows

Plan rows.

integer format: int64
plan_scopes

Plan scopes.

integer format: int64
viewpoints

Viewpoints.

integer format: int64
element_events

Element events.

integer format: int64
code

Why a pair was refused.

string
Allowed values: LABEL_ON_BOTH INSPECTION_ON_BOTH REMAP_STALE
element_events_left
integer format: int64
totals
required
One of:

What moved to the new element. New counts may come.

object
labels

Labels.

integer format: int64
workflows

Inspections.

integer format: int64
placeholders

Placeholders.

integer format: int64
plan_rows

Plan rows.

integer format: int64
plan_scopes

Plan scopes.

integer format: int64
viewpoints

Viewpoints.

integer format: int64
element_events

Element events.

integer format: int64
element_events_left
required
integer format: int64

Example

{
"pairs": [
{
"status": "carried",
"tier": "varma",
"code": "LABEL_ON_BOTH"
}
]
}

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

MODEL_BUSY: the model is being processed or carried; try again

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