DocsCloud SDK reference

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

BEEOS CLOUD / DEVELOPER REFERENCE

Canvases

Canvas share links, snapshots, and conversation canvas sessions.

Overview

The canvases domain manages the share links and snapshots of an instance's canvases and resolves the canvas session of a conversation.

6 operations · SDK resource: TypeScript cloud.canvases · Python cloud.canvases · Go cloud.Canvases · API overview

Main objects

CanvasShare

FieldTypeRequiredDescription
idstringyesUnique ID of the share.
canvasIdstringyesID of the canvas that is shared. A canvas has at most one share.
slugstringyesPublic identifier of the share, used to build the share link. It stays the same when the share is updated.
modestringyesHow visitors get access. password requires visitors to enter the password set when the share was created. Any other value, for example link, lets anyone who has the link open the canvas.
allowInteractionbooleanyesWhether visitors can interact with the canvas. When false, visitors can only view it.
expiresAtstringnoTime the share stops working, as an RFC 3339 timestamp. Omitted when the share does not expire; shares created through this API never expire.
createdAtstringyesTime the share was first created, as an RFC 3339 timestamp. Updating the share does not change it.

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

CanvasSnapshot

FieldTypeRequiredDescription
idstringyesUnique ID of the snapshot. Pass it to the restore operation.
canvasIdstringyesID of the canvas the snapshot belongs to.
componentsSnapshotstringnoContent of the canvas when the snapshot was taken, as base64-encoded JSON: an array of surfaces, each with surfaceId, presentation, components and root. Omitted when no content was captured.
actorTypestringyesKind of actor that made most of the changes recorded by the snapshot: user for a person (restore points are also recorded as user), agent for an agent, or system for an automatic snapshot with no known actor.
actorIdstringyesID of the actor named by actorType. system for automatic snapshots with no known actor.
descriptionstringnoShort note about the snapshot, for example Auto-snapshot for automatic snapshots or Restored from v3 for a restore point. Omitted when there is none.
versionintegeryesVersion of the canvas content the snapshot records. A higher number is newer.
createdAtstringyesTime the snapshot was taken, as an RFC 3339 timestamp.

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

CanvasSessionDocument

FieldTypeRequiredDescription
transportstringyesHow the ticket connects: always relay.
protocolVersionintegeryesVersion of the ticket protocol. Currently 1.
headerRealtimeTicketHeaderyesHeader of the signed ticket.
relayUrlstringyesWebSocket URL of the canvas relay for the canvas, ending in /ws/{canvasId}.
ticketstringyesSigned single-use ticket (a JWT) that authorizes one relay connection. It is valid for 60 seconds.
issuedAtstringyesTime the ticket was issued, as an RFC 3339 timestamp. Constraints: format=date-time.
expiresAtstringyesTime the ticket expires, as an RFC 3339 timestamp. Tickets are valid for 60 seconds. Constraints: format=date-time.
claimsCanvasTicketClaimsyesClaims contained in the signed ticket.

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

RealtimeTicketHeader

FieldTypeRequiredDescription
algstringyesSignature algorithm of the ticket: RS256.
typstringyesToken type: JWT.
kidstringyesID of the key that signed the ticket.

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

CanvasTicketClaims

FieldTypeRequiredDescription
issstringyesIssuer of the ticket.
substringyesUnused. Cloud does not accept an external user id, so this claim is empty.
jtistringyesUnique ID of the ticket.
purposestringyesPurpose of the ticket: always canvas_session.
instance_idstringyesID of the instance the canvas belongs to.
platform_agent_idstringyesID of the agent the canvas session is for, the platformAgentId of the request.
client_idstringyesID generated for this relay client connection.
conversation_idstringyesID of the conversation the canvas belongs to, the conversationId of the request.
canvas_idstringyesID of the canvas the ticket grants access to.
rolestringyesAccess role granted on the canvas: viewer or editor. Allowed values: "viewer" — Can view the canvas but not change it; "editor" — Can view and edit the canvas. (enum table)
session_idstringyesID of the realtime session created for this ticket.
audarray<string>yesAudiences the ticket is intended for: the canvas relay.
iatintegeryesTime the ticket was issued, in Unix seconds.
expintegeryesTime the ticket expires, in Unix seconds.

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

Typical flow

  1. Resolve the canvas session of a conversation with canvases.getSession.
  2. Share a canvas with canvases.createShare and read the link with canvases.getShare; withdraw it with canvases.deleteShare.
  3. List the saved states with canvases.listSnapshots and bring one back with canvases.restoreSnapshot.

Methods

MethodHTTPSummary
canvases.getSessionGET /v1/instances/{instanceId}/canvas-sessions/{conversationId}Resolve a conversation canvas session
canvases.getShareGET /v1/instances/{instanceId}/canvases/{canvasId}/shareGet a canvas share link
canvases.createSharePOST /v1/instances/{instanceId}/canvases/{canvasId}/shareCreate a canvas share link
canvases.deleteShareDELETE /v1/instances/{instanceId}/canvases/{canvasId}/shareRevoke a canvas share link
canvases.listSnapshotsGET /v1/instances/{instanceId}/canvases/{canvasId}/snapshotsList canvas snapshots
canvases.restoreSnapshotPOST /v1/instances/{instanceId}/canvases/{canvasId}/snapshots/{snapshotId}/restoreRestore a canvas snapshot

canvases.getSession

GET /v1/instances/{instanceId}/canvas-sessions/{conversationId} · Operation ID getCanvasSession

Resolve a conversation canvas session

SDK methods

LanguageMethodSignature
TypeScriptcloud.canvases.getSessiongetSession(instanceId: string, conversationId: string, XBeeOSConversationID: string, XBeeOSPlatformAgentID: string): Promise<Models.GetCanvasSessionResponse>
Pythoncloud.canvases.get_sessiondef get_session(self, instance_id: str, conversation_id: str, options: GetCanvasSessionOptions) -> GetCanvasSessionResponse
Gocloud.Canvases.GetSessionfunc (r *CanvasesResource) GetSession(ctx context.Context, instanceId string, conversationId string, options GetCanvasSessionOptions) (GetCanvasSessionResponse, error)

Parameters

ParameterInTypeRequiredDescription
instanceIdpathstringyesID of the instance that hosts the agent. It must belong to your app.
conversationIdpathstringyesID of the conversation to look up the canvas session for. It must equal the X-BeeOS-Conversation-ID header.
X-BeeOS-Conversation-IDheaderstringyesID of the conversation the canvas is used in. For the session lookup it must equal conversationId in the path.
X-BeeOS-Platform-Agent-IDheaderstringyesID of the agent that owns the canvas. It must be an agent of instanceId.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataobjectyesNullable.

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.canvases.getSession("instance_123", "conversation_123", "conversation_123", "agent_123");
console.log(result);

canvases.getShare

GET /v1/instances/{instanceId}/canvases/{canvasId}/share · Operation ID getShareCanvas

Get a canvas share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.canvases.getSharegetShare(instanceId: string, canvasId: string, XBeeOSConversationID: string, XBeeOSPlatformAgentID: string): Promise<Models.GetShareCanvasResponse>
Pythoncloud.canvases.get_sharedef get_share(self, instance_id: str, canvas_id: str, options: GetShareCanvasOptions) -> GetShareCanvasResponse
Gocloud.Canvases.GetSharefunc (r *CanvasesResource) GetShare(ctx context.Context, instanceId string, canvasId string, options GetShareCanvasOptions) (GetShareCanvasResponse, error)

Parameters

ParameterInTypeRequiredDescription
instanceIdpathstringyesID of the instance that hosts the agent. It must belong to your app.
canvasIdpathstringyesID of the canvas, a UUID. The canvas must belong to the conversation and agent named by the headers.
X-BeeOS-Conversation-IDheaderstringyesID of the conversation the canvas is used in. For the session lookup it must equal conversationId in the path.
X-BeeOS-Platform-Agent-IDheaderstringyesID of the agent that owns the canvas. It must be an agent of instanceId.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataCanvasShareyesNullable.

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.canvases.getShare("instance_123", "canvas_123", "conversation_123", "agent_123");
console.log(result);

canvases.createShare

POST /v1/instances/{instanceId}/canvases/{canvasId}/share · Operation ID createShareCanvas

Create a canvas share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.canvases.createSharecreateShare(instanceId: string, canvasId: string, input: Models.CreateShareCanvasRequest, XBeeOSConversationID: string, XBeeOSPlatformAgentID: string): Promise<Models.CreateShareCanvasResponse>
Pythoncloud.canvases.create_sharedef create_share(self, instance_id: str, canvas_id: str, input: CreateShareCanvasRequest, options: CreateShareCanvasOptions) -> CreateShareCanvasResponse
Gocloud.Canvases.CreateSharefunc (r *CanvasesResource) CreateShare(ctx context.Context, instanceId string, canvasId string, input CreateShareCanvasRequest, options CreateShareCanvasOptions) (CreateShareCanvasResponse, error)

Parameters

ParameterInTypeRequiredDescription
instanceIdpathstringyesID of the instance that hosts the agent. It must belong to your app.
canvasIdpathstringyesID of the canvas, a UUID. The canvas must belong to the conversation and agent named by the headers.
X-BeeOS-Conversation-IDheaderstringyesID of the conversation the canvas is used in. For the session lookup it must equal conversationId in the path.
X-BeeOS-Platform-Agent-IDheaderstringyesID of the agent that owns the canvas. It must be an agent of instanceId.

Request body

application/json · required

FieldTypeRequiredDescription
modestringyesHow visitors get access: password to protect the share with password, or any other value, for example link, to let anyone with the link open the canvas. Required.
passwordstringnoPassword visitors must enter. Used only when mode is password; without it no visitor can pass the check.
allowInteractionbooleannoWhether visitors can interact with the canvas. Defaults to true. Send false to make the share view-only.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataCanvasShareyesNullable.

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.canvases.createShare("instance_123", "canvas_123", { mode: "example_mode" }, "conversation_123", "agent_123");
console.log(result);

canvases.deleteShare

DELETE /v1/instances/{instanceId}/canvases/{canvasId}/share · Operation ID deleteShareCanvas

Revoke a canvas share link

SDK methods

LanguageMethodSignature
TypeScriptcloud.canvases.deleteSharedeleteShare(instanceId: string, canvasId: string, XBeeOSConversationID: string, XBeeOSPlatformAgentID: string): Promise<Models.DeleteShareCanvasResponse>
Pythoncloud.canvases.delete_sharedef delete_share(self, instance_id: str, canvas_id: str, options: DeleteShareCanvasOptions) -> None
Gocloud.Canvases.DeleteSharefunc (r *CanvasesResource) DeleteShare(ctx context.Context, instanceId string, canvasId string, options DeleteShareCanvasOptions) error

Parameters

ParameterInTypeRequiredDescription
instanceIdpathstringyesID of the instance that hosts the agent. It must belong to your app.
canvasIdpathstringyesID of the canvas, a UUID. The canvas must belong to the conversation and agent named by the headers.
X-BeeOS-Conversation-IDheaderstringyesID of the conversation the canvas is used in. For the session lookup it must equal conversationId in the path.
X-BeeOS-Platform-Agent-IDheaderstringyesID of the agent that owns the canvas. It must be an agent of instanceId.

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.canvases.deleteShare("instance_123", "canvas_123", "conversation_123", "agent_123");
console.log(result);

canvases.listSnapshots

GET /v1/instances/{instanceId}/canvases/{canvasId}/snapshots · Operation ID listCanvasSnapshots

List canvas snapshots

SDK methods

LanguageMethodSignature
TypeScriptcloud.canvases.listSnapshotslistSnapshots(instanceId: string, canvasId: string, XBeeOSConversationID: string, XBeeOSPlatformAgentID: string): Promise<Models.ListCanvasSnapshotsResponse>
Pythoncloud.canvases.list_snapshotsdef list_snapshots(self, instance_id: str, canvas_id: str, options: ListCanvasSnapshotsOptions) -> ListCanvasSnapshotsResponse
Gocloud.Canvases.ListSnapshotsfunc (r *CanvasesResource) ListSnapshots(ctx context.Context, instanceId string, canvasId string, options ListCanvasSnapshotsOptions) (ListCanvasSnapshotsResponse, error)

Parameters

ParameterInTypeRequiredDescription
instanceIdpathstringyesID of the instance that hosts the agent. It must belong to your app.
canvasIdpathstringyesID of the canvas, a UUID. The canvas must belong to the conversation and agent named by the headers.
X-BeeOS-Conversation-IDheaderstringyesID of the conversation the canvas is used in. For the session lookup it must equal conversationId in the path.
X-BeeOS-Platform-Agent-IDheaderstringyesID of the agent that owns the canvas. It must be an agent of instanceId.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataarray<CanvasSnapshot>yes—

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.canvases.listSnapshots("instance_123", "canvas_123", "conversation_123", "agent_123");
console.log(result);

canvases.restoreSnapshot

POST /v1/instances/{instanceId}/canvases/{canvasId}/snapshots/{snapshotId}/restore · Operation ID restoreCanvasSnapshot

Restore a canvas snapshot

SDK methods

LanguageMethodSignature
TypeScriptcloud.canvases.restoreSnapshotrestoreSnapshot(instanceId: string, canvasId: string, snapshotId: string, XBeeOSConversationID: string, XBeeOSPlatformAgentID: string): Promise<Models.RestoreCanvasSnapshotResponse>
Pythoncloud.canvases.restore_snapshotdef restore_snapshot(self, instance_id: str, canvas_id: str, snapshot_id: str, options: RestoreCanvasSnapshotOptions) -> RestoreCanvasSnapshotResponse
Gocloud.Canvases.RestoreSnapshotfunc (r *CanvasesResource) RestoreSnapshot(ctx context.Context, instanceId string, canvasId string, snapshotId string, options RestoreCanvasSnapshotOptions) (RestoreCanvasSnapshotResponse, error)

Parameters

ParameterInTypeRequiredDescription
instanceIdpathstringyesID of the instance that hosts the agent. It must belong to your app.
canvasIdpathstringyesID of the canvas, a UUID. The canvas must belong to the conversation and agent named by the headers.
snapshotIdpathstringyesID of the snapshot to restore, as returned by the snapshot list.
X-BeeOS-Conversation-IDheaderstringyesID of the conversation the canvas is used in. For the session lookup it must equal conversationId in the path.
X-BeeOS-Platform-Agent-IDheaderstringyesID of the agent that owns the canvas. It must be an agent of instanceId.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataobjectyes—
data.snapshotIdstringyes—
data.canvasIdstringyes—
data.restoredbooleanyes—
data.versionintegeryes—

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.canvases.restoreSnapshot("instance_123", "canvas_123", "snapshot_123", "conversation_123", "agent_123");
console.log(result);