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

# FsApi

[[page:reference/sdk/typescript|TypeScript SDK]] · `@bimworks/sdk` · class · 16 methods

BIM.works repository's virtual filesystem related calls.

Construct it with the client of [[page:reference/sdk/typescript#connect|the connect step]]: `new 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/typescript/fsapi#createnode|createNode]]</code></td><td>[[openapi:CreateNode]]</td><td>Create a new Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#deletenode|deleteNode]]</code></td><td>[[openapi:DeleteNode]]</td><td>Delete a Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#deletenodeerror|deleteNodeError]]</code></td><td>[[openapi:DeleteNodeError]]</td><td>Clear an error of a Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#deleteversion|deleteVersion]]</code></td><td>[[openapi:DeleteVersion]]</td><td>Delete a Version of a Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#downloadaszip|downloadAsZip]]</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/typescript/fsapi#getnode|getNode]]</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/typescript/fsapi#getrootnodeuuid|getRootNodeUuid]]</code></td><td>[[openapi:GetRootNodeUuid]]</td><td>Get the UUID of the current root Node.</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#getversion|getVersion]]</code></td><td>[[openapi:GetVersion]]</td><td>Get a Version by its UUID</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#listnodeerrors|listNodeErrors]]</code></td><td>[[openapi:ListNodeErrors]]</td><td>Get the errors of the given Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#listnodes|listNodes]]</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/typescript/fsapi#listnodesrecursive|listNodesRecursive]]</code></td><td>[[openapi:ListNodesRecursive]]</td><td>Get all Nodes below the given Node, recursively</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#listversions|listVersions]]</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/typescript/fsapi#movenode|moveNode]]</code></td><td>[[openapi:MoveNode]]</td><td>Move a Node to another parent folder</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#undeletenode|undeleteNode]]</code></td><td>[[openapi:UndeleteNode]]</td><td>Restore a previously deleted Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#updatenode|updateNode]]</code></td><td>[[openapi:UpdateNode]]</td><td>Update a Node</td></tr>
<tr><td><code>[[page:reference/sdk/typescript/fsapi#updateversion|updateVersion]]</code></td><td>[[openapi:UpdateVersion]]</td><td>Change a Version's disciplines or alignment</td></tr>
</tbody>
</table>

## `createNode` {#createnode}

```typescript
createNode(requestParameters: { createNodeRequest: CreateNodeRequest }): Promise<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>createNodeRequest</code></td><td><code>[[page:reference/sdk/typescript/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/typescript/models#Node|Node]]</code> — The new Node

### Example

```typescript
import { AuthApi, Configuration, CreateNodeRequestFromJSON, FsApi, NodeToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = CreateNodeRequestFromJSON({
  "name": "",
  "folder": false,
  "input_file_type": "IFC",
  "parent_node_uuid": "00000000-0000-0000-0000-000000000000",
  "allow_existing": false
});

// 3. The call
const result = await new FsApi(client).createNode({ createNodeRequest: request });

// 4. The result
console.log(JSON.stringify(NodeToJSON(result), null, 2));
```

## `deleteNode` {#deletenode}

```typescript
deleteNode(requestParameters: { deleteNodeRequest: DeleteNodeRequest }): Promise<void>
```

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>deleteNodeRequest</code></td><td><code>[[page:reference/sdk/typescript/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

```typescript
import { AuthApi, Configuration, DeleteNodeRequestFromJSON, FsApi } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = DeleteNodeRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
await new FsApi(client).deleteNode({ deleteNodeRequest: request });

// 4. The result
// (DeleteNode answers no content: the call returns once it succeeded and throws a ResponseError otherwise)
console.log("Done");
```

## `deleteNodeError` {#deletenodeerror}

```typescript
deleteNodeError(requestParameters: { deleteNodeErrorRequest: DeleteNodeErrorRequest }): Promise<void>
```

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>deleteNodeErrorRequest</code></td><td><code>[[page:reference/sdk/typescript/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

```typescript
import { AuthApi, Configuration, DeleteNodeErrorRequestFromJSON, FsApi } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = DeleteNodeErrorRequestFromJSON({
  "node_uuid": "00000000-0000-0000-0000-000000000000",
  "error_uuid": "00000000-0000-0000-0000-000000000000"
});

// 3. The call
await new FsApi(client).deleteNodeError({ deleteNodeErrorRequest: request });

// 4. The result
// (DeleteNodeError answers no content: the call returns once it succeeded and throws a ResponseError otherwise)
console.log("Done");
```

## `deleteVersion` {#deleteversion}

```typescript
deleteVersion(requestParameters: { deleteVersionRequest: DeleteVersionRequest }): Promise<void>
```

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>deleteVersionRequest</code></td><td><code>[[page:reference/sdk/typescript/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

```typescript
import { AuthApi, Configuration, DeleteVersionRequestFromJSON, FsApi } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = DeleteVersionRequestFromJSON({
  "node_uuid": "00000000-0000-0000-0000-000000000000",
  "version_uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
await new FsApi(client).deleteVersion({ deleteVersionRequest: request });

// 4. The result
// (DeleteVersion answers no content: the call returns once it succeeded and throws a ResponseError otherwise)
console.log("Done");
```

## `downloadAsZip` {#downloadaszip}

```typescript
downloadAsZip(requestParameters: { downloadAsZipRequest: DownloadAsZipRequest }): Promise<Blob>
```

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>downloadAsZipRequest</code></td><td><code>[[page:reference/sdk/typescript/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>Blob</code> — The ZIP file, or with <code>format</code> <code>ZIP_ZST</code> the zstd-compressed ZIP file

### Example

```typescript
import { writeFileSync } from "node:fs";
import { AuthApi, Configuration, DownloadAsZipRequestFromJSON, FsApi } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = DownloadAsZipRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "include_deleted": false,
  "format": "ZIP"
});

// 3. The call
const result = await new FsApi(client).downloadAsZip({ downloadAsZipRequest: request });

// 4. The result
writeFileSync("download-as-zip.zip", Buffer.from(await result.arrayBuffer()));
```

## `getNode` {#getnode}

```typescript
getNode(requestParameters: { getNodeRequest: GetNodeRequest }): Promise<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>getNodeRequest</code></td><td><code>[[page:reference/sdk/typescript/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/typescript/models#Node|Node]]</code> — All information of the Node on this path

### Example

```typescript
import { AuthApi, Configuration, FsApi, GetNodeRequestFromJSON, NodeToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = GetNodeRequestFromJSON({
  "path": "",
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "version_uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
const result = await new FsApi(client).getNode({ getNodeRequest: request });

// 4. The result
console.log(JSON.stringify(NodeToJSON(result), null, 2));
```

## `getRootNodeUuid` {#getrootnodeuuid}

```typescript
getRootNodeUuid(): Promise<string>
```

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>string</code> — The UUID of the Root Node

### Example

```typescript
import { AuthApi, Configuration, FsApi } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

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

// 3. The call
const result = await new FsApi(client).getRootNodeUuid();

// 4. The result
console.log(result);
```

## `getVersion` {#getversion}

```typescript
getVersion(requestParameters: { getVersionRequest: GetVersionRequest }): Promise<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>getVersionRequest</code></td><td><code>[[page:reference/sdk/typescript/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/typescript/models#ModelVersion|ModelVersion]]</code> — Version information

### Example

```typescript
import { AuthApi, Configuration, FsApi, GetVersionRequestFromJSON, ModelVersionToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = GetVersionRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
const result = await new FsApi(client).getVersion({ getVersionRequest: request });

// 4. The result
console.log(JSON.stringify(ModelVersionToJSON(result), null, 2));
```

## `listNodeErrors` {#listnodeerrors}

```typescript
listNodeErrors(requestParameters: { listNodeErrorsRequest: ListNodeErrorsRequest }): Promise<Array<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>listNodeErrorsRequest</code></td><td><code>[[page:reference/sdk/typescript/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>Array&lt;[[page:reference/sdk/typescript/models#ModelError|ModelError]]&gt;</code> — The errors of the given Node

### Example

```typescript
import { AuthApi, Configuration, FsApi, ListNodeErrorsRequestFromJSON, ModelErrorToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = ListNodeErrorsRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
const result = await new FsApi(client).listNodeErrors({ listNodeErrorsRequest: request });

// 4. The result
console.log(JSON.stringify(result.map(ModelErrorToJSON), null, 2));
```

## `listNodes` {#listnodes}

```typescript
listNodes(requestParameters: { listNodesRequest: ListNodesRequest }): Promise<Array<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>listNodesRequest</code></td><td><code>[[page:reference/sdk/typescript/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>Array&lt;[[page:reference/sdk/typescript/models#Node|Node]]&gt;</code> — All information of the sub Nodes of the provided Node

### Example

```typescript
import { AuthApi, Configuration, FsApi, ListNodesRequestFromJSON, NodeToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = ListNodesRequestFromJSON({
  "path": "",
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "version_uuid": "BIM_WORKS_FIRST_MODEL",
  "show_deleted_nodes": false
});

// 3. The call
const result = await new FsApi(client).listNodes({ listNodesRequest: request });

// 4. The result
console.log(JSON.stringify(result.map(NodeToJSON), null, 2));
```

## `listNodesRecursive` {#listnodesrecursive}

```typescript
listNodesRecursive(requestParameters: { listNodesRecursiveRequest: ListNodesRecursiveRequest }): Promise<Array<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>listNodesRecursiveRequest</code></td><td><code>[[page:reference/sdk/typescript/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>Array&lt;[[page:reference/sdk/typescript/models#Node|Node]]&gt;</code> — The Node and all Nodes below it

### Example

```typescript
import { AuthApi, Configuration, FsApi, ListNodesRecursiveRequestFromJSON, NodeToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = ListNodesRecursiveRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
const result = await new FsApi(client).listNodesRecursive({ listNodesRecursiveRequest: request });

// 4. The result
console.log(JSON.stringify(result.map(NodeToJSON), null, 2));
```

## `listVersions` {#listversions}

```typescript
listVersions(requestParameters: { listVersionsRequest: ListVersionsRequest }): Promise<Array<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>listVersionsRequest</code></td><td><code>[[page:reference/sdk/typescript/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>Array&lt;[[page:reference/sdk/typescript/models#ModelVersion|ModelVersion]]&gt;</code> — All information of the Versions of the given Node, or of the given Versions

### Example

```typescript
import { AuthApi, Configuration, FsApi, ListVersionsRequestFromJSON, ModelVersionToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = ListVersionsRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
const result = await new FsApi(client).listVersions({ listVersionsRequest: request });

// 4. The result
console.log(JSON.stringify(result.map(ModelVersionToJSON), null, 2));
```

## `moveNode` {#movenode}

```typescript
moveNode(requestParameters: { moveNodeRequest: MoveNodeRequest }): Promise<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>moveNodeRequest</code></td><td><code>[[page:reference/sdk/typescript/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/typescript/models#Node|Node]]</code> — The moved Node

### Example

```typescript
import { AuthApi, Configuration, FsApi, MoveNodeRequestFromJSON, NodeToJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = MoveNodeRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "target_parent_uuid": "00000000-0000-0000-0000-000000000000"
});

// 3. The call
const result = await new FsApi(client).moveNode({ moveNodeRequest: request });

// 4. The result
console.log(JSON.stringify(NodeToJSON(result), null, 2));
```

## `undeleteNode` {#undeletenode}

```typescript
undeleteNode(requestParameters: { undeleteNodeRequest: UndeleteNodeRequest }): Promise<void>
```

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>undeleteNodeRequest</code></td><td><code>[[page:reference/sdk/typescript/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

```typescript
import { AuthApi, Configuration, FsApi, UndeleteNodeRequestFromJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = UndeleteNodeRequestFromJSON({
  "uuid": "BIM_WORKS_FIRST_MODEL"
});

// 3. The call
await new FsApi(client).undeleteNode({ undeleteNodeRequest: request });

// 4. The result
// (UndeleteNode answers no content: the call returns once it succeeded and throws a ResponseError otherwise)
console.log("Done");
```

## `updateNode` {#updatenode}

```typescript
updateNode(requestParameters: { updateNodeRequest: UpdateNodeRequest }): Promise<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>updateNodeRequest</code></td><td><code>[[page:reference/sdk/typescript/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/typescript/models#Node|Node]]</code> — The updated Node

### Example

```typescript
import { AuthApi, Configuration, FsApi, NodeToJSON, UpdateNodeRequestFromJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = UpdateNodeRequestFromJSON({
  "path": "",
  "uuid": "BIM_WORKS_FIRST_MODEL",
  "version_uuid": "BIM_WORKS_FIRST_MODEL",
  "name": "",
  "user_data": {}
});

// 3. The call
const result = await new FsApi(client).updateNode({ updateNodeRequest: request });

// 4. The result
console.log(JSON.stringify(NodeToJSON(result), null, 2));
```

## `updateVersion` {#updateversion}

```typescript
updateVersion(requestParameters: { updateVersionRequest: UpdateVersionRequest }): Promise<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>updateVersionRequest</code></td><td><code>[[page:reference/sdk/typescript/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/typescript/models#ModelVersion|ModelVersion]]</code> — The Version as it is now

### Example

```typescript
import { AuthApi, Configuration, FsApi, ModelVersionToJSON, UpdateVersionRequestFromJSON } from "@bimworks/sdk";

// 1. Connect to BIM.works and log in with your API token
const basePath = "BIM_WORKS_ADDRESS/openapi";
const auth = await new AuthApi(new Configuration({ basePath }))
  .loginWithApiToken({ loginWithApiTokenRequest: { token: "BIM_WORKS_API_TOKEN" } });
const client = new Configuration({ basePath, accessToken: typeof auth === "string" ? auth : auth.base64 });

// 2. The request
const request = UpdateVersionRequestFromJSON({
  "version_uuid": "BIM_WORKS_FIRST_MODEL",
  "disciplines": [
    "STRUCTURAL",
    "ARCHITECTURAL"
  ]
});

// 3. The call
const result = await new FsApi(client).updateVersion({ updateVersionRequest: request });

// 4. The result
console.log(JSON.stringify(ModelVersionToJSON(result), null, 2));
```
