Conversations
Read, rename, delete and export saved conversations.
Base URL https://futuresmart.ai/database-agent/api · every request sends X-API-Key. Samples read the key from DATABASE_AGENT_API_KEY. All endpoints
Export an answer's rows as CSV
/v1/sessions/{session_id}/exportReturn a fresh S3 pre-signed CSV download URL.
- chat_id provided → that exact query turn's CSV (works forever).
- No chat_id → most recent SQL result in the session.
UI only needs session_id + chat_id (both already in the orchestration response). No NL2SQL agent_id required.
Credential Database Agent API key for this agent (X-API-Key)
Path parameters
| Name | Type | Description |
|---|---|---|
session_idrequired | string | Session ID |
Query parameters
| Name | Type | Description |
|---|---|---|
chat_id | string | null | Specific chat turn to export. Omit to get the most recent. |
Other responses
422Validation Error
List conversations
/v1/agents/{agent_id}/sessionsGet all sessions for a specific agent
Returns a list of chat sessions associated with the agent.
- If authenticated, returns sessions for the authenticated user
- If
show_guests_session=trueand user is owner, includes guest sessions
Credential Database Agent API key for this agent (X-API-Key)
Path parameters
| Name | Type | Description |
|---|---|---|
agent_idrequired | string | Agent ID |
Query parameters
| Name | Type | Description |
|---|---|---|
show_guests_session | boolean | Include guest sessions (owner only) |
email | string | null | Filter by email |
Other responses
422Validation Error
Get a conversation
/v1/agents/{agent_id}/sessions/{session_id}Get a specific session by ID with conversation data
Returns session details including:
- Session metadata (title, created time)
- Full conversation history
Credential Database Agent API key for this agent (X-API-Key)
Path parameters
| Name | Type | Description |
|---|---|---|
agent_idrequired | string | Agent ID |
session_idrequired | string | Session ID |
Other responses
422Validation Error
Rename a conversation
/v1/agents/{agent_id}/sessions/{session_id}Update a session (partial update)
Currently supports updating:
- session_title: Update the session title
Credential Database Agent API key for this agent (X-API-Key)
Path parameters
| Name | Type | Description |
|---|---|---|
agent_idrequired | string | Agent ID |
session_idrequired | string | Session ID |
Request body · application/json (optional)
| Name | Type | Description |
|---|---|---|
session_title | string | null | New session title |
user_id | string | null | User ID (optional) |
Other responses
422Validation Error
Example request body
{}Delete a conversation
/v1/agents/{agent_id}/sessions/{session_id}Delete a session (soft delete)
Marks the session as deleted in the database. The session data is not physically removed.
Credential Database Agent API key for this agent (X-API-Key)
Path parameters
| Name | Type | Description |
|---|---|---|
agent_idrequired | string | Agent ID |
session_idrequired | string | Session ID |
Other responses
422Validation Error