Introduction
The HTTP API of a BIM.works instance — base URL, the OpenAPI document, request and response conventions, the runnable operation pages, and where the API stops.
Every BIM.works instance serves an OpenAPI 3.1 document and the operations it describes. It is the way in for everything that is not a JavaScript, Java or .NET SDK: curl, a backend in another language, an integration platform, and the generated PHP client. Every operation has a page in this part with a request you can edit and execute.
Base URL and document#
Operations live under <app>/openapi, where <app> is the instance's public URL including its base path. For example: https://bim.works/openapi/ifc/Query, https://client.bim.works/bw/openapi/fs/GetNode. The document is at <app>/openapi.json (also openapi.yaml), and Swagger UI is served next to it with the same document.
Conventions#
- Almost every operation is a
POSTwith a JSON body, and the path is the tag and the operation id:/auth/LoginWithApiToken,/fs/ListNodes,/ifc/Query. TheGETcalls are GetRootNodeUuid and Version. - Field names are snake_case (
node_uuid,version_uuid,response_format); paths in a request are relative to the token's root node. - Models are addressed with a api/schemas#ModelIdentifier: a version, or the latest versions under a node (optionally recursive). Query, check and compare take arrays of them. The schema also has a URL identifier, which is not resolved yet.
- Uploads are
multipart/form-data(UploadModel); AddModelWithUrl fetches the file instead. - An operation that answers in more than one format takes a
formatfield, and each value names its content type in the operation's page: Download (the original file, IFC or ifcXML), Query (records, a count, a selection, a table, or the objects as IFC or ifcXML, output#ifc), Check (results, a summary or BCF), GetCompareResult and ExportCityGML3.formatwins over theAcceptheader, which is only read whenformatis absent: a generated client sendsAccept: application/jsonon every call. - Downloads stream the file (Download, DownloadAsZip).
Downloadconverts an IFC2X3 model to IFC4 when the request names atarget_schema; what the conversion lost and added is counted in the response headers and listed by SchemaConversionReport. - A stored action runs by reference: Query and Check take an
action_uuid(and optionally itsaction_version) instead of the query or check text. That needs read rights on the action and the operation's own Scope, notactions:read. - Calls run synchronously: a transaction (CommitTransaction) returns when the new version exists. Two can answer early instead. An upload with
wait_msanswers202and ajob_uuidwhile the checkin runs, which GetCheckin follows (Upload a model). CompareModels withoptions.wait_msanswers202withstatus: RUNNINGand aresult_uuidwhen the compare is still running after that time; it goes on in the background, and GetCompareResult reads the result later. - Browser calls are answered with the CORS headers the instance is configured for, so a
fetchpreflight succeeds.
Groups#
The rail groups the operations as the OpenAPI document does; a group's name opens its first operation.
| Group | Description | Operations |
|---|---|---|
| Auth - Authentication | Authentication and authorization related calls such as for logging in and creating authentication tokens. | 13 |
| Fs - FileSystem | BIM.works repository's virtual filesystem related calls. | 16 |
| Model | Calls related to models, for example to upload or download models | 12 |
| Versions | Calls related to Versions | 1 |
| IFC - Industry Foundation Classes | IFC related calls, for example queries and model checks | 21 |
| GIS - Geographic Information Systems | GIS related calls, for example to export to CityGML | 6 |
| AI - Artificial Intelligence | Natural-language calls, for example to turn a sentence into a BQL query, a BVL visualisation or a BCL check | 1 |
| Account | The signed-in account: registration, password, sessions and settings | 10 |
| Admin | The administration of an organization: its accounts and features | 3 |
| Actions | Stored queries, checks, visualizations and other actions, which Query and Check run by uuid | 6 |
| Workspaces | Curated views on a folder for visitors of the BIM.works web app, and their share links | 5 |
| Info | General information about the instance | 1 |
| Viewer | What the viewers need to place and load models | 1 |
| Linked data | Files, URLs, texts and identifiers linked to objects, which follow their objects to later Versions | 15 |
Trying an operation#
Every operation page carries an executor: edit the request, press Send, read the status, timing and body. When you are signed in to this instance in the same browser it uses your account's demo API token, so placeholders such as BIM_WORKS_FIRST_MODEL resolve to your demo models; a token pasted into the block is used instead. The example under the executor follows the form, in the language chosen in the bar.
Limits#
The OpenAPI covers the repository operations: authentication, API tokens and delegated tokens, the account and the organization's administration, the node tree, uploads and downloads, queries, checks, comparisons, transactions, the stored actions, workspaces, georeferencing, CityGML and glTF export, renders and BCF snapshots. The task API behind the SDKs has more (the viewer's geometry streams, chat). The result of Query follows the query, so its shape is described in prose (Output) rather than by a schema.