Skip to content

Bedrock Agentcore  >  Operations  >  list_sessions

list_sessions

Operation

list_sessions async

list_sessions(input: ListSessionsInput, plugins: list[Plugin] | None = None) -> ListSessionsOutput

Lists sessions in an AgentCore Memory resource based on specified criteria. We recommend using pagination to ensure that the operation returns quickly and successfully.

Empty sessions are automatically deleted after one day.

To use this operation, you must have the bedrock-agentcore:ListSessions permission.

Parameters:

Name Type Description Default
input ListSessionsInput

An instance of ListSessionsInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
ListSessionsOutput

An instance of ListSessionsOutput.

Input

ListSessionsInput dataclass

Dataclass for ListSessionsInput structure.

Attributes

actor_id class-attribute instance-attribute
actor_id: str | None = None

The identifier of the actor for which to list sessions.

filter class-attribute instance-attribute
filter: SessionFilter | None = None

Filter criteria to apply when listing sessions.

max_results class-attribute instance-attribute
max_results: int = 100

The maximum number of results to return in a single call. The default value is 20.

memory_id class-attribute instance-attribute
memory_id: str | None = None

The identifier of the AgentCore Memory resource for which to list sessions.

next_token class-attribute instance-attribute
next_token: str | None = None

The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Output

ListSessionsOutput dataclass

Dataclass for ListSessionsOutput structure.

Attributes

next_token class-attribute instance-attribute
next_token: str | None = None

The token to use in a subsequent request to get the next set of results. This value is null when there are no more results to return.

session_summaries instance-attribute
session_summaries: list[SessionSummary]

The list of session summaries that match the specified criteria.