Skip to content
Suomi

Record one event of a kind on each listed element

POST
/v1/projects/{projectId}/element-events
Code sample: Shell / cURL
curl --request POST \
--url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/element-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "delivered", "global_ids": [ "example" ], "occurred_at": "2026-04-15T12:00:00Z", "load_ref": "example" }'

Elements that already have a standing event of the kind, or that do not exist, come back in refused with their code. A repeat with the same Idempotency-Key and body returns the events the first call recorded and records nothing again. The body is the kind, the set of GlobalIds, load_ref and occurred_at; the same key with another body answers 422 IDEMPOTENCY_KEY_REUSED. A key binds a body only once its call has recorded an event.

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

The body of recordElementEvents.

object
kind
required

The kind of an element event.

string
Allowed values: delivered received_on_site installed
global_ids
required
Array<string>
>= 1 items <= 100 items
occurred_at

When it happened; default now. An earlier time is recorded as entered later.

string format: date-time
load_ref

Delivery or load reference; delivered and received_on_site only

string
>= 1 characters <= 64 characters

Recorded and refused elements

Media typeapplication/json

Recorded and refused elements.

object
kind
required

The kind of an element event.

string
Allowed values: delivered received_on_site installed
recorded
required
Array<object>

An element event as /v1 documents it: created_via is any text.

object
id
required
string format: uuid
global_id
required
string
kind
required

The kind of an element event.

string
Allowed values: delivered received_on_site installed
occurred_at
required
string
recorded_at
required
string
entered_later
required
boolean
recorded_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}$/
recorded_by_name
required
string | null
account_name
required
string
created_via
required
string | null
via_client_id
required
string | null
load_ref
required
string | null
voided_at
required
string | null
voided_by_name
required
string | null
void_reason
required
string | null
refused
required
Array<object>

An element that took no event.

object
global_id
required
string
code
required

Why an element took no event.

string
Allowed values: ALREADY_RECORDED ELEMENT_NOT_FOUND ELEMENT_REMOVED
event
required
One of:

An element event as /v1 documents it: created_via is any text.

object
id
required
string format: uuid
global_id
required
string
kind
required

The kind of an element event.

string
Allowed values: delivered received_on_site installed
occurred_at
required
string
recorded_at
required
string
entered_later
required
boolean
recorded_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}$/
recorded_by_name
required
string | null
account_name
required
string
created_via
required
string | null
via_client_id
required
string | null
load_ref
required
string | null
voided_at
required
string | null
voided_by_name
required
string | null
void_reason
required
string | null

Example

{
"kind": "delivered",
"recorded": [
{
"kind": "delivered"
}
],
"refused": [
{
"code": "ALREADY_RECORDED",
"event": {
"kind": "delivered"
}
}
]
}

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, or PUBLIC_API_DISABLED when an admin of the integration’s organisation, or on a per-project route of 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, event 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"
}

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