DocsCloud SDK reference

This reference is currently available in English. The Cloud console remains in your selected language.

BEEOS CLOUD / DEVELOPER REFERENCE

Files

Presigned uploads, file metadata, share links, and the file summary.

Overview

The files domain stores and shares files: it prepares presigned uploads, confirms them, lists and reads file metadata, renames and deletes files, manages file share links, and returns a file summary.

11 operations · SDK resource: TypeScript cloud.files · Python cloud.files · Go cloud.Files · API overview

Main objects

FilePrepareUploadInput

FieldTypeRequiredDescription
upload_contextFileChatUploadContextnoTies the upload to an instance and optionally an agent. The credential's organization and app own the file. Omit the context for a plain upload. Nullable.
filenamestringyesName of the file, 1 to 255 characters, without leading or trailing whitespace and without /, \ or control characters.
content_typestringyesMIME type of the file, at most 255 characters and without control characters. The uploaded content must carry this type.
size_bytesintegeryesSize of the file in bytes, from 1 to 104857600 (100 MiB). The uploaded content must have exactly this size.
checksum_sha256stringnoLowercase hex SHA-256 digest of the content (64 characters). Optional. When sent, the uploaded content must match it and the confirmation verifies it.

Every field, and the methods that use this object: appendix.

FileTransferDescriptor

FieldTypeRequiredDescription
directionstringyesWhether the URL is used to upload or to download the file content. Allowed values: "upload" — Send the file content to url with http_method. Returned when an upload is prepared; "download" — Fetch the file content from url with http_method. Returned when a file or a share is read. (enum table)
file_idstringyesID of the file the transfer is for.
urlstringyesPre-signed URL to transfer the file content with. The URL is already signed, so do not send your API key to it.
http_methodstringyesHTTP method to use with url: PUT for an upload, GET for a download.
required_headersmap<string, string>yesHeaders to send with the transfer request exactly as given. Empty when none are required.
expires_atstringyesTime the URL stops working, as an RFC 3339 timestamp. Upload URLs are valid for 15 minutes and download URLs for 5 minutes. Constraints: format=date-time.
content_typestringyesMIME type of the file.
size_bytesintegeryesSize of the file in bytes.
checksum_sha256stringnoLowercase hex SHA-256 digest of the file content. Omitted when no digest is known.

Every field, and the methods that use this object: appendix.

FileConfirmInput

FieldTypeRequiredDescription
checksum_sha256stringnoLowercase hex SHA-256 digest of the uploaded content (64 characters). Optional. When sent, it is compared with the digest of the stored object and a difference fails the confirmation with 409 checksum_mismatch.

Every field, and the methods that use this object: appendix.

FileFile

FieldTypeRequiredDescription
file_idstringyesUnique ID of the file.
filenamestringyesName of the file, without a path.
content_typestringyesMIME type of the file, for example image/png.
size_bytesintegeryesSize of the file in bytes.
checksum_sha256stringnoLowercase hex SHA-256 digest of the file content. Empty when no checksum was supplied at upload and none was recorded for the object.
statusstringyesUpload state of the file. Deleted files are never returned. New states can be added, so ignore values you do not know. Allowed values: "pending_upload" — The upload was prepared but not confirmed yet. The file has no content to download; "ready" — The upload was confirmed. The file can be downloaded, renamed, shared and deleted. (enum table)
resource_versionintegeryesVersion of the file record. It starts at 1 and increases when the upload is confirmed and when the file is renamed or deleted.
updated_atstringyesTime the file was last changed: created, confirmed or renamed, whichever is latest. RFC 3339 timestamp. Constraints: format=date-time.
titlestringnoTitle read from the document's own metadata. It is extracted for PDF, docx, xlsx and pptx files of up to 8 MiB the first time the file is read by ID, and omitted when the document has no usable title.
file_typestringyesCategory of the file, derived from its MIME type and, for generic types such as application/octet-stream, from its extension. Allowed values: see the table below, FileFile.file_type values.
created_atstringyesTime the file record was created, when the upload was prepared. RFC 3339 timestamp. Constraints: format=date-time.
confirmed_atstringnoTime the upload was confirmed. Omitted until the file is ready. RFC 3339 timestamp. Nullable. Constraints: format=date-time.
originFileOriginnoWhere the file came from, with the instance and agent it belongs to. Nullable.

FileFile.file_type values

ValueMeaning
"FILE_TYPE_IMAGE"An image, for example PNG, JPEG, GIF, WebP or SVG.
"FILE_TYPE_VIDEO"A video, for example MP4, MOV or WebM.
"FILE_TYPE_AUDIO"An audio file, for example MP3, WAV or FLAC.
"FILE_TYPE_DOCUMENT"A text or office document, for example plain text, Markdown, JSON, PDF, Word, Excel, PowerPoint or OpenDocument.
"FILE_TYPE_ARCHIVE"A compressed or packed archive, for example ZIP, TAR, GZIP, 7z or RAR.
"FILE_TYPE_OTHER"Any other file.

Every field, and the methods that use this object: appendix.

FilePage

FieldTypeRequiredDescription
dataarray<FileFile>yesFiles on this page.
totalintegeryesNumber of files that match the query, across all pages.
next_sincestringnoCursor to pass as since to get the next page. Returned only by the default chronological listing, and only when more files follow. Filtered or sorted listings page with offset instead.

Every field, and the methods that use this object: appendix.

FileResolution

FieldTypeRequiredDescription
fileFileFileyesThe file.
downloadFileTransferDescriptoryesPre-signed descriptor to download the content with. While the file is still pending_upload it carries no usable URL.

Every field, and the methods that use this object: appendix.

FileSummary

FieldTypeRequiredDescription
file_countintegeryesNumber of ready files.
storage_file_countintegeryesNumber of ready files that count toward storage. Files provided by template skills are not counted.
used_bytesintegeryesTotal size in bytes of the files that count toward storage.
image_countintegeryesNumber of ready files in the FILE_TYPE_IMAGE category.
video_countintegeryesNumber of ready files in the FILE_TYPE_VIDEO category.
document_countintegeryesNumber of ready files in the FILE_TYPE_DOCUMENT category.
instancesarray<object>yesReady files grouped by the agent they belong to, or by instance when they have no agent, largest group first.
instances[].sourcestringyesHow the file came to exist. New values can be added, so ignore values you do not know. Allowed values: "manual" — Uploaded directly through the files API without an upload context. Files without a recorded origin are reported as manual; "chat_upload" — Uploaded with an upload_context, to be used in a conversation with the agent named by it; "runtime_generated" — Generated by an agent while it handled a request. operation_id identifies that operation; "template_skill" — Provided by a template skill. The file is read-only: it cannot be renamed or deleted, and it does not count toward storage usage. (enum table)
instances[].instance_idstringnoID of the instance the file belongs to. Omitted for files that are not tied to an instance.
instances[].agent_idstringnoID of the agent the file belongs to. Omitted for files that are not tied to an agent.
instances[].operation_idstringnoID of the agent operation that generated the file. Set only when source is runtime_generated.
instances[].instance_namestringnoCurrent display name of the instance, filled in when the file is returned. Omitted for files without an instance.
instances[].agent_namestringnoCurrent display name of the agent, filled in when the file is returned. Omitted for files without an agent.
instances[].avatar_urlstringnoURL of the agent avatar. Omitted for files without an agent.
instances[].harnessstringnoHarness the instance runs, for example openclaw. Omitted for files without an instance.
instances[].destroyedbooleannoTrue when the instance has been terminated or deleted. The file stays available. Omitted when false.
instances[].countintegeryesNumber of ready files in this group.

Every field, and the methods that use this object: appendix.

FileShareResponse

FieldTypeRequiredDescription
file_idstringyesID of the shared file.
slugstringyesPublic slug of the share. Pass it to the resolve-share operation to get the file.
filenamestringyesCurrent name of the shared file.
content_typestringyesMIME type of the shared file.
size_bytesintegeryesSize of the shared file in bytes.
revokedbooleanyesTrue when the share was revoked. A revoked share can no longer be resolved. Creating the share again turns it back on.

Every field, and the methods that use this object: appendix.

Typical flow

  1. Ask for an upload with files.prepareUpload and transfer the file's bytes with the returned descriptor.
  2. Confirm it with files.confirmUpload.
  3. Find files with files.list and files.get; rename with files.rename; remove with files.delete.
  4. Share a file with files.createShare and read the link with files.getShare; anyone with the slug opens it through files.resolveShare; withdraw it with files.revokeShare.
  5. files.getSummary returns the overall file summary.

Methods

MethodHTTPSummary
files.resolveShareGET /v1/file-shares/{slug}Resolve a file share link
files.listGET /v1/filesList files
files.getGET /v1/files/{fileId}Get a file
files.renamePATCH /v1/files/{fileId}Rename a file
files.deleteDELETE /v1/files/{fileId}Delete a file
files.confirmUploadPOST /v1/files/{fileId}/confirmConfirm a file upload
files.getShareGET /v1/files/{fileId}/shareGet a file share link
files.createSharePOST /v1/files/{fileId}/shareCreate a file share link
files.revokeShareDELETE /v1/files/{fileId}/shareRevoke a file share link
files.prepareUploadPOST /v1/files/presign-uploadCreate a file upload URL
files.getSummaryGET /v1/files/summaryGet the file summary

files.resolveShare

GET /v1/file-shares/{slug} · Operation ID resolveFileShare

Resolve a file share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.resolveShareresolveShare(slug: string): Promise<Models.ResolveFileShareResponse>
Pythoncloud.files.resolve_sharedef resolve_share(self, slug: str) -> ResolveFileShareResponse
Gocloud.Files.ResolveSharefunc (r *FilesResource) ResolveShare(ctx context.Context, slug string) (ResolveFileShareResponse, error)

Parameters

ParameterInTypeRequiredDescription
slugpathstringyesPublic slug of the file share, the slug returned when the share was created.

Response

200 · application/json

FieldTypeRequiredDescription
file_idstringyes—
slugstringyes—
filenamestringyes—
content_typestringyes—
size_bytesintegeryes—
downloadFileTransferDescriptoryes—

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.resolveShare("share_slug");
console.log(result);

files.list

GET /v1/files · Operation ID listFiles

List files

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.listlist(query?: Models.ListFilesQuery): Promise<Models.ListFilesResponse>
Pythoncloud.files.listdef list(self, options: ListFilesOptions | None = None) -> FilePage
Gocloud.Files.Listfunc (r *FilesResource) List(ctx context.Context, options ListFilesOptions) (FilePage, error)

Parameters

ParameterInTypeRequiredDescription
content_typequerystringnoReturn only files with exactly this MIME type, at most 255 characters.
sincequerystringnoCursor from next_since of the previous page. Omit it to start at the oldest file. It applies only to the default chronological listing, that is when none of status, file_type, category, source, q, instance_id, agent_id, sort, sort_dir and offset is set. At most 2048 characters.
statusquerystringnoReturn only files in this state: ready or pending_upload. When omitted, files in both states are returned.
file_typequerystringnoReturn only files in this category: FILE_TYPE_IMAGE, FILE_TYPE_VIDEO, FILE_TYPE_AUDIO, FILE_TYPE_DOCUMENT, FILE_TYPE_ARCHIVE or FILE_TYPE_OTHER.
categoryquerystringnoReturn only files in a broad category: image, video, document or other. other covers every file that is not an image, a video or a document, including audio and archives.
sourcequerystringnoReturn only files with this origin: manual, chat_upload, runtime_generated or template_skill. Files without a recorded origin count as manual.
qquerystringnoReturn only files whose name contains this text, compared case-insensitively.
instance_idquerystringnoReturn only files that belong to this instance.
agent_idquerystringnoReturn only files that belong to this agent.
sortquerystringnoField to sort by: created_at (the default), updated_at, file_name or size_bytes. Ties are ordered by file ID. Any sort, filter or offset switches the listing to offset paging.
sort_dirquerystringnoSort direction: asc or desc. When sorting or filtering the default is desc; the default chronological listing is oldest first.
limitqueryintegernoMaximum number of files to return, from 0 to 200. Defaults to 50.
offsetqueryintegernoNumber of matching files to skip, 0 or more. Setting it switches the listing to offset paging.

Response

200 · application/json · Schema: FilePage

FieldTypeRequiredDescription
dataarray<FileFile>yesFiles on this page.
totalintegeryesNumber of files that match the query, across all pages.
next_sincestringnoCursor to pass as since to get the next page. Returned only by the default chronological listing, and only when more files follow. Filtered or sorted listings page with offset instead.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.list();
console.log(result);

files.get

GET /v1/files/{fileId} · Operation ID getFile

Get a file

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.getget(fileId: string): Promise<Models.GetFileResponse>
TypeScriptcloud.files.resolveDownloadresolveDownload(fileId: string)
TypeScriptcloud.files.downloaddownload(fileId: string)
Pythoncloud.files.getdef get(self, file_id: str) -> FileResolution
Gocloud.Files.Getfunc (r *FilesResource) Get(ctx context.Context, fileId string) (FileResolution, error)

cloud.files.resolveDownload: Calls GET /files/{fileId} through the untyped client.request; the declared return type is inferred as Promise<JSONValue>. Use files.get for the typed result.

cloud.files.download: Alias of files.resolveDownload(fileId); the declared return type is inferred as Promise<JSONValue>.

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.

Response

200 · application/json · Schema: FileResolution

FieldTypeRequiredDescription
fileFileFileyesThe file.
downloadFileTransferDescriptoryesPre-signed descriptor to download the content with. While the file is still pending_upload it carries no usable URL.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.get("file_123");
console.log(result);

files.rename

PATCH /v1/files/{fileId} · Operation ID renameFile

Rename a file

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.renamerename(fileId: string, input: Models.RenameFileRequest): Promise<Models.RenameFileResponse>
Pythoncloud.files.renamedef rename(self, file_id: str, input: RenameFileRequest) -> FileFile
Gocloud.Files.Renamefunc (r *FilesResource) Rename(ctx context.Context, fileId string, input RenameFileRequest) (FileFile, error)

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.

Request body

application/json · required

FieldTypeRequiredDescription
titlestringyesNew name of the file, 1 to 255 characters, without leading or trailing whitespace and without /, \ or control characters.

Response

200 · application/json · Schema: FileFile

FieldTypeRequiredDescription
file_idstringyesUnique ID of the file.
filenamestringyesName of the file, without a path.
content_typestringyesMIME type of the file, for example image/png.
size_bytesintegeryesSize of the file in bytes.
checksum_sha256stringnoLowercase hex SHA-256 digest of the file content. Empty when no checksum was supplied at upload and none was recorded for the object.
statusstringyesUpload state of the file. Deleted files are never returned. New states can be added, so ignore values you do not know. Allowed values: "pending_upload" — The upload was prepared but not confirmed yet. The file has no content to download; "ready" — The upload was confirmed. The file can be downloaded, renamed, shared and deleted. (enum table)
resource_versionintegeryesVersion of the file record. It starts at 1 and increases when the upload is confirmed and when the file is renamed or deleted.
updated_atstringyesTime the file was last changed: created, confirmed or renamed, whichever is latest. RFC 3339 timestamp. Constraints: format=date-time.
titlestringnoTitle read from the document's own metadata. It is extracted for PDF, docx, xlsx and pptx files of up to 8 MiB the first time the file is read by ID, and omitted when the document has no usable title.
file_typestringyesCategory of the file, derived from its MIME type and, for generic types such as application/octet-stream, from its extension. Allowed values: see FileFile.file_type values.
created_atstringyesTime the file record was created, when the upload was prepared. RFC 3339 timestamp. Constraints: format=date-time.
confirmed_atstringnoTime the upload was confirmed. Omitted until the file is ready. RFC 3339 timestamp. Nullable. Constraints: format=date-time.
originFileOriginnoWhere the file came from, with the instance and agent it belongs to. Nullable.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.rename("file_123", { title: "example_title" });
console.log(result);

files.delete

DELETE /v1/files/{fileId} · Operation ID deleteFile

Delete a file

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.deletedelete(fileId: string, idempotencyKey: string): Promise<Models.DeleteFileResponse>
Pythoncloud.files.deletedef delete(self, file_id: str, options: DeleteFileOptions) -> None
Gocloud.Files.Deletefunc (r *FilesResource) Delete(ctx context.Context, fileId string, options DeleteFileOptions) error

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.
Idempotency-KeyheaderstringyesKey that makes the request safe to retry, 8 to 128 characters without leading or trailing whitespace. Repeating a request with the same key and parameters replays the original result; reusing the key for a different request returns 409 idempotency_conflict.

Response

204

No response body.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.delete("file_123", "YOUR_IDEMPOTENCY_KEY");
console.log(result);

files.confirmUpload

POST /v1/files/{fileId}/confirm · Operation ID confirmFileUpload

Confirm a file upload

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.confirmUploadconfirmUpload(fileId: string, input: Models.FileConfirmInput, idempotencyKey: string): Promise<Models.ConfirmFileUploadResponse>
Pythoncloud.files.confirm_uploaddef confirm_upload(self, file_id: str, input: FileConfirmInput, options: ConfirmFileUploadOptions) -> FileFile
Gocloud.Files.ConfirmUploadfunc (r *FilesResource) ConfirmUpload(ctx context.Context, fileId string, input FileConfirmInput, options ConfirmFileUploadOptions) (FileFile, error)

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.
Idempotency-KeyheaderstringyesKey that makes the request safe to retry, 8 to 128 characters without leading or trailing whitespace. Repeating a request with the same key and parameters replays the original result; reusing the key for a different request returns 409 idempotency_conflict.

Request body

application/json · required · Schema: FileConfirmInput

FieldTypeRequiredDescription
checksum_sha256stringnoLowercase hex SHA-256 digest of the uploaded content (64 characters). Optional. When sent, it is compared with the digest of the stored object and a difference fails the confirmation with 409 checksum_mismatch.

Response

200 · application/json · Schema: FileFile

FieldTypeRequiredDescription
file_idstringyesUnique ID of the file.
filenamestringyesName of the file, without a path.
content_typestringyesMIME type of the file, for example image/png.
size_bytesintegeryesSize of the file in bytes.
checksum_sha256stringnoLowercase hex SHA-256 digest of the file content. Empty when no checksum was supplied at upload and none was recorded for the object.
statusstringyesUpload state of the file. Deleted files are never returned. New states can be added, so ignore values you do not know. Allowed values: "pending_upload" — The upload was prepared but not confirmed yet. The file has no content to download; "ready" — The upload was confirmed. The file can be downloaded, renamed, shared and deleted. (enum table)
resource_versionintegeryesVersion of the file record. It starts at 1 and increases when the upload is confirmed and when the file is renamed or deleted.
updated_atstringyesTime the file was last changed: created, confirmed or renamed, whichever is latest. RFC 3339 timestamp. Constraints: format=date-time.
titlestringnoTitle read from the document's own metadata. It is extracted for PDF, docx, xlsx and pptx files of up to 8 MiB the first time the file is read by ID, and omitted when the document has no usable title.
file_typestringyesCategory of the file, derived from its MIME type and, for generic types such as application/octet-stream, from its extension. Allowed values: see FileFile.file_type values.
created_atstringyesTime the file record was created, when the upload was prepared. RFC 3339 timestamp. Constraints: format=date-time.
confirmed_atstringnoTime the upload was confirmed. Omitted until the file is ready. RFC 3339 timestamp. Nullable. Constraints: format=date-time.
originFileOriginnoWhere the file came from, with the instance and agent it belongs to. Nullable.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.confirmUpload("file_123", {}, "YOUR_IDEMPOTENCY_KEY");
console.log(result);

files.getShare

GET /v1/files/{fileId}/share · Operation ID getShareFileShare

Get a file share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.getSharegetShare(fileId: string): Promise<Models.GetShareFileShareResponse>
Pythoncloud.files.get_sharedef get_share(self, file_id: str) -> FileShareResponse
Gocloud.Files.GetSharefunc (r *FilesResource) GetShare(ctx context.Context, fileId string) (FileShareResponse, error)

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.

Response

200 · application/json · Schema: FileShareResponse

FieldTypeRequiredDescription
file_idstringyesID of the shared file.
slugstringyesPublic slug of the share. Pass it to the resolve-share operation to get the file.
filenamestringyesCurrent name of the shared file.
content_typestringyesMIME type of the shared file.
size_bytesintegeryesSize of the shared file in bytes.
revokedbooleanyesTrue when the share was revoked. A revoked share can no longer be resolved. Creating the share again turns it back on.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.getShare("file_123");
console.log(result);

files.createShare

POST /v1/files/{fileId}/share · Operation ID createShareFileShare

Create a file share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.createSharecreateShare(fileId: string, idempotencyKey: string): Promise<Models.CreateShareFileShareResponse>
Pythoncloud.files.create_sharedef create_share(self, file_id: str, options: CreateShareFileShareOptions) -> FileShareResponse
Gocloud.Files.CreateSharefunc (r *FilesResource) CreateShare(ctx context.Context, fileId string, options CreateShareFileShareOptions) (FileShareResponse, error)

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.
Idempotency-KeyheaderstringyesKey that makes the request safe to retry, 8 to 128 characters without leading or trailing whitespace. Repeating a request with the same key and parameters replays the original result; reusing the key for a different request returns 409 idempotency_conflict.

Response

200 · application/json · Schema: FileShareResponse

FieldTypeRequiredDescription
file_idstringyesID of the shared file.
slugstringyesPublic slug of the share. Pass it to the resolve-share operation to get the file.
filenamestringyesCurrent name of the shared file.
content_typestringyesMIME type of the shared file.
size_bytesintegeryesSize of the shared file in bytes.
revokedbooleanyesTrue when the share was revoked. A revoked share can no longer be resolved. Creating the share again turns it back on.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.createShare("file_123", "YOUR_IDEMPOTENCY_KEY");
console.log(result);

files.revokeShare

DELETE /v1/files/{fileId}/share · Operation ID revokeShareFileShare

Revoke a file share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.revokeSharerevokeShare(fileId: string): Promise<Models.RevokeShareFileShareResponse>
Pythoncloud.files.revoke_sharedef revoke_share(self, file_id: str) -> None
Gocloud.Files.RevokeSharefunc (r *FilesResource) RevokeShare(ctx context.Context, fileId string) error

Parameters

ParameterInTypeRequiredDescription
fileIdpathstringyesID of the file, the file_id returned when the upload was prepared.

Response

204

No response body.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.revokeShare("file_123");
console.log(result);

files.prepareUpload

POST /v1/files/presign-upload · Operation ID presignFileUpload

Create a file upload URL

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.prepareUploadprepareUpload(input: Models.FilePrepareUploadInput, idempotencyKey: string): Promise<Models.PresignFileUploadResponse>
TypeScriptcloud.files.uploadupload(input: Models.FilePrepareUploadInput, idempotencyKey: string)
Pythoncloud.files.prepare_uploaddef prepare_upload(self, input: FilePrepareUploadInput, options: PresignFileUploadOptions) -> FileTransferDescriptor
Gocloud.Files.PrepareUploadfunc (r *FilesResource) PrepareUpload(ctx context.Context, input FilePrepareUploadInput, options PresignFileUploadOptions) (FileTransferDescriptor, error)

cloud.files.upload: Alias of files.prepareUpload(input, idempotencyKey): returns the presigned upload descriptor. The SDK does not transfer the file bytes; upload to the returned URL, then call files.confirmUpload.

Parameters

ParameterInTypeRequiredDescription
Idempotency-KeyheaderstringyesKey that makes the request safe to retry, 8 to 128 characters without leading or trailing whitespace. Repeating a request with the same key and parameters replays the original result; reusing the key for a different request returns 409 idempotency_conflict.

Request body

application/json · required · Schema: FilePrepareUploadInput

FieldTypeRequiredDescription
upload_contextFileChatUploadContextnoTies the upload to an instance and optionally an agent. The credential's organization and app own the file. Omit the context for a plain upload. Nullable.
filenamestringyesName of the file, 1 to 255 characters, without leading or trailing whitespace and without /, \ or control characters.
content_typestringyesMIME type of the file, at most 255 characters and without control characters. The uploaded content must carry this type.
size_bytesintegeryesSize of the file in bytes, from 1 to 104857600 (100 MiB). The uploaded content must have exactly this size.
checksum_sha256stringnoLowercase hex SHA-256 digest of the content (64 characters). Optional. When sent, the uploaded content must match it and the confirmation verifies it.

Response

201 · application/json · Schema: FileTransferDescriptor

FieldTypeRequiredDescription
directionstringyesWhether the URL is used to upload or to download the file content. Allowed values: "upload" — Send the file content to url with http_method. Returned when an upload is prepared; "download" — Fetch the file content from url with http_method. Returned when a file or a share is read. (enum table)
file_idstringyesID of the file the transfer is for.
urlstringyesPre-signed URL to transfer the file content with. The URL is already signed, so do not send your API key to it.
http_methodstringyesHTTP method to use with url: PUT for an upload, GET for a download.
required_headersmap<string, string>yesHeaders to send with the transfer request exactly as given. Empty when none are required.
expires_atstringyesTime the URL stops working, as an RFC 3339 timestamp. Upload URLs are valid for 15 minutes and download URLs for 5 minutes. Constraints: format=date-time.
content_typestringyesMIME type of the file.
size_bytesintegeryesSize of the file in bytes.
checksum_sha256stringnoLowercase hex SHA-256 digest of the file content. Omitted when no digest is known.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.prepareUpload({
  filename: "example_filename",
  content_type: "example_content_type",
  size_bytes: 1
}, "YOUR_IDEMPOTENCY_KEY");
console.log(result);

files.getSummary

GET /v1/files/summary · Operation ID getFilesSummary

Get the file summary

SDK methods

LanguageMethodSignature
TypeScriptcloud.files.getSummarygetSummary(): Promise<Models.GetFilesSummaryResponse>
Pythoncloud.files.get_summarydef get_summary(self) -> FileSummary
Gocloud.Files.GetSummaryfunc (r *FilesResource) GetSummary(ctx context.Context) (FileSummary, error)

Response

200 · application/json · Schema: FileSummary

FieldTypeRequiredDescription
file_countintegeryesNumber of ready files.
storage_file_countintegeryesNumber of ready files that count toward storage. Files provided by template skills are not counted.
used_bytesintegeryesTotal size in bytes of the files that count toward storage.
image_countintegeryesNumber of ready files in the FILE_TYPE_IMAGE category.
video_countintegeryesNumber of ready files in the FILE_TYPE_VIDEO category.
document_countintegeryesNumber of ready files in the FILE_TYPE_DOCUMENT category.
instancesarray<object>yesReady files grouped by the agent they belong to, or by instance when they have no agent, largest group first.
instances[].sourcestringyesHow the file came to exist. New values can be added, so ignore values you do not know. Allowed values: "manual" — Uploaded directly through the files API without an upload context. Files without a recorded origin are reported as manual; "chat_upload" — Uploaded with an upload_context, to be used in a conversation with the agent named by it; "runtime_generated" — Generated by an agent while it handled a request. operation_id identifies that operation; "template_skill" — Provided by a template skill. The file is read-only: it cannot be renamed or deleted, and it does not count toward storage usage. (enum table)
instances[].instance_idstringnoID of the instance the file belongs to. Omitted for files that are not tied to an instance.
instances[].agent_idstringnoID of the agent the file belongs to. Omitted for files that are not tied to an agent.
instances[].operation_idstringnoID of the agent operation that generated the file. Set only when source is runtime_generated.
instances[].instance_namestringnoCurrent display name of the instance, filled in when the file is returned. Omitted for files without an instance.
instances[].agent_namestringnoCurrent display name of the agent, filled in when the file is returned. Omitted for files without an agent.
instances[].avatar_urlstringnoURL of the agent avatar. Omitted for files without an agent.
instances[].harnessstringnoHarness the instance runs, for example openclaw. Omitted for files without an instance.
instances[].destroyedbooleannoTrue when the instance has been terminated or deleted. The file stays available. Omitted when false.
instances[].countintegeryesNumber of ready files in this group.

Errors

StatusSchemaDescription
other (default)ErrorResponseCloud Server error

The error schemas are described in Errors.

Example

import { BeeOSClient } from "@beeos-ai/cloud-sdk";

const cloud = new BeeOSClient({
  baseURL: "https://api.cloud.beeos.ai/v1",
  apiKey: "YOUR_API_KEY", // bsk_ key: backend only
});
const result = await cloud.files.getSummary();
console.log(result);