Early access. Cloud sessions and managed agent runs are not open to every account yet: we are
letting accounts in gradually while we test. They run in a cloud sandbox operated by Mutagent, so
there is nothing to host. A sandbox with nothing to do for 15 minutes stops; send the session a
message and it wakes up, delivers your message and carries on in the same conversation.
client.environments. The token exchange, sandbox provider and preset calls
are on client.sandbox.
Get a sandbox token
Environment and sandbox provider calls take a short-lived sandbox token, not your API key. Exchange the API key for a token withcreateSandboxToken, which takes the API key as its first argument and
the workspace as its second. Then create a client that holds both.
workspaceId is the workspace’s ID; client.workspaces.listWorkspaces() returns it as
workspaces[].id. The API key must be allowed to create resources in that workspace, and a key limited
to one workspace or organization can only get a token inside it. Refusals: 401, 403, 422, 429.
List Environments
listEnvironments returns every Environment in the workspace.
A fingerprint is the first 8 hex characters of the SHA-256 of the value. Compare fingerprints to check
that a stored value is the one you hold.
Describe one Environment
getEnvironment returns one Environment in the same shape.
Create an Environment or set entries
updateEnvironment creates the Environment when it does not exist, and otherwise
changes only the entries you name. A string value sets an entry. null removes it. Entries you do not
name are kept.
getEnvironment does.
Replace an Environment
replaceEnvironment sets the whole Environment. Entries the body does not name are
deleted, secrets included.
Rules for both calls
Delete an Environment
deleteEnvironment deletes the Environment and its secrets.
{ deleted: true, name }. 404 when there is no Environment with that name, including a
delete you retry. Sessions already running keep the values they started with. A later launch that
names the deleted Environment is refused with 404.
List sandbox providers
listSandboxProviders lists the sandbox providers a launch can name, and the default.
Pass a name as
sandboxProvider when you launch a session.
The SDK has no call that adds or configures a sandbox provider. See
Sandbox providers.
List presets
listSandboxPresets lists the presets a launch can name as preset, and the default.
Errors
A refused call throws a subclass ofMutagentError. statusCode is the HTTP status and body is the
JSON the server returned, with error and message.