Upsert a cost code
Insert the cost code, or update it when a row with a conflicting unique key already exists. update is required and lists which columns to overwrite on conflict.
Matching is by id — the one in the path. If the code you send already belongs to a different entry, the request is rejected with 409.
Authorizations
Organization-scoped API key. Create one in the BuildingSwell app under Organization settings, API keys.
Path Parameters
Record id.
Query Parameters
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
The code value itself, for example LOC-123. Trimmed on write and unique within your organization for this list.
1Unique id. Generated on create unless you supply one.
What the code is for. Trimmed on write. Defaults to null.
Whether the code is still offered for new work. Defaults to true.
When the record was created.
When the record last changed.
Response
The upserted cost code.
One entry in a code list. Cost, union, and per diem codes are three separate lists that share this shape and behave identically.