List Events
List Events
Parameters
params BetaSessionEventListParams
CreatedAtGt param.Opt[Time] OptionalQuery parameterReturn events created after this time (exclusive). Compared against the event's processed_at value.
Return events created after this time (exclusive). Compared against the event's processed_at value.
CreatedAtGte param.Opt[Time] OptionalQuery parameterReturn events created at or after this time (inclusive). Compared against the event's processed_at value.
Return events created at or after this time (inclusive). Compared against the event's processed_at value.
CreatedAtLt param.Opt[Time] OptionalQuery parameterReturn events created before this time (exclusive). Compared against the event's processed_at value.
Return events created before this time (exclusive). Compared against the event's processed_at value.
CreatedAtLte param.Opt[Time] OptionalQuery parameterReturn events created at or before this time (inclusive). Compared against the event's processed_at value.
Return events created at or before this time (inclusive). Compared against the event's processed_at value.
Limit param.Opt[int64] OptionalQuery parameter
Order BetaSessionEventListParamsOrder OptionalQuery parameterSort direction for results, ordered by the event's processed_at. Defaults to asc (chronological).
Sort direction for results, ordered by the event's processed_at. Defaults to asc (chronological).
Opaque pagination cursor from a previous response's next_page.
Types []BetaManagedAgentsSessionEventType OptionalQuery parameterFilter by event type. Values match the type field on returned events (for example, user.message or agent.tool_use). Omit to return all event types.
Filter by event type. Values match the type field on returned events (for example, user.message or agent.tool_use). Omit to return all event types.
Betas []AnthropicBeta OptionalHeader parameterThis endpoint is in beta: requests must send managed-agents-2026-04-01 in this header.
This endpoint is in beta: requests must send managed-agents-2026-04-01 in this header.
WorkspaceID param.Opt[string] OptionalHeader parameterOptional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
Returns
type BetaManagedAgentsSessionEventUnion interface{…}Union type for all event types in a session.
Union type for all event types in a session.
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
page, err := client.Beta.Sessions.Events.List(
context.TODO(),
"sesn_011CZkZAtmR3yMPDzynEDxu7",
anthropic.BetaSessionEventListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}{
"data": [
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
},
{
"id": "sevt_011CZkZHPq1jCdq5mbRTjiVn",
"content": [
{
"text": "Let me look up order #1234 for you.",
"type": "text"
}
],
"processed_at": "2026-03-15T10:00:00Z",
"type": "agent.message"
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}Returns Examples
{
"data": [
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
},
{
"id": "sevt_011CZkZHPq1jCdq5mbRTjiVn",
"content": [
{
"text": "Let me look up order #1234 for you.",
"type": "text"
}
],
"processed_at": "2026-03-15T10:00:00Z",
"type": "agent.message"
}
],
"next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}