Delete a session and all of its data - Amazon Bedrock
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

Delete a session and all of its data

After you end a session, you can delete it with the DeleteSession API operation. Deleting a session deletes all Invocations, and InvocationSteps and associated data. You can’t undo deleting a session.

The following example code shows how to delete a session with the AWS SDK for Python (Boto3).

def delete_session(session_identifier): try: client.delete_session( sessionIdentifier=session_identifier ) print("session deleted") except ClientError as e: print(f"Error: {e}")