# Files

> SDK methods for the Files module, accessed via `soat.files`. See the [Files module docs](/docs/modules/files) for permissions and data model, and each method's REST page for the full request/response schema.

# Files

SDK methods for the Files module, accessed via `soat.files`. See the [Files module docs](/docs/modules/files) for permissions and data model, and each method's REST page for the full request/response schema.

### `soat.files.listFiles()`

List all files

- Method: `GET`
- Path: `/api/v1/files`

```ts
await soat.files.listFiles({
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/list-files)

### `soat.files.createFile()`

Create a file

- Method: `POST`
- Path: `/api/v1/files`

```ts
await soat.files.createFile({
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/create-file)

### `soat.files.uploadFile()`

Upload a file

- Method: `POST`
- Path: `/api/v1/files/upload`

```ts
await soat.files.uploadFile({
  body: { file, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/upload-file)

### `soat.files.uploadFileBase64()`

Upload a file using base64 encoding

- Method: `POST`
- Path: `/api/v1/files/upload/base64`

```ts
await soat.files.uploadFileBase64({
  body: { content, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/upload-file-base-64)

### `soat.files.createPresignedUrl()`

Create a presigned upload URL

- Method: `POST`
- Path: `/api/v1/files/presigned-url`

```ts
await soat.files.createPresignedUrl({
  body: { project_id, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/create-presigned-url)

### `soat.files.uploadFileWithToken()`

Upload a file using an upload token

- Method: `POST`
- Path: `/api/v1/files/upload/{token}`

```ts
await soat.files.uploadFileWithToken({
  path: { token },
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/upload-file-with-token)

### `soat.files.getFile()`

Get a file by ID

- Method: `GET`
- Path: `/api/v1/files/{file_id}`

```ts
await soat.files.getFile({
  path: { file_id },
});
```

→ [Request & response schema](/docs/api/files/get-file)

### `soat.files.deleteFile()`

Delete a file

- Method: `DELETE`
- Path: `/api/v1/files/{file_id}`

```ts
await soat.files.deleteFile({
  path: { file_id },
});
```

→ [Request & response schema](/docs/api/files/delete-file)

### `soat.files.downloadFile()`

Download a file

- Method: `GET`
- Path: `/api/v1/files/{file_id}/download`

```ts
await soat.files.downloadFile({
  path: { file_id },
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/download-file)

### `soat.files.updateFileMetadata()`

Update file metadata

- Method: `PATCH`
- Path: `/api/v1/files/{file_id}/metadata`

```ts
await soat.files.updateFileMetadata({
  path: { file_id },
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/update-file-metadata)

### `soat.files.downloadFileBase64()`

Download file as base64

- Method: `GET`
- Path: `/api/v1/files/{file_id}/download/base64`

```ts
await soat.files.downloadFileBase64({
  path: { file_id },
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/files/download-file-base-64)

### `soat.files.getFileTags()`

Get file tags

- Method: `GET`
- Path: `/api/v1/files/{file_id}/tags`

```ts
await soat.files.getFileTags({
  path: { file_id },
});
```

→ [Request & response schema](/docs/api/files/get-file-tags)

### `soat.files.replaceFileTags()`

Replace file tags

- Method: `PUT`
- Path: `/api/v1/files/{file_id}/tags`

```ts
await soat.files.replaceFileTags({
  path: { file_id },
  body,
});
```

→ [Request & response schema](/docs/api/files/replace-file-tags)

### `soat.files.mergeFileTags()`

Merge file tags

- Method: `PATCH`
- Path: `/api/v1/files/{file_id}/tags`

```ts
await soat.files.mergeFileTags({
  path: { file_id },
  body,
});
```

→ [Request & response schema](/docs/api/files/merge-file-tags)
