CommitTransaction
Commit a BUL transaction against the head Version of a Node, producing a new Version
/openapi/ifc/CommitTransaction
Applies one or more BUL (BIM.works Update Language) statements to the given Version and creates a new Version on the same Node. The given Version must be the head (latest) Version of its Node: history is linear, and committing against an older Version fails with 409. The commit is atomic (either the complete new Version is created, or nothing is) and synchronous: the new Version is ready when the call returns.
Statements: SET <feature> = <value>, ... WHERE <bql>, DEL <feature>, ... WHERE <bql>,
DELETE OBJECT WHERE <bql>, and TRANSFORM MOVE(x, y, z) ROTATE(AXIS(x, y, z), angle, PIVOT(x, y, z)) WHERE <bql> — a rigid world-space move and/or rotate of the matched products' placements
(coordinates default to mm with an optional length unit, angles in degrees; at least one of MOVE/ROTATE
is required, the PIVOT defaults to each object's placement origin). Objects placed relative to a
transformed object move with it.
The value of a SET is a literal, or a feature of each object, SET quantity.BaseQuantities.NetVolume = calculated.quantity.netVolume WHERE ...: read per object from the given Version (never from what an
earlier statement of the transaction wrote) and converted like a literal with its unit; an object without
that value is left alone.
GEOREFERENCE CRS "EPSG:<code>" ORIGIN (e, n, h) XAXIS (abscissa, ordinate) | ROTATION <degrees> [GRIDSCALE g] [CRSDESCRIPTION "..."] [GEODETICDATUM "..."] [VERTICALDATUM "..."] [MAPPROJECTION "..."] [MAPZONE "..."] writes the model's georeference into its IFC data: an IfcMapConversion with an
IfcProjectedCRS (map unit the CRS's own, usually the metre) on the 3D 'Model' context, created or overwritten. ORIGIN is the map
position of the model's origin, in metres unless a length unit is given; XAXIS is the direction of the
model's X axis in the map, ROTATION the same as an angle counter-clockwise from east. The CRS must be a
projected EPSG system (a system in feet gets a foot map unit), and the model IFC4 or later (convert an IFC2X3 model with CONVERT SCHEMA TO IFC4 first). The new Version's stored geo reference is computed from the written conversion.
GEOREFERENCE REMOVE deletes the conversion. Neither takes a WHERE.
With dry_run: true the statements are resolved and applied in memory only. Nothing is persisted, and the
response reports per update how many objects the WHERE clause matches and how many of those would actually
change (a SET to a value an object already has is matched but not changed). Dry runs work against any
Version, not only the head; is_head in the response tells whether a real commit would be accepted.
With include_oids: true as well, every update also names its statement (statement_index,
statement_lines) and the objects themselves: matched_oids and changed_oids, for showing them before
committing.
Requires write access to the Node. For scoped tokens, the token's tasks must include CommitTransaction.
Every statement other than CONVERT SCHEMA and GEOREFERENCE also needs the user feature BUL (Model
editing), dry runs included: without it the call answers 403 USER_FEATURE_REQUIRED.
Try it#
Edit the request and send it; it runs against this instance with your token, and the examples follow the form.
Bearer <auth token>application/jsonAuthorization: Bearer <auth token>
Content-Type: application/json
Accept: application/jsoncurl -X POST "$BIMWORKS_URL/openapi/ifc/CommitTransaction" \
-H "Authorization: Bearer $BIMWORKS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"version_uuid": "BIM_WORKS_FIRST_MODEL",
"bul": [
"SET attribute.Name = \"Standard door\" WHERE type = IFCDOOR"
],
"comment": "Normalize door names"
}'Examples#
curl -X POST "$BIMWORKS_URL/openapi/ifc/CommitTransaction" \
-H "Authorization: Bearer $BIMWORKS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"version_uuid": "BIM_WORKS_FIRST_MODEL",
"bul": [
"SET attribute.Name = \"Standard door\" WHERE type = IFCDOOR"
],
"comment": "Normalize door names"
}'The examples are complete programs in the OpenAPI SDKs, all in the same four steps. The method in each SDK's reference: Java · .NET · TypeScript · PHP · Python.
Request body#
CommitTransactionRequest · application/json
| Field | Type | Description |
|---|---|---|
version_uuid | uuidrequired | The UUID of the Version to apply the transaction to. Must be the head Version of its Node (dry runs excepted) |
bul | array of stringrequired | The BUL statements to apply, in order, as one atomic transaction |
comment | stringoptional | A description of the intent of the transaction, stored with the transaction and shown in the Version history |
dry_run | booleanoptional | When true, the updates are resolved and applied in memory only and the response reports what a commit would do, without persisting anything Default false. |
include_oids | booleanoptional | Dry run only. When true, every update in the response also carries statement_index, statement_lines, matched_oids and changed_oids Default false. |
Responses#
| Status | Schema | Description |
|---|---|---|
200 | CommitTransactionResult | The transaction result. For a commit: transaction and node. For a dry run: updates, is_head and (only when the Version is not the head) head_version |
400 | ErrorResponse | Invalid input: a missing or invalid argument, an invalid query/identifier/path, a state conflict caused by the request (for example a Node name that already exists), or an uploaded file that was rejected because it cannot be read (type for example INVALID_INPUT_FILE, NO_CONVERTIBLE_CONTENT or one of the StepParserErrorCode codes; uploading the same file again fails the same way) |
401 | ErrorResponse | Authentication failed: the bearer token is missing, malformed, expired or otherwise invalid, or the provided login credentials are incorrect |
403 | ErrorResponse | Authenticated, but not allowed: no read/write rights on the target Node, the token's task or IP scope does not allow this call, or a required user feature is missing |
404 | ErrorResponse | The referenced entity (Node, Version, model file, upload, ...) does not exist |
409 | ErrorResponse | The request conflicts with the current state: for example a transaction commit against a Version that is no longer the head of its Node |
429 | ErrorResponse | Too many requests from this client in a short time, on an installation that limits the request rate. Wait the number of seconds in Retry-After before trying again |
500 | ErrorResponse | An unexpected server-side error (database, routing, IO, unknown) |
503 | ErrorResponse | BIM.works is temporarily unavailable: it is restarting, stopped, or down for scheduled maintenance (type SERVICE_UNAVAILABLE or MAINTENANCE). Wait the number of seconds in Retry-After before trying again |
504 | ErrorResponse | BIM.works did not respond in time (type REQUEST_TIMED_OUT). The request may still be completed: check its result before trying again |