Skip to content

Create an answer

Creates an answer. Provide a question and context, and Inconvo will return the answer in text, chart, or table format.

POST https://app.inconvo.ai/api/v1/conversations/answer


question string Required

A natural language question.


context object Required

A JSON object of arbitrary key-value pairs that describe the caller’s tenancy or permission context. In the backend context filters map these keys to table columns to restrict every query to the appropriate tenant or access scope.


conversationId string Optional

The unique ID of a conversation. If not passed Inconvo will create a new conversation for the answer. Use this to create multi-turn conversations.


type Answer = {
id: string;
conversationId: string;
message: string;
type: "text" | "chart" | "table";
chart?: {
type: "line" | "bar";
data: {
label: string;
value: number;
}[];
};
table?: {
headers: string[];
rows: string[][];
};
};
Request
curl -X POST "https://app.inconvo.ai/api/v1/conversations/answer" \
-H "Authorization: Bearer $INCONVO_API_KEY" \
-H "Content-Type: application/json" \
-d $'{
"question": "What is our most popular product?",
"context": {
"organisationId": 1
}
}'
Response
{
"id": "57ad0f60-617d-4d4c-a2ed-63e3bf0413ff",
"conversationId": "2c4d3456-e1f7-4d36-a8fd-f5cf15491d00",
"type": "text",
"message": "Your most popular product is the iPhone 15, with a total of 24,840 orders.",
}