Sessions

Get a session

Returns details of a single session, including a usage roll-up of what its generations cost. The listing omits usage; for a window, a split by day or model, or one end user across every session, narrow GET /v1/projects/{project_id}/usage with session_id / actor_id instead.

get/v1/projects/{project_id}/sessions/{session_id}

Request

  • Base URL: https://api.naturali.ai
  • URL: https://api.naturali.ai/v1/projects/{project_id}/sessions/{session_id}
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)

Path parameters

session_idstring required
Example:sess_V1StGXR8Z5jdHi6B

Session public ID

Response

Session details

idstring

Session public ID

agent_idstring

Agent public ID, kept after a shared agent is deleted by its owner.

conversation_idstring

Underlying conversation public ID

status'open' | 'closed' | 'expired'
namestring nullable
actor_idstring nullable

Public ID of the user actor, or null when the session was created without one

tagsTagBag

Key-value labels on a resource. A flat object of string values — an array, a nested object or a number is rejected with 400 VALIDATION_FAILED, never coerced. Keys are opaque and stored verbatim, so cost_center and costCenter are two different tags. Matched by JSONB containment wherever tags are read: the ?tags= filter and knowledge search.

Keys beginning system. are reserved: the platform writes them to record which conversation, actor, agent and role a row came from, and a write naming one is refused with 400 RESERVED_TAG_KEY. They are read and filtered like any other tag.

The bag is bounded, because every pair reaches the IAM context of every access check on the resource: at most 50 keys, each key at most 128 characters and each value at most 256. A write past a bound — including a merge that would grow the stored bag past the key count — is 400 VALIDATION_FAILED with meta.limit naming the bound it crossed. system.* keys are the platform's and do not count against the 50.

auto_generateboolean

When true, automatically triggers generation after each user message (if no generation is in progress).

generating_atstring date-time nullable

Timestamp when the current generation started, or null if not generating.

created_atstring date-time
updated_atstring date-time
inactivity_ttl_secondsinteger

Number of seconds of inactivity after which the session expires. 0 means the session never expires.

message_delay_secondsinteger nullable

Number of seconds to wait after the last user message before sending to the LLM. Acts as a debounce: each new message resets the timer. null or absent means no delay (immediate processing).

max_context_messagesinteger nullable

Maximum number of recent conversation messages sent to the model on each generation. Takes precedence over the agent's max_context_messages; null defers to it. A fork keeps its parent's value.

last_activity_atstring date-time nullable

Timestamp of the last activity on the session (message added or response generated).

forked_from_session_idstring nullable

Public ID of the session this one was forked from, or null when it was not forked. Also null once that parent is deleted — a fork survives its parent and keeps its own history.

forked_from_positioninteger nullable

The parent conversation position this session branched after, or null when it is not a fork or was forked at the tip.

Example response

{
  "id": "sess_V1StGXR8Z5jdHi6B",
  "agent_id": "agent_V1StGXR8Z5jdHi6B",
  "conversation_id": "conv_V1StGXR8Z5jdHi6B",
  "status": "open",
  "name": "Support chat",
  "actor_id": "actor_V1StGXR8Z5jdHi6B",
  "tags": {
    "team": "finance",
    "env": "prod"
  },
  "inactivity_ttl_seconds": 300,
  "message_delay_seconds": 3,
  "max_context_messages": 20,
  "forked_from_session_id": "sess_V1StGXR8Z5jdHi6B",
  "forked_from_position": 7
}

Changes

No recorded changes to this operation across all 1 revision of this API.