Containers & Virtual Workers

Provision and manage multi-cloud AI-agent containers, Virtual Workers, terminal sessions, sandbox environments, and the code-API tool-bridge used by in-container agents to act on behalf of the authenticated user.

74 endpoints. Generated from the OpenAPI 3.1 specification.

GET /cli/connect

CLI WebSocket connect

Upgrades to a WebSocket connection routed to the `CLIController` service. The JWT session token must be passed as the `Sec-WebSocket-Protocol` header value. This is the persistent control-channel connection used by the `bb` CLI and IDE extensions.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
Upgrade header string (enum) yes Must be `websocket`.

Responses

StatusDescription
101 WebSocket upgrade successful. The connection is now routed to the CLIController DO.
401 Missing or invalid session token.
426 Upgrade required. The `Upgrade: websocket` header was absent.
GET /cli/connections

List active CLI connections (admin)

Returns metadata about active CLIController DO connections. Requires administrator-level authentication.

Auth Session JWT (Bearer)

Responses

StatusDescription
200 Active connection list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
GET /cli/health

CLI service health

Returns a lightweight liveness probe for the CLI WebSocket service. No authentication required.

Public Public: no authentication

Responses

StatusDescription
200 Service healthy.
GET /cli/info

CLI service info

Returns service version and capability metadata used by the CLI to negotiate protocol versions. No authentication required.

Public Public: no authentication

Responses

StatusDescription
200 Service info.
GET /cli/test

CLI WebSocket test page

Returns an HTML page for manually testing CLI WebSocket connections. Intended for development and diagnostics only. No authentication required.

Public Public: no authentication

Responses

StatusDescription
200 HTML test page.
POST /v1/containers

Spin up a container session

Provisions a new container session on the requested backend and size. The organization and environment are resolved from the session; the caller never passes `org_id`. The backend and size must be within the org/project execution policy. Optionally binds the session to a project (applies the per-project policy override). Returns immediately with the session record; the container transitions to `running` asynchronously.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
backend string (enum) cloudflarecontaboawsgcpazureoracle no Supported container backend providers.
size_key string no Size to provision. Defaults to the org/project policy default.
region string no Preferred region (backend-specific, advisory).
kind string (enum) ai_assistantvirtual_worker no Session kind. Defaults to `ai_assistant`.
project_id string<uuid> no Optional project to bind this session to. Applies per-project policy overrides and binds the session for audit and billing attribution.

Responses

StatusDescription
201 Session provisioned.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `PERMISSION_DENIED` (missing required permission), `FORBIDDEN` (containers disabled by org/project policy), `BILLING_TIER_UPGRADE_REQUIRED` (plan does not include containers), or `BILLING_ADDON_REQUIRED` (container add-on not purchased).
409 `QUOTA_EXCEEDED`: the org's `max_concurrent` container limit is reached.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
201 response body: data fields
FieldTypeDescription
session_id string<uuid> Session identifier.
org_id string<uuid> Owning organization.
env_id string<uuid> Active environment.
user_id string<uuid> User who owns this session.
project_id string | null Project binding, if any.
backend string (enum) cloudflarecontaboawsgcpazureoracle Supported container backend providers.
size_key string Size key used.
kind string (enum) ai_assistantvirtual_worker Session kind.
status string (enum) provisioningrunningidlestoppedteardownerror Current lifecycle status.
endpoint string | null Public gateway URL when the ingress domain is configured. null otherwise.
created_at string<date-time>
updated_at string<date-time>
GET /v1/containers/.well-known/jwks.json

Get container token JWKS

Returns the Ed25519 public key set (JWKS) used to verify container connect tokens and data tokens offline (alg=EdDSA). Serves the public key only: the private signing key is never reachable here. Returns an empty key set (200) when no key is configured so a verifier always receives a well-formed JWKS. Cache-Control is set to `public, max-age=300`; verifiers should refresh after that window.

Public Public: no authentication

Responses

StatusDescription
200 The JWKS. `keys` contains zero or one Ed25519 public key entry.
GET /v1/containers/{sessionId}

Get container session status

Returns the current status and metadata for a container session. Sessions belonging to another organization are reported as `404 NOT_FOUND` (anti-enumeration).

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Container session identifier (UUID).

Responses

StatusDescription
200 The session record.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
session_id string<uuid> Session identifier.
org_id string<uuid> Owning organization.
env_id string<uuid> Active environment.
user_id string<uuid> User who owns this session.
project_id string | null Project binding, if any.
backend string (enum) cloudflarecontaboawsgcpazureoracle Supported container backend providers.
size_key string Size key used.
kind string (enum) ai_assistantvirtual_worker Session kind.
status string (enum) provisioningrunningidlestoppedteardownerror Current lifecycle status.
endpoint string | null Public gateway URL when the ingress domain is configured. null otherwise.
created_at string<date-time>
updated_at string<date-time>
DELETE /v1/containers/{sessionId}

Tear down a container session

Gracefully stops the container and marks the session as torn down. An optional `reason` query parameter is recorded in the audit trail.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Container session identifier (UUID).
reason query string no Human-readable teardown reason recorded in the audit trail.

Responses

StatusDescription
200 Session torn down.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
session_id string<uuid> Session identifier.
org_id string<uuid> Owning organization.
env_id string<uuid> Active environment.
user_id string<uuid> User who owns this session.
project_id string | null Project binding, if any.
backend string (enum) cloudflarecontaboawsgcpazureoracle Supported container backend providers.
size_key string Size key used.
kind string (enum) ai_assistantvirtual_worker Session kind.
status string (enum) provisioningrunningidlestoppedteardownerror Current lifecycle status.
endpoint string | null Public gateway URL when the ingress domain is configured. null otherwise.
created_at string<date-time>
updated_at string<date-time>
POST /v1/containers/{sessionId}/connect

Issue a connect ticket and UI token

Issues a one-time WebSocket connect ticket and a short-TTL Ed25519 UI connect token for the specified session. The ticket is a single-use opaque capability redeemed by the in-container gateway on the WebSocket upgrade; the connect token is an Ed25519 JWT presented to the gateway. Both are bound to the calling user and the session id. The session must be in `running` or `idle` state and must belong to the calling user's org/env. Also returns the public gateway URL (`endpoint`) when the ingress domain is configured.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Container session identifier (UUID).

Responses

StatusDescription
200 Connect ticket and UI token issued.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `PERMISSION_DENIED` (not the session owner) or `FORBIDDEN` (session not in a live state).
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
ticket string Single-use, short-TTL opaque ticket redeemed by the in-container gateway on the WebSocket upgrade.
connect_token string Short-TTL Ed25519 UI connect token (JWT) presented to the in-container gateway to authorize the UI connection.
connect_token_ttl_seconds integer Remaining TTL of the connect token in seconds.
session_id string<uuid> The session this connect pair was issued for.
endpoint string | null Public gateway URL (e.g. `https://containers.example.com/s/<sessionId>/`). Null when the ingress domain is not configured.
expires_at string | null Ticket expiry timestamp.
GET /v1/containers/policy

Get org container execution policy

Returns the organization-wide container execution policy (allowed backends, sizes, default backend/size, idle settings, billing mode, residency constraints, and the master on/off toggle). The organization is resolved from the session.

Auth Session JWT (Bearer)

Responses

StatusDescription
200 The org container execution policy.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
containers_enabled boolean | null Master on/off toggle. When false, container provisioning is blocked for every member of the org and environment.
allowed_backends array | null Backends members may use. null = all configured backends.
allowed_sizes array | null Size keys members may request. null = all available sizes.
default_backend string (enum) cloudflarecontaboawsgcpazureoracle Supported container backend providers.
default_size string | null Size key used when the caller does not specify one.
user_selectable boolean | null Whether members may choose a backend/size other than the defaults.
idle_grace_seconds integer | null How long an idle container waits before the reap timer starts.
idle_reap_seconds integer | null How long after idle grace expires before the container is stopped.
idle_billing_mode string (enum) stop_at_idlebill_until_reap Whether billing stops at idle or at reap.
max_concurrent integer | null Maximum simultaneous sessions across the org. 0 = unlimited.
data_residency_regions array | null Allowed data-residency region identifiers. null = no restriction.
PUT /v1/containers/policy

Set org container execution policy

Replaces the organization-wide container execution policy. All fields are optional; absent fields are left unchanged. `containers_enabled: false` disables container provisioning for every member of the org and environment.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
containers_enabled boolean no Master on/off toggle.
allowed_backends array of enum cloudflarecontaboawsgcpazureoracle no
allowed_sizes array of string no
default_backend string (enum) cloudflarecontaboawsgcpazureoracle no Supported container backend providers.
default_size string no
user_selectable boolean no
idle_grace_seconds integer no
idle_reap_seconds integer no
idle_billing_mode string (enum) stop_at_idlebill_until_reap no
max_concurrent integer no
data_residency_regions array | null no

Responses

StatusDescription
200 Policy updated. Returns the updated policy.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
containers_enabled boolean | null Master on/off toggle. When false, container provisioning is blocked for every member of the org and environment.
allowed_backends array | null Backends members may use. null = all configured backends.
allowed_sizes array | null Size keys members may request. null = all available sizes.
default_backend string (enum) cloudflarecontaboawsgcpazureoracle Supported container backend providers.
default_size string | null Size key used when the caller does not specify one.
user_selectable boolean | null Whether members may choose a backend/size other than the defaults.
idle_grace_seconds integer | null How long an idle container waits before the reap timer starts.
idle_reap_seconds integer | null How long after idle grace expires before the container is stopped.
idle_billing_mode string (enum) stop_at_idlebill_until_reap Whether billing stops at idle or at reap.
max_concurrent integer | null Maximum simultaneous sessions across the org. 0 = unlimited.
data_residency_regions array | null Allowed data-residency region identifiers. null = no restriction.
GET /v1/containers/policy/projects/{projectId}

Get per-project container policy override

Returns the per-project container execution policy override. When no override is set all fields are null, meaning the project inherits the org policy.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
projectId path string<uuid> yes Project identifier (UUIDv7).

Responses

StatusDescription
200 The per-project policy override (null fields = inherit org policy).
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
containers_enabled boolean | null null = inherit org toggle.
allowed_backends array | null null = inherit org allow-set.
allowed_sizes array | null null = inherit org allow-set.
PUT /v1/containers/policy/projects/{projectId}

Set per-project container policy override

Replaces the per-project container execution policy override. Pass `clear: true` to delete the override and fall back to the org policy. Setting a field to `null` means "inherit the org value". `allowed_backends` and `allowed_sizes` must be subsets of the org policy's allow-sets (validated server-side).

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
projectId path string<uuid> yes Project identifier (UUIDv7).

Request Body

FieldTypeRequiredDescription
clear boolean no When true, deletes the override so the project falls back to the org policy.
containers_enabled boolean | null no null = inherit org toggle.
allowed_backends array | null no
allowed_sizes array | null no

Responses

StatusDescription
200 Per-project override updated.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
containers_enabled boolean | null null = inherit org toggle.
allowed_backends array | null null = inherit org allow-set.
allowed_sizes array | null null = inherit org allow-set.
GET /v1/containers/saas/{packageId}/config

Get SaaS package container config

Returns the container configuration for a SaaS package, including whether containers are enabled and which backends and sizes the package's subscribers may use.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
packageId path string<uuid> yes SaaS package identifier (UUID).

Responses

StatusDescription
200 SaaS package container configuration.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
containers_enabled boolean Whether containers are enabled for this package's subscribers.
allowed_backends array | null
allowed_sizes array | null
PUT /v1/containers/saas/{packageId}/config

Set SaaS package container config

Replaces the container configuration for a SaaS package. Controls which backends and sizes the package's subscribers may use and whether containers are enabled for that package at all.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
packageId path string<uuid> yes SaaS package identifier (UUID).

Request Body

FieldTypeRequiredDescription
containers_enabled boolean yes
allowed_backends array of enum cloudflarecontaboawsgcpazureoracle no
allowed_sizes array of string no

Responses

StatusDescription
200 SaaS package container config updated.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
containers_enabled boolean Whether containers are enabled for this package's subscribers.
allowed_backends array | null
allowed_sizes array | null
POST /v1/containers/saas/{packageId}/resale

Set container resale pricing for a SaaS package

Sets the per-hour resale credit cost for a specific backend + size combination for a SaaS package. This markup is charged to the package's subscribers when they use containers with that combination.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
packageId path string<uuid> yes SaaS package identifier (UUID).

Request Body

FieldTypeRequiredDescription
backend string (enum) cloudflarecontaboawsgcpazureoracle yes Supported container backend providers.
size_key string yes
resale_credit_cost_per_hour integer yes Per-hour credit cost charged to the package's subscribers for this backend + size.

Responses

StatusDescription
200 Resale pricing updated.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/containers/sizes

List container size catalog

Returns the container size catalog entries available to the caller's organization, including CPU, memory, and per-hour credit cost for each size and backend combination.

Auth Session JWT (Bearer)

Responses

StatusDescription
200 The size catalog entries.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/sandbox

Provision a sandbox container

Provision a new Cloudflare Container DO sandbox session. Generates a session ID, registers billing, and starts the container. The orgId is prepended to all R2 artifact paths to prevent cross-org IDOR. The caller needs `project.update` permission when a `project_id` is provided.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
sessionId string<uuid> no Optional caller-supplied session ID. If omitted the server generates one.
size string (enum) smallstandardlarge no Container size class. Maps to `SandboxContainerSmall`, `SandboxContainerStandard`, or `SandboxContainerLarge`.
gitRepo string no Optional Git repository to clone on startup.
gitBranch string no Branch or ref to check out. Defaults to the repo default branch.
envVars object no Environment variables injected at container start.
language string no Runtime language hint (e.g. `node`, `python`).
project_id string<uuid> no Optional project to attribute this session to.
metadata object no Arbitrary metadata stored with the session.
timeout_seconds integer no Idle-timeout override in seconds.

Responses

StatusDescription
201 Sandbox provisioned successfully.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
201 response body: data fields
FieldTypeDescription
session_id string<uuid> Session identifier.
org_id string<uuid> Owning organization.
env_id string<uuid> Active environment.
user_id string<uuid> User who owns this session.
project_id string | null Project binding, if any.
backend string (enum) cloudflarecontaboawsgcpazureoracle Supported container backend providers.
size_key string Size key used.
kind string (enum) ai_assistantvirtual_worker Session kind.
status string (enum) provisioningrunningidlestoppedteardownerror Current lifecycle status.
endpoint string | null Public gateway URL when the ingress domain is configured. null otherwise.
created_at string<date-time>
updated_at string<date-time>
GET /v1/sandbox/artifacts/{sessionId}

List sandbox artifacts

Lists R2 artifact objects for this sandbox session. Each key is prefixed with the org ID to prevent cross-org object enumeration.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
200 Artifact list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
session_id string<uuid>
artifacts array of object
GET /v1/sandbox/artifacts/{sessionId}/{name}

Download a sandbox artifact

Downloads a specific named artifact from R2. The `Content-Type` header is enforced based on safe file extension mapping: arbitrary types are not forwarded from R2 metadata to prevent content-type sniffing attacks.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.
name path string yes Artifact name (filename).

Responses

StatusDescription
200 Artifact file contents.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/sandbox/display/{sessionId}

Redirect to remote display (Xpra)

302 redirect to the Xpra remote-display endpoint proxied through `/v1/sandbox/proxy/{sessionId}/xpra/`. Requires the proxy cookie to be set first.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
302 Redirect to `/v1/sandbox/proxy/{sessionId}/xpra/`.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
GET /v1/sandbox/jupyter/{sessionId}

Redirect to Jupyter Lab

302 redirect to the Jupyter Lab endpoint proxied through `/v1/sandbox/proxy/{sessionId}/jupyter/lab`. Requires the proxy cookie to be set first.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
302 Redirect to `/v1/sandbox/proxy/{sessionId}/jupyter/lab`.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
POST /v1/sandbox/proxy-session/{sessionId}

Create a sandbox proxy cookie

Mints a short-lived (5-minute) `__Secure-bb_sandbox_proxy` cookie (HttpOnly, Secure, SameSite=None) that authorises transparent proxying through `/v1/sandbox/proxy/{sessionId}/*`. Rate-limited.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session to issue the proxy cookie for.

Responses

StatusDescription
200 Proxy cookie set in the `Set-Cookie` response header.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
429 429 Too Many Requests: a rate limit or usage quota was exceeded. Retry after the indicated window.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/sandbox/proxy-session/revoke-all

Revoke all sandbox proxy cookies for the current user

Invalidates every active `__Secure-bb_sandbox_proxy` HttpOnly cookie previously issued to the authenticated user. Call this on logout or credential rotation.

Auth Session JWT (Bearer)

Responses

StatusDescription
200 All proxy cookies revoked.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/sandbox/proxy/{sessionId}/{path}

Transparent proxy into sandbox container

Transparently proxies any HTTP method into the running Cloudflare Container DO for this session. Authentication is via the `__Secure-bb_sandbox_proxy` cookie issued by `POST /v1/sandbox/proxy-session/{sessionId}`. All traffic is org-scoped at the DO level: the orgId prefix in the container name prevents cross-org IDOR.

Public Public: no authentication

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.
path path string yes Remainder of the path inside the container.

Responses

StatusDescription
200 Response from the container application proxied transparently.
401 Missing or invalid proxy cookie.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
POST /v1/sandbox/resume/{sessionId}

Resume a stopped sandbox session

Re-starts a previously stopped sandbox session and restores its last snapshot. Requires `project.update` permission.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
200 Session resume initiated.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/sandbox/snapshot-info/{sessionId}

Get sandbox snapshot metadata

Returns metadata for the most recent R2 snapshot of this sandbox session, if one exists.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
200 Snapshot metadata.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
session_id string<uuid>
snapshot_key string | null
snapshot_size integer | null
snapshot_uploaded string | null
GET /v1/sandbox/status/{sessionId}

Get sandbox session status

Returns the live status of a sandbox session, including container state, whether the session can be resumed, and sandbox-specific metadata.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
200 Session status retrieved.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
active boolean
status string
session object A container session record.
container object | null Raw container state from the DO.
canResume boolean
sandboxInfo object | null
POST /v1/sandbox/teardown/{sessionId}

Tear down a sandbox session

Stops the container, finalises billing, and deletes the session. Requires `project.update` permission.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
200 Sandbox torn down.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/sandbox/terminal/{sessionId}

Sandbox terminal action

Perform a terminal action inside the sandbox: create a named multiplexed terminal, write input, read pending output, or execute a one-shot command. Requires `project.update` permission.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Request Body

FieldTypeRequiredDescription
action string (enum) createwritereadexec yes Terminal sub-action.
sessionName string no Named multiplexed terminal session (for `create`, `write`, `read`).
input string no Input data to write (for `write`).
command string no Shell command to execute (for `exec`).
timeout integer no Execution timeout in seconds (for `exec`). Defaults to 30.
workdir string no Working directory (for `exec`).

Responses

StatusDescription
200 Terminal action succeeded.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/sandbox/vscode/{sessionId}

Redirect to VS Code server

302 redirect to the VS Code code-server endpoint proxied through `/v1/sandbox/proxy/{sessionId}/code-server/`. Requires the proxy cookie to be set first via `POST /v1/sandbox/proxy-session/{sessionId}`.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
sessionId path string<uuid> yes Sandbox session ID.

Responses

StatusDescription
302 Redirect to `/v1/sandbox/proxy/{sessionId}/code-server/`.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
GET /v1/terminal/sessions

List terminal sessions

Returns a filtered list of the user's terminal sessions for the authenticated org.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
status_filter query string (enum) no Filter by session status.
host_machine_id query string no Filter by host machine ID.
cli_tool query string no Filter by CLI tool identifier.
include_terminated query boolean no When true, include terminated sessions.
limit query integer no Maximum number of sessions to return. Defaults to 50.

Responses

StatusDescription
200 Session list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
sessions array of object
POST /v1/terminal/sessions

Create a terminal session

Registers a new CLI/IDE terminal session and returns a one-time producer ticket used to upgrade the WebSocket connection at `GET /v1/terminal/ws`.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
org_id string<uuid> yes Organization to create the session under.
cli_tool string yes Identifier of the CLI tool creating the session (e.g. `bb-cli`, `vscode-extension`).
cwd string yes Current working directory on the host machine.
host_machine_id string yes Stable identifier of the host machine.
host_extension_id string no Extension or plugin instance identifier on the host.
cli_session_id string<uuid> no Optional caller-supplied session ID.
cli_args array of string no CLI arguments passed to the tool.
cli_display_name string no Human-readable name shown in the session list.
parent_session_id string<uuid> no Optional parent terminal session for nested shells.

Responses

StatusDescription
201 Session created. The producer_ticket is single-use and short-lived.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
201 response body: data fields
FieldTypeDescription
session object Created session record.
producer_ticket string Single-use ticket to present as the WebSocket protocol on `GET /v1/terminal/ws`.
ticket_expires_in_seconds integer TTL of the producer ticket.
POST /v1/terminal/sessions/{id}/join

Join a terminal session as a consumer

Returns a single-use consumer ticket that authorises a read-only (or read-write if `can_input` is true) WebSocket connection to the terminal session DO.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Terminal session ID.

Responses

StatusDescription
200 Consumer ticket issued.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
session_id string<uuid>
can_input boolean Whether the consumer is permitted to send input.
consumer_ticket string Single-use ticket for the WebSocket upgrade.
ticket_expires_in_seconds integer
POST /v1/terminal/sessions/{id}/mark-resumed

Mark a terminal session as active after resumption

Flips a previously-terminated session back to `active` status after the host extension has successfully reconnected. Optionally updates the extension instance ID.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Terminal session ID.

Request Body

FieldTypeRequiredDescription
host_extension_id string no Updated extension instance identifier, if changed.

Responses

StatusDescription
200 Session flipped to active.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/terminal/sessions/{id}/resume

Resume a terminal session

Returns the resume argv and a fresh producer ticket to reconnect the producer WebSocket for a previously disconnected session.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Terminal session ID.

Responses

StatusDescription
200 Resume info with a fresh producer ticket.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
resume_argv array of string
producer_ticket string
ticket_expires_in_seconds integer
POST /v1/terminal/sessions/{id}/terminate

Terminate a terminal session

Marks a terminal session as terminated and closes the associated WebSocket connections.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Terminal session ID.

Request Body

FieldTypeRequiredDescription
reason string (enum) usertimeouthost_exiterrorinactivityadmin yes Reason for termination.

Responses

StatusDescription
200 Session terminated.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/terminal/ws

Terminal session WebSocket upgrade

Upgrades to a WebSocket connection routed to the `TerminalSessionDO` for the given session. The one-time ticket previously issued by `POST /v1/terminal/sessions` (producer) or `POST /v1/terminal/sessions/{id}/join` (consumer) must be passed as the `Sec-WebSocket-Protocol` header value. The ticket is single-use and short-lived; it is consumed on the first valid upgrade and cannot be reused.

Auth One-time ?token= ticket

Parameters

NameInTypeRequiredDescription
ticket query string yes Single-use session ticket.
Upgrade header string (enum) yes Must be `websocket`.

Responses

StatusDescription
101 WebSocket upgrade successful. The connection is now routed to the TerminalSessionDO.
401 Missing, expired, or already-used ticket.
426 Upgrade required. The `Upgrade: websocket` header was not present.
GET /v1/tools

List tools

Returns a paginated list of tools available to the authenticated org. Optionally filtered by `status`.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
status query string (enum) no Filter by tool status.
page query integer no Page number (1-based). Defaults to 1.
page_size query integer no Items per page. Defaults to 50.

Responses

StatusDescription
200 Tool list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
tools array of object
pagination object Pagination metadata. Endpoints use either page/pageSize or limit/offset style; fields present depend on the endpoint.
POST /v1/tools

Create a tool

Creates a new callable tool for the authenticated org. The `endpoint_url` is validated to prevent SSRF: private IP ranges and localhost are rejected.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
name string yes Unique tool name within the org.
description string yes Human-readable description.
tool_type string yes Tool runtime type.
schema_def object yes JSON Schema for the argument payload.
endpoint_url string<uri> no HTTP endpoint URL (for `http` type). Validated to prevent SSRF.
auth_config object no Endpoint auth configuration.
status string (enum) activeinactivedraft no Initial status. Defaults to `draft`.

Responses

StatusDescription
201 Tool created.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
201 response body: data fields
FieldTypeDescription
id string<uuid> Tool ID.
org_id string<uuid> Owning organization.
name string Unique tool name within the org.
description string Human-readable description of what this tool does.
tool_type string Tool runtime type (e.g. `http`, `mcp`, `builtin`).
schema_def object JSON Schema for the tool's argument payload.
endpoint_url string | null HTTP endpoint URL (for `http` type tools). Validated to prevent SSRF: private IP ranges are rejected.
auth_config object | null Auth configuration for the endpoint (structure is tool-type-specific).
status string (enum) activeinactivedraft Tool availability status.
created_at string<date-time>
updated_at string<date-time>
GET /v1/tools/{id}

Get a tool

Returns the full definition of a specific tool by ID.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Tool ID.

Responses

StatusDescription
200 Tool record.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
id string<uuid> Tool ID.
org_id string<uuid> Owning organization.
name string Unique tool name within the org.
description string Human-readable description of what this tool does.
tool_type string Tool runtime type (e.g. `http`, `mcp`, `builtin`).
schema_def object JSON Schema for the tool's argument payload.
endpoint_url string | null HTTP endpoint URL (for `http` type tools). Validated to prevent SSRF: private IP ranges are rejected.
auth_config object | null Auth configuration for the endpoint (structure is tool-type-specific).
status string (enum) activeinactivedraft Tool availability status.
created_at string<date-time>
updated_at string<date-time>
PUT /v1/tools/{id}

Update a tool

Updates an existing tool definition. At least one field must be supplied. The `endpoint_url` is validated to prevent SSRF.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Tool ID.

Request Body

FieldTypeRequiredDescription
name string no
description string no
tool_type string no
schema_def object no
endpoint_url string | null no Updated endpoint URL. Validated to prevent SSRF.
auth_config object | null no
status string (enum) activeinactivedraft no

Responses

StatusDescription
200 Tool updated.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
id string<uuid> Tool ID.
org_id string<uuid> Owning organization.
name string Unique tool name within the org.
description string Human-readable description of what this tool does.
tool_type string Tool runtime type (e.g. `http`, `mcp`, `builtin`).
schema_def object JSON Schema for the tool's argument payload.
endpoint_url string | null HTTP endpoint URL (for `http` type tools). Validated to prevent SSRF: private IP ranges are rejected.
auth_config object | null Auth configuration for the endpoint (structure is tool-type-specific).
status string (enum) activeinactivedraft Tool availability status.
created_at string<date-time>
updated_at string<date-time>
DELETE /v1/tools/{id}

Delete a tool

Permanently deletes a tool. Any Virtual Workers that reference this tool will have it removed from their callable set.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Tool ID.

Responses

StatusDescription
200 Tool deleted.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/virtual-workers

List Virtual Workers

Returns all Virtual Workers accessible to the authenticated user within the current org.

Auth Session JWT (Bearer)

Responses

StatusDescription
200 Worker list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers

Create a Virtual Worker

Creates a new Virtual Worker for the authenticated org. The worker is created in `paused` status and must be explicitly resumed before it will process tasks.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
display_name string yes Human-readable worker name.
job_role string no Semantic role label.
role_key string no Machine-readable role key.
container_size string no Preferred container size.
execution_mode string (enum) synchronousasync no Execution mode.
manager_kind string no Manager type.
manager_id string<uuid> no Manager ID.
timezone string no IANA timezone identifier.
system_prompt string no Worker-level system prompt.

Responses

StatusDescription
201 Virtual Worker created.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
201 response body: data fields
FieldTypeDescription
id string<uuid> Worker ID.
org_id string<uuid> Owning organization.
display_name string Human-readable worker name.
job_role string | null Semantic role label (e.g. `Support Agent`, `Code Reviewer`).
role_key string | null Machine-readable role key.
container_size string | null Preferred container size for this worker's sessions.
execution_mode string | null Execution mode (`synchronous` or `async`).
manager_kind string | null Manager type (e.g. `user`, `worker`).
manager_id string | null Manager ID when `manager_kind` is set.
timezone string | null IANA timezone identifier for shift scheduling.
system_prompt string | null Worker-level system prompt prepended to every conversation.
status string (enum) activepausedretired Current worker status.
created_at string<date-time>
updated_at string<date-time>
POST /v1/virtual-workers/{id}/approvals

Request an autonomy approval

Creates a pending approval request for an action that this worker's autonomy policy requires human sign-off on before proceeding.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
worker_task_id string<uuid> yes The task ID requesting approval.
capability string yes The capability the worker wants to exercise.
reason string no Worker-supplied justification for the requested action.

Responses

StatusDescription
201 Approval request created and queued for review.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/autonomy

Set Virtual Worker autonomy configuration

Configures the worker's autonomy level: which action classes require human approval, which are permitted autonomously, and escalation policies. Approval-required actions are queued to the `/v1/virtual-workers/approvals` surface.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
auto_approve array of string no Action capability keys the worker may execute without approval.
require_approval array of string no Action capability keys that always require human approval.
escalation_timeout_seconds integer no How long to wait for approval before escalating or auto-declining.

Responses

StatusDescription
200 Autonomy config saved.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/virtual-workers/{id}/calendar

Read a Virtual Worker's calendar

Returns the worker's calendar for a window of local dates: each day's shift status and hours, the worker's holidays, and the events the worker is a party to (an attendee by user or by its inbox address, the organizer, or an event on a calendar the worker owns), with recurring events expanded into instances. Requires read access to the worker. Private and confidential events the caller is not a party to are returned as busy blocks without title or organizer. Descriptions, locations, guest lists, conferencing details and attachments are never returned. An invitation that reached the worker only as an emailed calendar file is not shown (it appears as a message in the worker's inbox). The response is not cacheable.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.
from query string<date> no First local date (YYYY-MM-DD). Give both `from` and `to`, or neither for the current ISO week in the worker's calendar timezone.
to query string<date> no Local date after the last one shown (exclusive). Must be after `from` and at most 42 days later; both dates must fall in the years 1970 to 2200.

Responses

StatusDescription
200 The worker's calendar window.
400 `VALIDATION_ERROR` or `INVALID_INPUT`: the worker id or the date range is not valid.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 `NOT_FOUND`: the worker does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
virtual_worker_id string<uuid>
timezone string The calendar timezone: the shift's, else the worker's, else `UTC`.
timezone_valid boolean False when the stored timezone is not a valid IANA zone; the window is then computed in UTC.
from_date string<date>
to_date string<date> Exclusive.
window object
shift object | null The worker's shift, or null when it has none.
days array of object
holidays array of object
events array of object
truncated boolean True when more events matched than one response carries (500 events, or the recurrence expansion caps).
POST /v1/virtual-workers/{id}/claude-link/complete

Complete Claude Max OAuth link

Completes the server-side PKCE token exchange using the authorization code returned by the Claude OAuth callback. The resulting access token is encrypted at rest.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
link_token string yes Opaque token returned by `/start`.
code string yes Authorization code from the Claude OAuth callback.
account_label string no Human-readable label for this connection.

Responses

StatusDescription
201 Claude Max account linked.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/claude-link/start

Start Claude Max OAuth link (PKCE)

Initiates PKCE OAuth flow to link a Claude Max account to this Virtual Worker. Returns an authorization URL to redirect the user to, plus a `link_token` to present on completion.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Responses

StatusDescription
200 PKCE flow initiated.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
authorize_url string Claude authorization URL. Redirect the user here.
link_token string Opaque token to present when calling `/complete`.
state string PKCE state parameter.
POST /v1/virtual-workers/{id}/dispatch

Dispatch next queued task to a Virtual Worker

Claims the next pending task from the worker's dispatch queue, runs the AI turn, records it, and optionally posts the result as a note. Returns `claimed: false` when the queue is empty.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Responses

StatusDescription
200 Dispatch result.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
claimed boolean Whether a task was dequeued and run. False when the queue is empty.
task_id string<uuid> ID of the claimed task. Present when `claimed` is true.
source string Task source (e.g. `ticket`, `chat`).
conversation_id string<uuid> Conversation ID for the AI run.
ok boolean Whether the AI turn succeeded.
note_posted boolean Whether a result note was posted back to the task source.
POST /v1/virtual-workers/{id}/email

Assign an inbox to a Virtual Worker

Makes an existing BB Mail inbox the worker's email address. The caller needs write access to the worker and owner rights on the inbox: an inbox the caller owns, or one owned by a worker the caller owns. The inbox passes to the worker: the worker becomes its owner, the previous owner's access grant is revoked, and an inbox the worker had before passes back to the worker's owner. Assigning the worker's current inbox again changes nothing. An inbox that belongs to another worker is refused (`409 CONFLICT`), and so is an inbox that is a person's sign-in address (`403 FORBIDDEN`). A worker or inbox the caller cannot see answers `404 NOT_FOUND`.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
mailbox_id string<uuid> yes The inbox to assign.

Responses

StatusDescription
200 Inbox assigned.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `FORBIDDEN`: the caller lacks worker management permission, does not own the inbox, or the inbox is a sign-in address.
404 `NOT_FOUND`: the worker or the inbox does not exist or is not visible to the caller.
409 `CONFLICT`: the inbox belongs to another virtual worker; unassign it there first.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
virtual_worker_id string<uuid>
mailbox_id string<uuid>
binding_id string<uuid> The worker's email binding.
previous_mailbox_id string | null The inbox the worker had before, if any.
previous_owner_user_id string | null The inbox's owner before the assignment.
transferred boolean True when ownership of the inbox passed to the worker in this call.
previous_mailbox_handed_back boolean True when the worker's previous inbox passed back to the worker's owner.
disabled_bindings integer Older email bindings of this worker that were disabled.
GET /v1/virtual-workers/{id}/holidays

List Virtual Worker holidays

Returns all configured holiday dates for a Virtual Worker. The worker will not process tasks on holiday dates.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Responses

StatusDescription
200 Holiday list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/holidays

Add a holiday to a Virtual Worker

Adds a specific date on which the Virtual Worker will not process tasks.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
holiday_date string<date> yes Holiday date in `YYYY-MM-DD` format.
label string no Human-readable label for this holiday.
is_full_day boolean no Whether the full day is blocked. Defaults to true.

Responses

StatusDescription
201 Holiday added.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
DELETE /v1/virtual-workers/{id}/holidays/{holidayId}

Delete a Virtual Worker holiday

Removes a previously-added holiday date from the worker.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.
holidayId path string<uuid> yes Holiday entry ID.

Responses

StatusDescription
200 Holiday removed.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/mailbox

Create an inbox for a Virtual Worker

Creates a new BB Mail inbox owned by the worker and makes it the worker's email address, in one transaction: either both happen or neither does. The caller needs worker management permission, permission to create documents, and write access to the worker; the caller does not become an owner of the new inbox. The domain must be one of the organization's domains with verified ownership. An inbox the worker had before passes back to the worker's owner.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
domain_id string<uuid> yes One of the organization's mail domains (from `GET /v1/bbmail/domains`) whose `ownership_verified` is true.
local_part string yes The part of the address before the `@`. Trimmed and lowercased by the server, which validates it like every other inbox name and refuses reserved names.
display_name string no Optional display name shown on sent mail. Trimmed.

Responses

StatusDescription
201 Inbox created and assigned.
400 `VALIDATION_ERROR` (request shape), `INVALID_INPUT` or `MISSING_FIELD` (the inbox name is not valid), or `INVALID_REFERENCE` (a referenced row is not in this organization).
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `FORBIDDEN`: the caller lacks worker management or document creation permission, or the inbox name is reserved.
404 `NOT_FOUND`: the worker or the domain does not exist or is not visible to the caller.
409 `OWNERSHIP_NOT_PROVEN` (the domain's ownership is not verified yet) or `CONFLICT` (the address already exists).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
201 response body: data fields
FieldTypeDescription
virtual_worker_id string<uuid>
mailbox object
binding_id string<uuid>
previous_mailbox_id string | null The inbox the worker had before, if any.
previous_mailbox_handed_back boolean True when the worker's previous inbox passed back to the worker's owner.
POST /v1/virtual-workers/{id}/mfa/totp/ensure

Give a Virtual Worker's account its own authenticator

A virtual worker signs in to Backbuild as its own account, and every account must have a second factor, so a worker without one cannot use the app. This call enrols an authenticator (TOTP) factor on the worker's account. The secret is generated and stored by Backbuild and is never returned. Safe to repeat: when the worker already has an active authenticator, nothing changes and `enrolled` is false. Enrolling a factor signs the worker's account out of its other sessions (`sessions_revoked`), so run it before starting work rather than during a turn. Only works on a virtual worker's account, never a person's. Requires the permission to manage virtual workers; every enrolment is recorded in the audit log.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Responses

StatusDescription
200 The worker has an authenticator.
400 `INVALID_ID_FORMAT`: the worker id is not a UUID.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `FORBIDDEN`: the caller cannot manage virtual workers in this organization, or the account is not a virtual worker's.
404 `NOT_FOUND`: no such worker in this organization.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
virtual_worker_id string<uuid> The worker.
principal_user_id string<uuid> The worker's own account.
method_id string<uuid> The authenticator factor.
enrolled boolean True when this call enrolled it; false when the worker already had one.
sessions_revoked integer How many of the worker account's sessions were signed out.
POST /v1/virtual-workers/{id}/run-task

Run a task on a Virtual Worker (direct)

Synchronously runs a real AI turn against this Virtual Worker using the worker's system prompt, tools, and Claude Max connection. Records the turn via the worker session. Returns the AI response and token usage.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
prompt string yes User message to send to the worker.
task_id string<uuid> no Optional task ID to associate with this run for billing and audit.

Responses

StatusDescription
200 Task run completed.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
conversation_id string<uuid>
ok boolean
response string AI text response.
usage object Token usage counters.
GET /v1/virtual-workers/{id}/runtime-policy

Read a Virtual Worker's tool and model fallback policy

A runtime policy says which coding tool and model a worker's turn uses first, and what it falls back to when that tool is unavailable (out of usage, rate-limited, or without a working account). A skill can carry its own policy; a skill without one inherits the worker's default policy. Returns the policy for one skill (with `skill_id`) or the worker's default (without it), the policy that is actually in effect, and each linked tool's availability right now, so a person choosing a fallback can see which tools are up. Requires the permission to manage virtual workers and access to this worker.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.
skill_id query string<uuid> no Optional. The skill whose policy to read; omit it for the worker's default.

Responses

StatusDescription
200 The stored, default and effective policies with live tool availability.
400 `INVALID_ID_FORMAT`: the worker or skill id is not a UUID.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `FORBIDDEN`: the caller cannot manage virtual workers in this organization, or cannot see this worker.
404 `NOT_FOUND`: no such worker, or no such skill, in this organization.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
virtual_worker_id string<uuid> The worker.
skill_id string | null The skill asked about, or null for the worker default.
runtime_policy any The skill's own policy, or null.
worker_default_policy any The worker's default policy, or null.
effective_policy any The policy a turn uses: the skill's own, else the worker default.
inherited boolean True when the skill has no policy of its own.
availability array of object Each linked tool's availability now.
POST /v1/virtual-workers/{id}/runtime-policy

Set a Virtual Worker's tool and model fallback policy

A runtime policy says which coding tool and model a worker's turn uses first, and what it falls back to when that tool is unavailable (out of usage, rate-limited, or without a working account). A skill can carry its own policy; a skill without one inherits the worker's default policy. With `skill_id`, sets that skill's policy; without it, sets the worker's default that every skill without its own policy inherits. A null `runtime_policy` clears it, back to inheriting. The server checks every tool, model and effort against the model catalog (`GET /v1/virtual-workers/agent-tool-models`) and against the coding tools linked to this worker, so a policy can only name what the worker can actually use. Every change is recorded in the audit log with the policy before and after.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
runtime_policy any yes The policy to store, or null to clear it.
skill_id string<uuid> no Optional. The skill to set; omit it to set the worker's default.
{
  "runtime_policy": {
    "preferred": {
      "tool": "claude_code",
      "model": null,
      "effort": null
    },
    "fallbacks": [
      {
        "tool": "codex"
      },
      {
        "tool": "any"
      }
    ]
  }
}

Responses

StatusDescription
200 The policy as stored.
400 `VALIDATION_ERROR` (a malformed body) or `INVALID_INPUT`: a tool not linked to this worker, a model that is not an enabled catalog model for that tool, an effort the model does not accept, a tool listed twice, or more than 12 fallbacks or 12 models in one fallback. The message names the value. `INVALID_ID_FORMAT`: the worker id is not a UUID.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 `FORBIDDEN`: the caller cannot manage this worker.
404 `NOT_FOUND`: no such worker, or no such skill, in this organization.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
skill_id string<uuid> The skill that was set.
runtime_policy any The skill's policy as stored.
virtual_worker_id string<uuid> The worker whose default was set.
default_runtime_policy any The worker default as stored.
GET /v1/virtual-workers/{id}/shares

List Virtual Worker shares

Returns all active capability shares for this Virtual Worker, including cross-org shares.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Responses

StatusDescription
200 Share list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/shares

Create a Virtual Worker share

Grants a specific capability of this Virtual Worker to a target user, org, or public. Use `scope: 'public'` to enable org-external invocation.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
scope string (enum) userorgpublic yes Share scope.
target_id string<uuid> no Target user or org ID. Required when `scope` is `user` or `org`.
capability string no The capability being shared. Omit to share all capabilities.

Responses

StatusDescription
201 Share created.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
DELETE /v1/virtual-workers/{id}/shares/{shareId}

Revoke a Virtual Worker share

Revokes a previously-granted capability share. Effective immediately: in-flight tasks already dispatched via the share may still complete.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.
shareId path string<uuid> yes Share ID.

Responses

StatusDescription
200 Share revoked.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/shift

Set Virtual Worker shift schedule

Configures the worker's active-hours schedule. Tasks outside the shift window are deferred until the next shift start.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
name string no Shift name (e.g. `Business Hours`).
timezone string no IANA timezone identifier (e.g. `America/New_York`).
work_days array of integer no ISO week days the worker is active (0=Sunday…6=Saturday).
start_local string no Local start time in `HH:MM` format.
end_local string no Local end time in `HH:MM` format.
jitter_seconds integer no Random jitter applied to the start time to prevent thundering-herd task storms.

Responses

StatusDescription
200 Shift schedule saved.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/status

Set Virtual Worker status

Pause, resume, or retire a Virtual Worker. A `retired` worker cannot be re-activated.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
action string (enum) pauseresumeretire yes

Responses

StatusDescription
200 Status updated.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/{id}/usage-policy

Set Virtual Worker usage policy

Configures weekly credit targets and hard thresholds for this worker. When the hard threshold is reached, the worker is automatically paused.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
id path string<uuid> yes Virtual Worker ID.

Request Body

FieldTypeRequiredDescription
weekly_target integer | null no Soft weekly credit target. A warning is emitted when exceeded.
hard_threshold integer | null no Hard weekly credit ceiling. Worker auto-pauses when reached.

Responses

StatusDescription
200 Usage policy saved.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/virtual-workers/agent-tool-models

List the coding-tool model catalog

Lists the models each coding tool can run, with the label to show, the reasoning efforts it accepts, its default effort, and whether the model has been verified to work. This is the catalog a runtime policy is checked against. Any active member of an organization can read it.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
agent_cli query string no Optional. One tool's key, for example `claude_code` or `codex`, to list only its models.

Responses

StatusDescription
200 The enabled models, by tool.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
200 response body: data fields
FieldTypeDescription
models array of object Enabled models, ordered by tool.
GET /v1/virtual-workers/approvals

List pending worker approvals

Returns worker autonomy approval requests pending human decision. Filtered to the authenticated org. Optional `status` query parameter.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
status query string (enum) no Filter by approval status.

Responses

StatusDescription
200 Approval list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/approvals/{approvalId}/decide

Decide on a worker approval request

Approves or declines a pending worker approval request. A declined request causes the worker to receive an autonomy denial on the in-progress task.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
approvalId path string<uuid> yes Approval request ID.

Request Body

FieldTypeRequiredDescription
decision string (enum) approveddeclined yes Approval outcome.
reason string no Optional human-provided reason, sent back to the worker.

Responses

StatusDescription
200 Decision recorded.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 404 Not Found: the requested resource does not exist or is not visible to the caller.
409 Approval already decided. Error code: `CONFLICT`.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
POST /v1/virtual-workers/bindings

Create a worker channel binding

Binds a Virtual Worker to an inbound channel (helpdesk, chat, SaaS package, or project). Tasks arriving on the bound channel are routed to this worker's dispatch queue. Requires worker management permission and write access to the worker. An email binding is not created here: assign an inbox with `POST /v1/virtual-workers/{id}/email` or create one with `POST /v1/virtual-workers/{id}/mailbox`.

Auth Session JWT (Bearer)

Request Body

FieldTypeRequiredDescription
virtual_worker_id string<uuid> yes
channel_kind string yes Channel type (e.g. `helpdesk`, `chat`, `project`). `email` is refused with `400 INVALID_INPUT`.
channel_ref string no Channel-specific reference (e.g. queue name or topic).
saas_package_id string | null no SaaS package the binding is scoped to.
project_id string | null no Project the binding is scoped to.
credential_id string | null no Vault credential to inject when this channel fires.

Responses

StatusDescription
201 Channel binding created.
400 400 Bad Request: a request parameter, body field, or the JSON body itself failed validation.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
403 403 Forbidden: authenticated but lacking the required membership, role, permission, MFA step-up, or feature entitlement.
404 `NOT_FOUND`: the worker does not exist or is not visible to the caller.
409 409 Conflict: the request conflicts with an existing resource or current state (unique constraint, optimistic-lock, duplicate).
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.
GET /v1/virtual-workers/sessions

List Virtual Worker sessions

Returns container sessions associated with Virtual Workers. Optionally filtered by `virtual_worker_id`.

Auth Session JWT (Bearer)

Parameters

NameInTypeRequiredDescription
virtual_worker_id query string<uuid> no Filter to sessions for a specific worker.

Responses

StatusDescription
200 Session list.
401 401 Unauthorized: missing, expired, malformed, or revoked credentials.
500 500 Internal Server Error: an unexpected server-side error. The message is sanitized; the correlation id is logged server-side.