DocsCloud SDK reference

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

BEEOS CLOUD / DEVELOPER REFERENCE

Device bindings

Agent bind sessions and portal bind sessions.

Overview

The device bindings domain covers the bind sessions that connect an agent to a user: agent bind sessions, and portal bind sessions that a portal creates, reads, revokes, and resolves.

6 operations · SDK resource: TypeScript cloud.deviceBindings · Python cloud.device_bindings · Go cloud.DeviceBindings · API overview

Main objects

agentBindDetailsWire

FieldTypeRequiredDescription
bind_idstringyesID of the bind session.
hostnamestringyesHost name the device reported.
fingerprint_shortstringyesFirst 16 characters of the device key fingerprint. Show it to the user to compare with the device.
harnessstringyesHarness the device runs, as the device reported it.
os_typestringnoOperating system the device reported. Omitted when it did not report one.
expires_atintegeryesTime the session expires, in Unix seconds.
statusstringyesState of the bind session. A session that has expired is deleted, so lookups of an expired session fail with 404 not_found instead. Allowed values: "pending" — Created by the device and waiting for a user to confirm it; "confirming" — A user confirmed it and the instance for the device is being created; "bound" — Confirmed: the instance exists and the device can connect to it. (enum table)
server_timeintegeryesCurrent server time in Unix seconds. Compare it with expires_at to get the remaining time without clock skew.

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

agentBindWire

FieldTypeRequiredDescription
statusstringyesState of the bind session. After a successful confirmation it is bound; a session that is still waiting for confirmation reports pending. Allowed values: "pending" — Created by the device and waiting for a user to confirm it. A session that is being confirmed also reports pending; "bound" — Confirmed: the instance exists and the device can connect to it. (enum table)
bind_idstringnoID of the bind session.
instance_idstringnoID of the instance created for the device. Present once the session is bound.
public_keystringnoPublic key the device registered for the session.
hostnamestringnoHost name the device reported.
expires_atintegernoTime the session expires, in Unix seconds.
runtime_bindingbindRuntimeWirenoAddresses a bound self-hosted agent connects to. Present once the session is bound. Nullable.

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

portalBindWire

FieldTypeRequiredDescription
provider_idstringnoID of the provider that hosts the instance. Set when a new instance was created for the device.
bind_idstringyesID of the bind session. It starts with portal_.
short_codestringyesShort code the user can enter on the device instead of scanning the QR code. It uses uppercase letters and digits without look-alike characters.
statusstringyesState of the portal bind session. A session that has expired is deleted, so lookups of an expired session fail with 404 not_found instead. Allowed values: see the table below, portalBindWire.status values.
instance_idstringnoID of the instance bound to the device. Present once the session is bound.
expires_atintegeryesTime the session expires, in Unix seconds. A session is valid for 10 minutes.
namestringyesDisplay name for the instance created for the device. Defaults to BeeRunner.
qr_payloadstringnoLink to encode in the QR code the device scans. Returned only when the session is created.
api_base_urlstringnoBase URL of the API the device connects to. Returned only when the session is created.
relay_urlstringnoURL of the relay the device connects through. Returned only when the session is created.
desired_statusstringnoLifecycle phase the created instance is driven toward: running. Set when a new instance was created for the device.
connectivitystringnoReachability of the created instance: unknown, online or offline. Set when a new instance was created for the device.
resource_versionintegernoResource version of the created instance. Set when a new instance was created for the device.

portalBindWire.status values

ValueMeaning
"pending"Created and waiting for a device to scan the QR code or enter the short code.
"awaiting_confirmation"A device claimed the session. Call the resolve operation with decision to continue.
"confirming"The decision create was accepted and a new instance is being created for the device.
"bound"The device is bound to an instance, given by instance_id.
"revoked"Revoked with the revoke operation. A revoked session cannot be claimed or resolved.

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

Binding

FieldTypeRequiredDescription
client_typestringyesHow the token is bound to the client. Allowed values: "web" — Bound to a web page origin, returned in origin; "native" — Bound to a device key, whose thumbprint is returned in cnf_jkt. (enum table) Structure by client_type: see the variant table.
originstringnoOrigin the token is bound to. Returned when client_type is web. Constraints: format=uri.
cnf_jktstringnoThumbprint of the device key the token is bound to. Returned when client_type is native.

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

Typical flow

  1. For an agent bind session, read its details with deviceBindings.getDetails, then accept it with deviceBindings.confirm.
  2. For a portal, create a bind session with deviceBindings.createPortal and read it with deviceBindings.getPortal.
  3. End it with deviceBindings.resolvePortal (the decision is recover or create) or deviceBindings.revokePortal.

Methods

MethodHTTPSummary
deviceBindings.confirmPOST /v1/agent/bind/{id}/confirmConfirm an agent bind session
deviceBindings.getDetailsGET /v1/agent/bind/{id}/detailsGet agent bind session details
deviceBindings.createPortalPOST /v1/agent/portal/bind-sessionsCreate a portal bind session
deviceBindings.getPortalGET /v1/agent/portal/bind-sessions/{id}Get a portal bind session
deviceBindings.resolvePortalPOST /v1/agent/portal/bind-sessions/{id}/resolveResolve a portal bind session
deviceBindings.revokePortalPOST /v1/agent/portal/bind-sessions/{id}/revokeRevoke a portal bind session

deviceBindings.confirm

POST /v1/agent/bind/{id}/confirm · Operation ID confirmAgentBind

Confirm an agent bind session

SDK methods

LanguageMethodSignature
TypeScriptcloud.deviceBindings.confirmconfirm(id: string, input: Models.ConfirmAgentBindRequest): Promise<Models.ConfirmAgentBindResponse>
Pythoncloud.device_bindings.confirmdef confirm(self, id: str, input: ConfirmAgentBindRequest) -> ConfirmAgentBindResponse
Gocloud.DeviceBindings.Confirmfunc (r *DeviceBindingsResource) Confirm(ctx context.Context, id string, input ConfirmAgentBindRequest) (ConfirmAgentBindResponse, error)

Parameters

ParameterInTypeRequiredDescription
idpathstringyesID of the agent bind session to confirm, the bind_id returned when the device created it.

Request body

application/json · required

FieldTypeRequiredDescription
namestringnoDisplay name for the instance created for the device, up to 128 characters. Defaults to the host name the device reported.
modelPrimarystringnoAccepted and ignored. The instance keeps the default model of the server.
model_primarystringnoSnake-case alias of modelPrimary, also ignored. If both are sent they must be equal.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataagentBindWireyes—

Errors

StatusSchemaDescription
other (default)DeviceBindingErrorResponseCloud 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.deviceBindings.confirm("id_123", {});
console.log(result);

deviceBindings.getDetails

GET /v1/agent/bind/{id}/details · Operation ID getAgentBindDetails

Get agent bind session details

SDK methods

LanguageMethodSignature
TypeScriptcloud.deviceBindings.getDetailsgetDetails(id: string): Promise<Models.GetAgentBindDetailsResponse>
Pythoncloud.device_bindings.get_detailsdef get_details(self, id: str) -> GetAgentBindDetailsResponse
Gocloud.DeviceBindings.GetDetailsfunc (r *DeviceBindingsResource) GetDetails(ctx context.Context, id string) (GetAgentBindDetailsResponse, error)

Parameters

ParameterInTypeRequiredDescription
idpathstringyesID of the agent bind session, the bind_id returned when the device created it.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataagentBindDetailsWireyes—

Errors

StatusSchemaDescription
other (default)DeviceBindingErrorResponseCloud 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.deviceBindings.getDetails("id_123");
console.log(result);

deviceBindings.createPortal

POST /v1/agent/portal/bind-sessions · Operation ID createPortalBind

Create a portal bind session

SDK methods

LanguageMethodSignature
TypeScriptcloud.deviceBindings.createPortalcreatePortal(input: Models.CreatePortalBindRequest): Promise<Models.CreatePortalBindResponse>
Pythoncloud.device_bindings.create_portaldef create_portal(self, input: CreatePortalBindRequest) -> CreatePortalBindResponse
Gocloud.DeviceBindings.CreatePortalfunc (r *DeviceBindingsResource) CreatePortal(ctx context.Context, input CreatePortalBindRequest) (CreatePortalBindResponse, error)

Request body

application/json · required

FieldTypeRequiredDescription
namestringnoDisplay name for the instance created for the device, up to 128 characters. Defaults to BeeRunner.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataportalBindWireyes—

Errors

StatusSchemaDescription
other (default)DeviceBindingErrorResponseCloud 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.deviceBindings.createPortal({});
console.log(result);

deviceBindings.getPortal

GET /v1/agent/portal/bind-sessions/{id} · Operation ID getPortalBind

Get a portal bind session

SDK methods

LanguageMethodSignature
TypeScriptcloud.deviceBindings.getPortalgetPortal(id: string): Promise<Models.GetPortalBindResponse>
Pythoncloud.device_bindings.get_portaldef get_portal(self, id: str) -> GetPortalBindResponse
Gocloud.DeviceBindings.GetPortalfunc (r *DeviceBindingsResource) GetPortal(ctx context.Context, id string) (GetPortalBindResponse, error)

Parameters

ParameterInTypeRequiredDescription
idpathstringyesID of the portal bind session, the bind_id returned when it was created. It starts with portal_.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataportalBindWireyes—

Errors

StatusSchemaDescription
other (default)DeviceBindingErrorResponseCloud 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.deviceBindings.getPortal("id_123");
console.log(result);

deviceBindings.resolvePortal

POST /v1/agent/portal/bind-sessions/{id}/resolve · Operation ID resolvePortalBind

Resolve a portal bind session

SDK methods

LanguageMethodSignature
TypeScriptcloud.deviceBindings.resolvePortalresolvePortal(id: string, input: Models.ResolvePortalBindRequest): Promise<Models.ResolvePortalBindResponse>
Pythoncloud.device_bindings.resolve_portaldef resolve_portal(self, id: str, input: ResolvePortalBindRequest) -> ResolvePortalBindResponse
Gocloud.DeviceBindings.ResolvePortalfunc (r *DeviceBindingsResource) ResolvePortal(ctx context.Context, id string, input ResolvePortalBindRequest) (ResolvePortalBindResponse, error)

Parameters

ParameterInTypeRequiredDescription
idpathstringyesID of the portal bind session, the bind_id returned when it was created. It starts with portal_.

Request body

application/json · required

FieldTypeRequiredDescription
decisionstringyesWhat to do with the device that claimed the session. Required. Allowed values: "recover" — Bind the device to the existing instance given by instance_id; "create" — Create a new instance for the device. (enum table)
instance_idstringnoID of the existing instance to bind the device to. Required when decision is recover; ignored for create.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataportalBindWireyes—

Errors

StatusSchemaDescription
other (default)DeviceBindingErrorResponseCloud 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.deviceBindings.resolvePortal("id_123", { decision: "recover" });
console.log(result);

deviceBindings.revokePortal

POST /v1/agent/portal/bind-sessions/{id}/revoke · Operation ID revokePortalBind

Revoke a portal bind session

SDK methods

LanguageMethodSignature
TypeScriptcloud.deviceBindings.revokePortalrevokePortal(id: string): Promise<Models.RevokePortalBindResponse>
Pythoncloud.device_bindings.revoke_portaldef revoke_portal(self, id: str) -> RevokePortalBindResponse
Gocloud.DeviceBindings.RevokePortalfunc (r *DeviceBindingsResource) RevokePortal(ctx context.Context, id string) (RevokePortalBindResponse, error)

Parameters

ParameterInTypeRequiredDescription
idpathstringyesID of the portal bind session, the bind_id returned when it was created. It starts with portal_.

Response

200 · application/json

FieldTypeRequiredDescription
successbooleanyes—
dataportalBindWireyes—

Errors

StatusSchemaDescription
other (default)DeviceBindingErrorResponseCloud 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.deviceBindings.revokePortal("id_123");
console.log(result);

Structures by discriminator

Binding by client_type

The structure of Binding depends on its own client_type value.

Value of client_typeDescriptionStructure
"web"Bound to a web page origin, returned in origin.BindingWeb
"native"Bound to a device key, whose thumbprint is returned in cnf_jkt.BindingNative