Chat
Ask questions and follow-ups. Every call is scoped to one agent.
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
Ask a question
POST
/v1/agents/{agent_id}/chatSend a chat message to an agent
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 |
|---|---|---|
stream | boolean | Enable streaming response |
Request body · application/json (optional)
| Name | Type | Description |
|---|---|---|
user_id | string | null | End-user ID; honored only for master-key (server-to-server) callers |
queryrequired | string | Natural language query |
session_id | string | null | Session ID (creates new if not provided) |
debug_info | boolean | null | Include debug information in response. Omit to use the agent's saved setting. |
chart_output | boolean | null | Include chart output in response. Omit to use the agent's saved setting. |
allowed_charts | array<string> | null | List of allowed chart types. Omit to use the agent's saved setting. |
follow_up | boolean | null | If true, also generate exactly two short follow-up questions for this turn. Omit to use the agent's saved setting. |
Other responses
422Validation Error
Example request body
JSON
{
"query": "How many orders were placed last month?"
}Get a conversation's messages
GET
/v1/agents/{agent_id}/sessions/{session_id}/messagesGet message history for a session
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
Ask a follow-up in a conversation
POST
/v1/agents/{agent_id}/sessions/{session_id}/messagesSend a message to an existing session
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 |
Query parameters
| Name | Type | Description |
|---|---|---|
stream | boolean | Enable streaming response |
Request body · application/json (optional)
| Name | Type | Description |
|---|---|---|
user_id | string | null | End-user ID; honored only for master-key (server-to-server) callers |
queryrequired | string | Natural language query |
debug_info | boolean | null | Include debug information in response. Omit to use the agent's saved setting. |
chart_output | boolean | null | Include chart output in response. Omit to use the agent's saved setting. |
allowed_charts | array<string> | null | List of allowed chart types. Omit to use the agent's saved setting. |
follow_up | boolean | null | If true, also generate exactly two short follow-up questions for this turn. Omit to use the agent's saved setting. |
Other responses
422Validation Error
Example request body
JSON
{
"query": "How many orders were placed last month?"
}Rate an answer
POST
/v1/agents/{agent_id}/feedbackSubmit feedback on agent responses
Credential Database Agent API key for this agent (X-API-Key)
Path parameters
| Name | Type | Description |
|---|---|---|
agent_idrequired | string | Agent ID |
Request body · application/json (optional)
| Name | Type | Description |
|---|---|---|
user_id | string | null | User ID (optional) |
session_idrequired | string | Session ID |
chat_idrequired | string | Chat message ID |
user_queryrequired | string | Original user query |
generated_queryrequired | string | Generated SQL query |
labelrequired | string | Feedback label: 'correct' or 'incorrect' |
corrected_query | string | null | Corrected SQL query (optional, for incorrect feedback) |
Other responses
422Validation Error
Example request body
JSON
{
"session_id": "<session_id>",
"chat_id": "<chat_id>",
"user_query": "<user_query>",
"generated_query": "<generated_query>",
"label": "<label>"
}