NylorunDocsBeta
Runtime APISessions

Open a session

PUT
/v1/sessions/{sessionId}

Creates the session, or re-attaches vaults to an identical one. Its sandbox is chosen now and fixed for its life.

Authorization

headerAuthorizationBearer <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).

Path Parameters

sessionId*string

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

Nylorun-Subject?string

The person an application key acts for

Nylorun-Scopes?string

The subject's space-separated scopes; required with a subject

Request Body

application/json
  1. body
requestId*string
Length1 <= length
agentId*string
Length1 <= length
ownerUserId*string
Length1 <= length
info?
vaultIds?array<>
credentialSelections?array<>
sandbox?|||

Response Body

The session

application/json
  1. response
id*string
agentId*string
ownerUserId*string
manifestHash*string
implementationVersion*string
status*string
Value in"idle""runnable""running""waiting""paused""uncertain""completed""failed""cancelled"
activeTurnId*string|null
vaultIds*array<string>
credentialSelections*array<>
sandboxOwnerId*string|null
sandboxId?string
sandbox*|null
sandboxSource?string
Value in"default""inline""shared""sandbox"
mcpSnapshot*|null
mcpDiagnostics*array<>
waits?unknown
error?string
uncertainEffects*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    }  ]}