Skip to content

Retrieve Conversation

Retrieve a single conversation.

GET /agents/{agentId}/conversations/{conversationId}


agentId string Required

The agent id

conversationId string Required

The conversation id


type InconvoConversation = {
id: string;
userContext: Record<string, number | string>;
messages: {
message: string;
type: "text" | "chart" | "table";
id?: string; // id exists only for an Inconvo response
chart?: {
$schema: "https://vega.github.io/schema/vega-lite/v5.json";
// ... vega-lite spec
};
table?: {
head: string[];
body: string[][];
};
}[];
};
Request
import Inconvo from "@inconvoai/node";
const inconvo = new Inconvo({
apiKey: process.env.INCONVO_API_KEY
});
const conversation = await inconvo.agents.conversations.retrieve(
"convo_abc123",
{
agentId: "agt_123"
}
);
console.log(conversation);
Response
{
"id": "convo_abc123",
"userContext": {
"organisationId": 1
},
"messages": [
{
"type": "text",
"message": "What is our most popular product this quarter?"
},
{
"id": "64683e57-6601-4241-8afd-376418c84068",
"type": "text",
"message": "The most popular product this quarter is the iPhone 15, with 8 units ordered (from the start of this quarter to date)."
}
]
}
curl -X GET "https://app.inconvo.ai/api/v1/agents/agt_123/conversations/convo_abc123" \
-H "Authorization: Bearer $INCONVO_API_KEY"
Response
{
"id": "convo_abc123",
"userContext": {
"organisationId": 1
},
"messages": [
{
"type": "text",
"message": "What is our most popular product this quarter?"
},
{
"id": "64683e57-6601-4241-8afd-376418c84068",
"type": "text",
"message": "The most popular product this quarter is the iPhone 15, with 8 units ordered (from the start of this quarter to date)."
}
]
}