Allows you to create a new chat session within Scoopika. This session serves as a container for user interactions with your agents, storing conversation history and potentially user information.

Arguments

Takes one arguments passed as an object with the following properties:

id
string
default: "crypto.randomUUID()"

The session ID to create. should be unique. if not provided a random ID will be generated.

user_id
string

Allows you to associate the new session with a specific user by providing their ID. Including user_id enables you to later retrieve all sessions belonging to that user using the listUserSessions method.

user_name
string

Allows you to specify the user’s name for this session. Providing a user name can potentially be used by the agent to personalize interactions by addressing the user by name.

Response

session
Promise<StoreSession>

Returns a Promise that resolves to the created session as a StoreSession object.

Reference to StoreSession