Skip to main content

Session object

Returned by create, get, list, update, and archive endpoints.
FieldTypeDescription
idstringSession ID with the sess_ prefix
typestringAlways "session"
agentAgent objectAgent snapshot captured when the session was created
agent_idstringAgent ID used by this session
environment_idstringEnvironment ID used by this session
statusstringSession lifecycle status, such as idle, running, or terminated
turn_statusstringCurrent turn status. Defaults to idle when empty
titlestringSession title
metadataobjectMetadata object
resourcesarray of Session resourceFiles or repositories attached to the session. Defaults to []
vault_idsarray of stringVault IDs attached to the session. Defaults to []
memory_store_idsarray of stringMemory Store IDs attached to the session. Defaults to []
statsSession statsSession statistics
archived_atstring | nullArchive time, or null when not archived
created_atstringCreation time
updated_atstringLast update time

Agent reference

agent in create requests can be either a string Agent ID or this object:
FieldTypeRequiredDescription
idstringYesAgent ID with the agent_ prefix
typestringNoOptional marker
versionintegerNoAgent version to snapshot. Omit or pass 0 to use the latest active version

Inline environment

environment in create requests can be an Environment ID string or this object.
FieldTypeRequiredDescription
namestringNoEnvironment name. Defaults to "Session Environment" when omitted or blank
descriptionstringNoEnvironment description
configEnvironment configYesEnvironment configuration
metadataobjectNoMetadata object

Session resource

resources[] is a union distinguished by type.

File resource

FieldTypeRequiredDescription
typestringNo"file". Defaults to "file" when omitted
file_idstringYesFile ID with the file_ prefix. The file must be in ready status
pathstringNoMount path in the container. Defaults to /data/{file_id}. Relative values are prefixed with /data/; the normalized path must stay under /data/ and be at most 512 characters
mount_pathstringNoRequest alias for path. If both are provided, they must be identical. Responses store the normalized value as path

GitHub repository resource

FieldTypeRequiredDescription
typestringYes"github_repository"
urlstringYesRepository URL
mount_pathstringNoClone target path in the container
authorization_tokenstringNoToken for private repository access

Session stats

FieldTypeDescription
active_secondsnumberActive processing time in seconds. New sessions start at 0
duration_secondsnumberSession duration in seconds. New sessions start at 0

Event object

Events returned by the send-event, list-events, and stream endpoints are event-specific JSON objects with these common fields.
FieldTypeDescription
idstringEvent ID with the evt_ prefix
typestringEvent type
schema_versionstringEvent schema version, currently "1.0" for CAS-created user events
session_idstringOwning Session ID
turn_idstringPresent when the event belongs to a turn
created_atstringCreation time
processed_atstring | nullProcessing time

Client event request types

TypeRequired fieldsNotes
user.messagecontentStarts a new turn. content can be a string or an array of content blocks
user.interruptnoneRequests interruption/cancellation
user.tool_confirmationtool_use_id, resultresult must be allow or deny; deny_message is optional
user.custom_tool_resultcustom_tool_use_idcontent is optional and is stored as text content blocks
user.define_outcomenone enforcedAdditional fields are preserved

Start a session

Run an agent against an environment as a stateful conversation.