Using session parameters and metadata in the AI Agents API
You can use conversation session parameters to store information about the visitor, the conversation, or any other relevant data. Session parameters allow you to personalize dialogs and maintain context within each conversation. Parameters are isolated per session. Data is unique to each ongoing conversation with the bot.
Using the metadata field
Both the AI Agent Chat API and Ticket API support storing session data using the metadata field. Use this field to store values such as an email address, order number, or other custom properties associated with the conversation.
Include the metadata field in your API requests when sending chat or ticket events. These values are stored in the current conversation session, and you can access them later for dialog personalization or integration with backend systems.
{"event": "message","metadata": {"email": "[email protected]","orderNumber": "123456"},"message": "I'd like to check my order status."}
For a list of supported events and more details on managing conversation flow, see Event types and conversation flow.