Sessions: How to Export Sessions
Learn how to export chat sessions and their message logs from Flametree using the Portal UI or the REST API. This guide is intended for reporting and analytics workflows.
Prerequisites
- Access to Flametree Portal with permission to view Sessions
- An API key for private endpoints (request it from your Account Manager)
- Your Bot ID (for listing sessions) and Session ID (for logs)
- A tool to make HTTP requests (e.g., cURL or Postman)
Step-by-Step Guide
Option 1. Export from Flametree Portal
- Open Flametree Portal and navigate to the Sessions screen:
- Click on “Sessions export” to download sessions in CSV format:
Option 2. Export using REST API
- Swagger UI: portal.flametree.ai/api/v1/docs
💡 Note: Private endpoints require authentication. Include your API key in the
X-API-Key
header. Request the key from your Account Manager.
Hints & Tips
🔐 Authentication
Header | Value | Required | Notes |
---|---|---|---|
X-API-Key | Your personal API key (string) | ✅ | Send exactly as shown – no Bearer prefix and no extra whitespace. |
Export list of sessions
GET https://portal.flametree.ai/api/v1/private/sessions
Returns a list of chat‑session records for a given AI Agent that match the supplied filters.
curl -X GET \
'https://portal.flametree.ai/api/v1/private/sessions?bot_id=<BOT_ID>&skip=0&limit=1000&start_time_from=2025-09-03T14%3A48%3A43.431775Z&order=START' \
-H 'accept: application/json' \
-H 'X-API-Key: <API_KEY>'
💡 Note: Replace
<BOT_ID>
and<API_KEY>
with your actual values and adjust query parameters as needed.
Example response:
{
"sessions": [
{
"id": "<hidden>",
"bot_id": "<hidden>",
"conversation_id": null,
"conversation_result": {
"ClientMood": null,
"HumanNeeds": null,
"UnansweredQuery": null
},
"statistics": null,
"env_info": {
"tenant_id": "<hidden>",
"client_name": "<hidden>",
"current_date": "2025-09-04 Thu"
},
"user_info": {
"ip": "<hidden>",
"city": "Limassol",
"postal": null,
"region": "Limassol District",
"isMobile": false,
"language": "en-US",
"platform": "Win32",
"timezone": "Asia/Nicosia",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
"screenWidth": 1358,
"country_code": "CY",
"country_name": "Cyprus",
"screenHeight": 849
},
"user": {
"id": "<hidden>",
"ext_id": "<hidden>",
"type": "web",
"name": "<hidden>",
"email": null,
"phone": null
},
"tenant_id": "<hidden>",
"start_time": "2025-09-04T07:01:24.029738Z",
"finish_time": null,
"last_message_time": "2025-09-04T07:02:29.390090Z",
"logs_count": 3,
"offensive_count": 0,
"unread_messages_count": 3,
"session_type": "REGULAR",
"operator_id": null,
"status": null,
"sip_audio": false,
"transferred_to_working_operator": null,
"summary": null
},
{
"id": "<hidden>",
"bot_id": "<hidden>",
"conversation_id": null,
"conversation_result": {
"ClientMood": "Serious and possibly dissatisfied; requested human operator for a complex issue despite completed transaction.",
"HumanNeeds": "Access to account information and transfer 100 EUR from account ending 305 to USD account ending 307",
"UnansweredQuery": "User has a complex question and requested transfer to a human operator."
},
"statistics": null,
"env_info": {
"client_name": "<hidden>",
"current_date": "2025-09-03 Wed"
},
"user_info": {
"ip": "<hidden>",
"city": "Limassol",
"postal": null,
"region": "Limassol District",
"isMobile": false,
"language": "en-US",
"platform": "Win32",
"timezone": "Asia/Nicosia",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
"screenWidth": 1128,
"country_code": "CY",
"country_name": "Cyprus",
"screenHeight": 752
},
"user": {
"id": "<hidden>",
"ext_id": "<hidden>",
"type": "web",
"name": "<hidden>",
"email": null,
"phone": null
},
"tenant_id": "<hidden>",
"start_time": "2025-09-03T14:48:43.431775Z",
"finish_time": null,
"last_message_time": "2025-09-03T14:49:58.908536Z",
"logs_count": 9,
"offensive_count": 0,
"unread_messages_count": 9,
"session_type": "OPERATOR",
"operator_id": null,
"status": null,
"sip_audio": false,
"transferred_to_working_operator": null,
"summary": null
}
],
"next_index": null
}
Export session logs (dialog)
GET https://portal.flametree.ai/api/v1/private/sessions/{session_id}/logs
Returns the dialog (message logs) from a session.
curl -X 'GET' \
'https://portal.flametree.ai/api/v1/private/sessions/<SESSION_ID>/logs?with_internal=true&skip=0&limit=1000' \
-H 'accept: application/json' \
-H 'X-API-Key: <API_KEY>'
💡 Note: Replace
<SESSION_ID>
and<API_KEY>
with your actual values and adjust query parameters as needed.
Example response:
{
"logs": [
{
"id": <hidden>,
"timestamp": "2025-09-04T07:02:29.390090Z",
"role": "AI",
"is_offensive": false,
"feedback": null,
"text": "At this time, I am unable to access personalized special offers for you. Please check the <hidden> website or visit a branch for the latest promotions. How else may I assist you today?",
"meta": {
"conversation_result": {
"ClientMood": null,
"HumanNeeds": null,
"UnansweredQuery": null
}
},
"status": null,
"status_time": null,
"attachments": []
},
{
"id": <hidden>,
"timestamp": "2025-09-04T07:02:19.337653Z",
"role": "HUMAN",
"is_offensive": false,
"feedback": null,
"text": "do you have special offers for me?",
"meta": {},
"status": null,
"status_time": null,
"attachments": []
},
{
"id": <hidden>,
"timestamp": "2025-09-04T07:01:24.056444Z",
"role": "AI",
"is_offensive": false,
"feedback": null,
"text": "Good day, <hidden>. Welcome to <hidden>. How can I assist you with your banking needs today?",
"meta": {
"conversation_result": {
"ClientMood": null,
"HumanNeeds": null,
"UnansweredQuery": null
}
},
"status": null,
"status_time": null,
"attachments": []
}
],
"next_index": null
}