Skip to main content
POST
Create a session in a workspace

Authorizations

Authorization
string
header
required

API key: key id as the username, secret as the password. An account API key carries the same scopes as an OAuth token and is checked against the scopes listed under oauth2 on each operation. A trigger API key is limited to its trigger's workspace and reaches only the session operations that list this scheme alongside the oauth2 scopes.

Path Parameters

workspace_id_or_name
string
required

Body

application/json
session_type
enum<string>
required

chat holds a conversation with agent_id, starting from initial_prompt. agent_test runs one agent version, given by agent_version_id.

Available options:
chat,
agent_test
agent_id
string

For chat: the agent to converse with, by id or name.

initial_prompt
string

For chat, required: the first message.

agent_version_id
string

For agent_test, required: the agent version to run, draft or published.

context_override_id
string

For agent_test: a context version to run with instead of the active one.

Response

The created session

id
string<uuid>
created_at
string<date-time>
updated_at
string<date-time>
initiator_id
string<uuid>

Who started this agent test session: a user, or an account API key testing from CI.

test_type
enum<string>

Eval trials run as agent-test sessions; this separates them from sessions a person started from the agent editor.

Available options:
MANUAL,
EVAL
version_override_id
string<uuid>

The specific agent version being tested in this session.

workspace_id
string<uuid>

The workspace this session belongs to.

context_id
string<uuid> | null

The context used in this session, if available.

context_override_id
string<uuid> | null

Optional context override for testing purposes.

interrupted_at
string<date-time> | null

Timestamp when this session was interrupted by a user. If set, no new messages can be sent and tasks cannot be executed.

interrupted_by_id
string<uuid> | null

User who interrupted this session.

seed_context
string | null

Optional hidden pre-seed text for this session only, prepended to the agent's context on the first turn (e.g. the onboarding handoff tour transcript). Not a workspace context.

Maximum string length: 262144