Skip to main content

Files

SDK methods for the Files module, accessed via soat.files. See the Files module docs 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
await soat.files.listFiles({
query: { /* + optional */ },
});

Request & response schema

soat.files.createFile()

Create a file

  • Method: POST
  • Path: /api/v1/files
await soat.files.createFile({
body: { /* + optional */ },
});

Request & response schema

soat.files.uploadFile()

Upload a file

  • Method: POST
  • Path: /api/v1/files/upload
await soat.files.uploadFile({
body: { file, /* + optional */ },
});

Request & response schema

soat.files.uploadFileBase64()

Upload a file using base64 encoding

  • Method: POST
  • Path: /api/v1/files/upload/base64
await soat.files.uploadFileBase64({
body: { content, /* + optional */ },
});

Request & response schema

soat.files.createPresignedUrl()

Create a presigned upload URL

  • Method: POST
  • Path: /api/v1/files/presigned-url
await soat.files.createPresignedUrl({
body: { project_id, /* + optional */ },
});

Request & response schema

soat.files.uploadFileWithToken()

Upload a file using an upload token

  • Method: POST
  • Path: /api/v1/files/upload/{token}
await soat.files.uploadFileWithToken({
path: { token },
body: { /* + optional */ },
});

Request & response schema

soat.files.getFile()

Get a file by ID

  • Method: GET
  • Path: /api/v1/files/{file_id}
await soat.files.getFile({
path: { file_id },
});

Request & response schema

soat.files.deleteFile()

Delete a file

  • Method: DELETE
  • Path: /api/v1/files/{file_id}
await soat.files.deleteFile({
path: { file_id },
});

Request & response schema

soat.files.downloadFile()

Download a file

  • Method: GET
  • Path: /api/v1/files/{file_id}/download
await soat.files.downloadFile({
path: { file_id },
});

Request & response schema

soat.files.updateFileMetadata()

Update file metadata

  • Method: PATCH
  • Path: /api/v1/files/{file_id}/metadata
await soat.files.updateFileMetadata({
path: { file_id },
body: { /* + optional */ },
});

Request & response schema

soat.files.downloadFileBase64()

Download file as base64

  • Method: GET
  • Path: /api/v1/files/{file_id}/download/base64
await soat.files.downloadFileBase64({
path: { file_id },
});

Request & response schema

soat.files.getFileTags()

Get file tags

  • Method: GET
  • Path: /api/v1/files/{file_id}/tags
await soat.files.getFileTags({
path: { file_id },
});

Request & response schema

soat.files.replaceFileTags()

Replace file tags

  • Method: PUT
  • Path: /api/v1/files/{file_id}/tags
await soat.files.replaceFileTags({
path: { file_id },
body,
});

Request & response schema

soat.files.mergeFileTags()

Merge file tags

  • Method: PATCH
  • Path: /api/v1/files/{file_id}/tags
await soat.files.mergeFileTags({
path: { file_id },
body,
});

Request & response schema