Skip to main content
PUT
Upsert a work session

Authorizations

X-API-Key
string
header
required

Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.

Path Parameters

id
string<uuid>
required

Record id.

Query Parameters

update
string[]
required

Columns to overwrite when the row already exists. Repeat the parameter for each column: a single comma-separated value is read as one column name and fails at the database. Without the parameter the request is rejected with 400.

Body

application/json

Leave shiftWorkHours out and BuildingSwell fills it from the person's shop shift for startDate, stamping the shop timezone onto it. Leave metadata.costCode out and it is resolved from the deliverable, then its station, then its ancestors, then the project, then the route; if none of those carry one, the key is left off entirely.

One person can hold only one open session per deliverable. A second attempt comes back as 409.

deliverableId
string<uuid>
required

Deliverable the time was logged against.

workerId
string<uuid>
required

Person who did the work.

shopId
string<uuid>
required

Department the session belongs to.

startDate
string<date-time>
required

When the session started, in UTC.

id
string<uuid>

Unique id. Generated on create unless you supply one.

endDate
string<date-time> | null

When the session ended, in UTC. null means it is still open.

isEdited
boolean
default:false

true when someone has edited the session by hand.

lastUpdatedBy
string<uuid> | null

Who last changed the session.

shiftWorkHours
object | null

The shift the record was worked against. Break times are local wall-clock, not UTC.

externalSource
string | null

System the session came from, for example quickbase.

externalSync
string
default:not synced

Sync state for the external system.

Example:

"synced"

metadata
object

Free-form key-value store. No key is guaranteed to be present, and a missing key is not the same as a null one. See the resource guide for which paths populate costCode and unionCode.

Example:
createdAt
string<date-time>

When the record was created.

updatedAt
string<date-time>

When the record last changed.

Response

The upserted work session.

value
object
required

Time one person logged against one deliverable. An open session has no endDate.