Claude Platform Docs

Threads

List Session Threads
client.Beta.Sessions.Threads.List(ctx, sessionID, params) (*PageCursor[BetaManagedAgentsSessionThread], error)
GET/v1/sessions/{session_id}/threads
Get Session Thread
client.Beta.Sessions.Threads.Get(ctx, threadID, params) (*BetaManagedAgentsSessionThread, error)
GET/v1/sessions/{session_id}/threads/{thread_id}
Archive Session Thread
client.Beta.Sessions.Threads.Archive(ctx, threadID, params) (*BetaManagedAgentsSessionThread, error)
POST/v1/sessions/{session_id}/threads/{thread_id}/archive
Models
type BetaManagedAgentsSessionThread struct{…}

An execution thread within a session. Each session has one primary thread plus zero or more child threads spawned by the coordinator.

type BetaManagedAgentsSessionThreadStats struct{…}

Timing statistics for a session thread.

ActiveSeconds float64 Optional

Cumulative time in seconds the thread spent actively running. Excludes idle time.

formatdouble
DurationSeconds float64 Optional

Elapsed time since thread creation in seconds. For archived threads, frozen at the final update.

formatdouble
StartupSeconds float64 Optional

Time in seconds for the thread to begin running. Zero for child threads, which start immediately.

formatdouble
type BetaManagedAgentsSessionThreadStatus string

SessionThreadStatus enum

One of the following:
const BetaManagedAgentsSessionThreadStatusRunning BetaManagedAgentsSessionThreadStatus = "running"
const BetaManagedAgentsSessionThreadStatusIdle BetaManagedAgentsSessionThreadStatus = "idle"
const BetaManagedAgentsSessionThreadStatusRescheduling BetaManagedAgentsSessionThreadStatus = "rescheduling"
const BetaManagedAgentsSessionThreadStatusTerminated BetaManagedAgentsSessionThreadStatus = "terminated"
type BetaManagedAgentsSessionThreadUsage struct{…}

Cumulative token usage for a session thread across all turns.

type BetaManagedAgentsStreamSessionThreadEventsUnion interface{…}

Server-sent event in a single thread's stream.

One of the following:

ThreadsEvents

List Session Thread Events
client.Beta.Sessions.Threads.Events.List(ctx, threadID, params) (*PageCursor[BetaManagedAgentsSessionEventUnion], error)
GET/v1/sessions/{session_id}/threads/{thread_id}/events
Stream Session Thread Events
client.Beta.Sessions.Threads.Events.Stream(ctx, threadID, params) (*BetaManagedAgentsStreamSessionThreadEventsUnion, error)
GET/v1/sessions/{session_id}/threads/{thread_id}/stream