Sessions
Open a session
PUT
Creates the session, or re-attaches vaults to an identical one. Its sandbox is chosen now and fixed for its life.
header
AuthorizationBearer <token>An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).
sessionId*stringNylorun-Protocol*stringThe protocol version, 8
Nylorun-Subject?stringThe person an application key acts for
Nylorun-Scopes?stringThe subject's space-separated scopes; required with a subject
application/json- body
requestId*stringLength
1 <= lengthagentId*stringLength
1 <= lengthownerUserId*stringLength
1 <= lengthinfo?vaultIds?array<>credentialSelections?array<>sandbox?|||The session
application/json- response
id*stringagentId*stringownerUserId*stringmanifestHash*stringimplementationVersion*stringstatus*stringValue in
"idle""runnable""running""waiting""paused""uncertain""completed""failed""cancelled"activeTurnId*string|nullvaultIds*array<string>credentialSelections*array<>sandboxOwnerId*string|nullsandboxId?stringsandbox*|nullsandboxSource?stringValue in
"default""inline""shared""sandbox"mcpSnapshot*|nullmcpDiagnostics*array<>waits?unknownerror?stringuncertainEffects*array<>import { createClient } from "@nylorun/agents";const client = await createClient();const session = await client.createSession({ agentId: "assistant", ownerUserId: user.id,});{ "id": "string", "agentId": "string", "ownerUserId": "string", "manifestHash": "string", "implementationVersion": "string", "status": "idle", "activeTurnId": "string", "vaultIds": [ "string" ], "credentialSelections": [ { "serverName": "string", "credentialId": "string" } ], "sandboxOwnerId": "string", "sandboxId": "string", "sandbox": { "property1": null, "property2": null }, "sandboxSource": "default", "mcpSnapshot": { "property1": null, "property2": null }, "mcpDiagnostics": [ { "property1": null, "property2": null } ], "waits": null, "error": "string", "uncertainEffects": [ { "effectId": "string", "turnId": "string", "kind": "string", "error": null } ]}