Skip to main content

sessions

Creates, updates, deletes, gets or lists a sessions resource.

Overview

Namesessions
TypeResource
Idaws.bedrock_agentcore.sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
actor_idstringThe identifier of the actor associated with the session. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-/]*(?::[a-zA-Z0-9-/]+)[a-zA-Z0-9-_/]</code>)
created_atstring (date-time)The timestamp when the session was created.
session_idstringThe unique identifier of the session. (pattern: <code>[a-zA-Z0-9][a-zA-Z0-9-_]*</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_sessionsselectmemory_id, actor_id, regionLists 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.
update_browser_streamupdatebrowser_identifier, sessionId, region, streamUpdateUpdates a browser stream. To use this operation, you must have permissions to perform the bedrock:UpdateBrowserStream action.
delete_capacity_provider_sessiondeletecapacity_provider_id, session_id, regionDeletes a session associated with a capacity provider in Amazon Bedrock AgentCore and makes the session unavailable for further use. To delete a capacity provider session, specify both the capacity provider identifier and the session ID. After you delete a session, you cannot restart it.
save_browser_session_profileexecprofile_identifier, region, browserIdentifier, sessionIdX-Amzn-Trace-Id, traceparentSaves the current state of a browser session as a reusable profile in Amazon Bedrock AgentCore. A browser profile captures persistent browser data such as cookies and local storage from an active session, enabling you to reuse this data in future browser sessions. To save a browser session profile, you must specify the profile identifier, browser identifier, and session ID. The session must be active when saving the profile. Once saved, the profile can be used with the StartBrowserSession operation to initialize new sessions with the stored browser state. Browser profiles are useful for scenarios that require persistent authentication, maintaining user preferences across sessions, or continuing tasks that depend on previously stored browser data. The following operations are related to SaveBrowserSessionProfile: StartBrowserSession GetBrowserSession

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
actor_idstringThe identifier of the actor for which to list sessions.
browser_identifierstringThe identifier of the browser.
capacity_provider_idstringThe unique identifier of the capacity provider associated with the session.
memory_idstringThe identifier of the AgentCore Memory resource for which to list sessions.
profile_identifierstringThe unique identifier for the browser profile. This identifier is used to reference the profile when starting new browser sessions. The identifier must follow the pattern of an alphanumeric name (up to 48 characters) followed by a hyphen and a 10-character alphanumeric suffix.
regionstringAWS region (default: us-east-1)
sessionIdstringThe identifier of the browser session.
session_idstringThe unique identifier of the capacity provider session to delete.
X-Amzn-Trace-IdstringThe trace identifier for request tracking.
traceparentstringThe parent trace information for distributed tracing.

SELECT examples

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.

SELECT
actor_id,
created_at,
session_id
FROM aws.bedrock_agentcore.sessions
WHERE memory_id = '{{ memory_id }}' -- required
AND actor_id = '{{ actor_id }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Updates a browser stream. To use this operation, you must have permissions to perform the bedrock:UpdateBrowserStream action.

UPDATE aws.bedrock_agentcore.sessions
SET
streamUpdate = '{{ streamUpdate }}',
clientToken = '{{ clientToken }}'
WHERE
browser_identifier = '{{ browser_identifier }}' --required
AND sessionId = '{{ sessionId }}' --required
AND region = '{{ region }}' --required
AND streamUpdate = '{{ streamUpdate }}' --required
RETURNING
browser_identifier,
session_id,
streams,
updated_at;

DELETE examples

Deletes a session associated with a capacity provider in Amazon Bedrock AgentCore and makes the session unavailable for further use. To delete a capacity provider session, specify both the capacity provider identifier and the session ID. After you delete a session, you cannot restart it.

DELETE FROM aws.bedrock_agentcore.sessions
WHERE capacity_provider_id = '{{ capacity_provider_id }}' --required
AND session_id = '{{ session_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Saves the current state of a browser session as a reusable profile in Amazon Bedrock AgentCore. A browser profile captures persistent browser data such as cookies and local storage from an active session, enabling you to reuse this data in future browser sessions. To save a browser session profile, you must specify the profile identifier, browser identifier, and session ID. The session must be active when saving the profile. Once saved, the profile can be used with the StartBrowserSession operation to initialize new sessions with the stored browser state. Browser profiles are useful for scenarios that require persistent authentication, maintaining user preferences across sessions, or continuing tasks that depend on previously stored browser data. The following operations are related to SaveBrowserSessionProfile: StartBrowserSession GetBrowserSession

EXEC aws.bedrock_agentcore.sessions.save_browser_session_profile
@profile_identifier='{{ profile_identifier }}' --required,
@region='{{ region }}' --required,
@X-Amzn-Trace-Id='{{ X-Amzn-Trace-Id }}',
@traceparent='{{ traceparent }}'
@@json=
'{
"browserIdentifier": "{{ browserIdentifier }}",
"sessionId": "{{ sessionId }}",
"clientToken": "{{ clientToken }}"
}'
;