NylorunDocsBeta
Runtime APISessions

Read a session's history

GET
/v1/sessions/{sessionId}/items

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

Query Parameters

cursor?string

Continue after this event's cursor; Last-Event-ID works too

limit?integer
Range1 <= value <= 200
agent?string

Only the events of this agent (the root agent, or one it uses as a tool)

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

Response Body

Events up to now; limit returns a bounded page and tail

application/json
  1. response
items*array<|||||||||||||||||||||||||||>
cursor*string|null
import { createClient } from "@nylorun/agents";const client = await createClient();const history = await client.session("ses_123").history();
{  "items": [    {      "schema": "nylorun.event/2",      "eventId": "string",      "tenantId": "string",      "sessionId": "string",      "runId": "string",      "turnId": "string",      "incarnation": 0,      "epoch": 0,      "seq": 0,      "cursor": "string",      "time": "string",      "schemaVersion": 1,      "source": {        "kind": "model-gate",        "id": "string"      },      "evidence": "observed",      "trace": {        "traceId": "string",        "spanId": "string",        "parentSpanId": "string"      },      "visibility": "public",      "retention": "full",      "type": "command.message",      "payload": {        "requestId": "string",        "idempotencyKey": "string",        "type": "message",        "content": "string",        "data": "string",        "parts": [          {            "type": "text",            "text": "string"          }        ],        "manifest": null,        "property1": null,        "property2": null      }    }  ],  "cursor": "string"}