---
title: FsApi
summary: Python SDK: the Fs - FileSystem operations, 16 methods, each with its parameters, result and a complete example.
order: 17
languages: [python]
sdk-package: Python SDK · bimworks
link-terms: true
---

# FsApi

[[page:reference/sdk/python|Python SDK]] · `bimworks` · class · 16 methods

BIM.works repository's virtual filesystem related calls.

Construct it with the client of [[page:reference/sdk/python#connect|the connect step]]: `bimworks.FsApi(client)`. Each method is one operation of the [[page:api|API part]], where it runs on its page.

<table class="dense">
<thead><tr><th>Method</th><th>Operation</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>[[page:reference/sdk/python/fsapi#createnode|create_node]]</code></td><td>[[openapi:CreateNode]]</td><td>Create a new Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#deletenode|delete_node]]</code></td><td>[[openapi:DeleteNode]]</td><td>Delete a Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#deletenodeerror|delete_node_error]]</code></td><td>[[openapi:DeleteNodeError]]</td><td>Clear an error of a Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#deleteversion|delete_version]]</code></td><td>[[openapi:DeleteVersion]]</td><td>Delete a Version of a Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#downloadaszip|download_as_zip]]</code></td><td>[[openapi:DownloadAsZip]]</td><td>Download a folder Node and everything below it as a ZIP file</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#getnode|get_node]]</code></td><td>[[openapi:GetNode]]</td><td>Get Node based on a given path, by its UUID or by the UUID of one of its Versions.</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#getrootnodeuuid|get_root_node_uuid]]</code></td><td>[[openapi:GetRootNodeUuid]]</td><td>Get the UUID of the current root Node.</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#getversion|get_version]]</code></td><td>[[openapi:GetVersion]]</td><td>Get a Version by its UUID</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#listnodeerrors|list_node_errors]]</code></td><td>[[openapi:ListNodeErrors]]</td><td>Get the errors of the given Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#listnodes|list_nodes]]</code></td><td>[[openapi:ListNodes]]</td><td>Get a list of Nodes that are children of the given Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#listnodesrecursive|list_nodes_recursive]]</code></td><td>[[openapi:ListNodesRecursive]]</td><td>Get all Nodes below the given Node, recursively</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#listversions|list_versions]]</code></td><td>[[openapi:ListVersions]]</td><td>Get a list of all the Versions of the given Node, or the given Versions</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#movenode|move_node]]</code></td><td>[[openapi:MoveNode]]</td><td>Move a Node to another parent folder</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#undeletenode|undelete_node]]</code></td><td>[[openapi:UndeleteNode]]</td><td>Restore a previously deleted Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#updatenode|update_node]]</code></td><td>[[openapi:UpdateNode]]</td><td>Update a Node</td></tr>
<tr><td><code>[[page:reference/sdk/python/fsapi#updateversion|update_version]]</code></td><td>[[openapi:UpdateVersion]]</td><td>Change a Version's disciplines or alignment</td></tr>
</tbody>
</table>

## `create_node` {#createnode}

```python
def create_node(self, create_node_request: CreateNodeRequest) -> Node
```

Create a new Node.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:CreateNode]] · <code>POST /openapi/fs/CreateNode</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>create_node_request</code></td><td><code>[[page:reference/sdk/python/models#CreateNodeRequest|CreateNodeRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:CreateNode]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/python/models#Node|Node]]</code> — The new Node

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.CreateNodeRequest.from_json(r"""
{
  "name": "",
  "folder": false,
  "input_file_type": "IFC",
  "parent_node_uuid": "00000000-0000-0000-0000-000000000000",
  "allow_existing": false
}
""")

# 3. The call
result = bimworks.FsApi(client).create_node(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `delete_node` {#deletenode}

```python
def delete_node(self, delete_node_request: DeleteNodeRequest) -> None
```

Delete a Node. Deletes the given Node, named by uuid or by path. This is a soft delete, a deleted Node can be restored with UndeleteNode. The Root Node of the current token cannot be deleted. With if_exists a Node that does not exist is no error.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DeleteNode]] · <code>POST /openapi/fs/DeleteNode</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>delete_node_request</code></td><td><code>[[page:reference/sdk/python/models#DeleteNodeRequest|DeleteNodeRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DeleteNode]]'s request body.</td></tr>
</tbody>
</table>

### Returns

Nothing: the operation answers without a body (The Node was deleted).

### Example

```python
import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.DeleteNodeRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
bimworks.FsApi(client).delete_node(request)

# 4. The result
# (DeleteNode answers no content: the call returns once it succeeded and throws a bimworks.ApiException otherwise)
print("Done")
```

## `delete_node_error` {#deletenodeerror}

```python
def delete_node_error(self, delete_node_error_request: DeleteNodeErrorRequest) -> None
```

Clear an error of a Node. Removes an error record (a failed upload or checkin, see ListNodeErrors) once its cause is dealt with. Needs write rights on the Node.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DeleteNodeError]] · <code>POST /openapi/fs/DeleteNodeError</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>delete_node_error_request</code></td><td><code>[[page:reference/sdk/python/models#DeleteNodeErrorRequest|DeleteNodeErrorRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DeleteNodeError]]'s request body.</td></tr>
</tbody>
</table>

### Returns

Nothing: the operation answers without a body (The error is cleared).

### Example

```python
import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.DeleteNodeErrorRequest.from_json(r"""
{
  "node_uuid": "00000000-0000-0000-0000-000000000000",
  "error_uuid": "00000000-0000-0000-0000-000000000000"
}
""")

# 3. The call
bimworks.FsApi(client).delete_node_error(request)

# 4. The result
# (DeleteNodeError answers no content: the call returns once it succeeded and throws a bimworks.ApiException otherwise)
print("Done")
```

## `delete_version` {#deleteversion}

```python
def delete_version(self, delete_version_request: DeleteVersionRequest) -> None
```

Delete a Version of a Node. Only the last Version of a Node can be deleted, intermediate Versions must stay available.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DeleteVersion]] · <code>POST /openapi/fs/DeleteVersion</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>delete_version_request</code></td><td><code>[[page:reference/sdk/python/models#DeleteVersionRequest|DeleteVersionRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DeleteVersion]]'s request body.</td></tr>
</tbody>
</table>

### Returns

Nothing: the operation answers without a body (The Version was deleted).

### Example

```python
import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.DeleteVersionRequest.from_json(r"""
{
  "node_uuid": "00000000-0000-0000-0000-000000000000",
  "version_uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
bimworks.FsApi(client).delete_version(request)

# 4. The result
# (DeleteVersion answers no content: the call returns once it succeeded and throws a bimworks.ApiException otherwise)
print("Done")
```

## `download_as_zip` {#downloadaszip}

```python
def download_as_zip(self, download_as_zip_request: DownloadAsZipRequest) -> bytes
```

Download a folder Node and everything below it as a ZIP file. The ZIP file contains the original model files of the last Version of every Node below the given folder Node, with their tree paths as ZIP entry paths. With `format` `ZIP_ZST` the same ZIP comes compressed as a whole with zstd, a `.zip.zst` file.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:DownloadAsZip]] · <code>POST /openapi/fs/DownloadAsZip</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>download_as_zip_request</code></td><td><code>[[page:reference/sdk/python/models#DownloadAsZipRequest|DownloadAsZipRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:DownloadAsZip]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>bytes</code> — The ZIP file, or with <code>format</code> <code>ZIP_ZST</code> the zstd-compressed ZIP file

### Example

```python
import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.DownloadAsZipRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "include_deleted": false,
  "format": "ZIP"
}
""")

# 3. The call
result = bimworks.FsApi(client).download_as_zip(request)

# 4. The result
with open("download-as-zip.zip", "wb") as file:
    file.write(result)
```

## `get_node` {#getnode}

```python
def get_node(self, get_node_request: GetNodeRequest) -> Node
```

Get Node based on a given path, by its UUID or by the UUID of one of its Versions. A path is always relative to the Root Node of the used Token.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetNode]] · <code>POST /openapi/fs/GetNode</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>get_node_request</code></td><td><code>[[page:reference/sdk/python/models#GetNodeRequest|GetNodeRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetNode]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/python/models#Node|Node]]</code> — All information of the Node on this path

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.GetNodeRequest.from_json(r"""
{
  "path": "",
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "version_uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
result = bimworks.FsApi(client).get_node(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `get_root_node_uuid` {#getrootnodeuuid}

```python
def get_root_node_uuid(self) -> UUID
```

Get the UUID of the current root Node. This depends on the API Token/Auth Token that is being used.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetRootNodeUuid]] · <code>GET /openapi/fs/GetRootNodeUuid</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

None: the operation takes no request.

### Returns

<code>UUID</code> — The UUID of the Root Node

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
# (GetRootNodeUuid takes no request)

# 3. The call
result = bimworks.FsApi(client).get_root_node_uuid()

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `get_version` {#getversion}

```python
def get_version(self, get_version_request: GetVersionRequest) -> ModelVersion
```

Get a Version by its UUID.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:GetVersion]] · <code>POST /openapi/fs/GetVersion</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>get_version_request</code></td><td><code>[[page:reference/sdk/python/models#GetVersionRequest|GetVersionRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:GetVersion]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/python/models#ModelVersion|ModelVersion]]</code> — Version information

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.GetVersionRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
result = bimworks.FsApi(client).get_version(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `list_node_errors` {#listnodeerrors}

```python
def list_node_errors(self, list_node_errors_request: ListNodeErrorsRequest) -> List[ModelError]
```

Get the errors of the given Node. Model uploads are processed asynchronously. When processing fails, the resulting errors can be retrieved with this call. Errors are sorted oldest first.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListNodeErrors]] · <code>POST /openapi/fs/ListNodeErrors</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>list_node_errors_request</code></td><td><code>[[page:reference/sdk/python/models#ListNodeErrorsRequest|ListNodeErrorsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListNodeErrors]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>List[[[page:reference/sdk/python/models#ModelError|ModelError]]]</code> — The errors of the given Node

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.ListNodeErrorsRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
result = bimworks.FsApi(client).list_node_errors(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `list_nodes` {#listnodes}

```python
def list_nodes(self, list_nodes_request: ListNodesRequest) -> List[Node]
```

Get a list of Nodes that are children of the given Node.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListNodes]] · <code>POST /openapi/fs/ListNodes</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>list_nodes_request</code></td><td><code>[[page:reference/sdk/python/models#ListNodesRequest|ListNodesRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListNodes]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>List[[[page:reference/sdk/python/models#Node|Node]]]</code> — All information of the sub Nodes of the provided Node

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.ListNodesRequest.from_json(r"""
{
  "path": "",
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "version_uuid": "BIM_WORKS_FIRST_MODEL",
  "show_deleted_nodes": false
}
""")

# 3. The call
result = bimworks.FsApi(client).list_nodes(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `list_nodes_recursive` {#listnodesrecursive}

```python
def list_nodes_recursive(self, list_nodes_recursive_request: ListNodesRecursiveRequest) -> List[Node]
```

Get all Nodes below the given Node, recursively. Returns the given Node and all Nodes below it. Use caution on large trees, there is no pagination.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListNodesRecursive]] · <code>POST /openapi/fs/ListNodesRecursive</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>list_nodes_recursive_request</code></td><td><code>[[page:reference/sdk/python/models#ListNodesRecursiveRequest|ListNodesRecursiveRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListNodesRecursive]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>List[[[page:reference/sdk/python/models#Node|Node]]]</code> — The Node and all Nodes below it

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.ListNodesRecursiveRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
result = bimworks.FsApi(client).list_nodes_recursive(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `list_versions` {#listversions}

```python
def list_versions(self, list_versions_request: ListVersionsRequest) -> List[ModelVersion]
```

Get a list of all the Versions of the given Node, or the given Versions. Name the Node with one of path, uuid and version_uuid (a Version of the Node), or pass version_uuids to get those Versions, which may belong to different Nodes. Each Version needs read rights.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListVersions]] · <code>POST /openapi/fs/ListVersions</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>list_versions_request</code></td><td><code>[[page:reference/sdk/python/models#ListVersionsRequest|ListVersionsRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListVersions]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>List[[[page:reference/sdk/python/models#ModelVersion|ModelVersion]]]</code> — All information of the Versions of the given Node, or of the given Versions

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.ListVersionsRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
result = bimworks.FsApi(client).list_versions(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `move_node` {#movenode}

```python
def move_node(self, move_node_request: MoveNodeRequest) -> Node
```

Move a Node to another parent folder. Moves the given Node under a new parent Node. The target Node must be a folder. Renaming is done with UpdateNode.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:MoveNode]] · <code>POST /openapi/fs/MoveNode</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>move_node_request</code></td><td><code>[[page:reference/sdk/python/models#MoveNodeRequest|MoveNodeRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:MoveNode]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/python/models#Node|Node]]</code> — The moved Node

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.MoveNodeRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "target_parent_uuid": "00000000-0000-0000-0000-000000000000"
}
""")

# 3. The call
result = bimworks.FsApi(client).move_node(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `undelete_node` {#undeletenode}

```python
def undelete_node(self, undelete_node_request: UndeleteNodeRequest) -> None
```

Restore a previously deleted Node.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UndeleteNode]] · <code>POST /openapi/fs/UndeleteNode</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>undelete_node_request</code></td><td><code>[[page:reference/sdk/python/models#UndeleteNodeRequest|UndeleteNodeRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:UndeleteNode]]'s request body.</td></tr>
</tbody>
</table>

### Returns

Nothing: the operation answers without a body (The Node was restored).

### Example

```python
import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.UndeleteNodeRequest.from_json(r"""
{
  "uuid": "BIM_WORKS_FIRST_MODEL"
}
""")

# 3. The call
bimworks.FsApi(client).undelete_node(request)

# 4. The result
# (UndeleteNode answers no content: the call returns once it succeeded and throws a bimworks.ApiException otherwise)
print("Done")
```

## `update_node` {#updatenode}

```python
def update_node(self, update_node_request: UpdateNodeRequest) -> Node
```

Update a Node.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UpdateNode]] · <code>POST /openapi/fs/UpdateNode</code></td></tr>
<tr><th>Scope</th><td>[[scope:fs:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>update_node_request</code></td><td><code>[[page:reference/sdk/python/models#UpdateNodeRequest|UpdateNodeRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:UpdateNode]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/python/models#Node|Node]]</code> — The updated Node

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.UpdateNodeRequest.from_json(r"""
{
  "path": "",
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "version_uuid": "BIM_WORKS_FIRST_MODEL",
  "name": "",
  "user_data": {}
}
""")

# 3. The call
result = bimworks.FsApi(client).update_node(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```

## `update_version` {#updateversion}

```python
def update_version(self, update_version_request: UpdateVersionRequest) -> ModelVersion
```

Change a Version's disciplines or alignment. Changes the fields that are passed in one transaction; the others stay as they are. `disciplines: []` clears the disciplines, `clear: [alignment]` the alignment. Needs write rights on the Version.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:UpdateVersion]] · <code>POST /openapi/fs/UpdateVersion</code></td></tr>
<tr><th>Scope</th><td>[[scope:model:write]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>update_version_request</code></td><td><code>[[page:reference/sdk/python/models#UpdateVersionRequest|UpdateVersionRequest]]</code><span class="req">required</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:UpdateVersion]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>[[page:reference/sdk/python/models#ModelVersion|ModelVersion]]</code> — The Version as it is now

### Example

```python
import json

import bimworks

# 1. Connect to BIM.works and log in with your API token
client = bimworks.ApiClient(bimworks.Configuration(host="BIM_WORKS_ADDRESS/openapi"))
auth = bimworks.AuthApi(client).login_with_api_token(
    bimworks.LoginWithApiTokenRequest(token="BIM_WORKS_API_TOKEN"))
client.configuration.access_token = auth.actual_instance.var_base64

# 2. The request
request = bimworks.UpdateVersionRequest.from_json(r"""
{
  "version_uuid": "BIM_WORKS_FIRST_MODEL",
  "disciplines": [
    "STRUCTURAL",
    "ARCHITECTURAL"
  ]
}
""")

# 3. The call
result = bimworks.FsApi(client).update_version(request)

# 4. The result
print(json.dumps(client.sanitize_for_serialization(result), indent=2))
```
