Show AI agent sources and images in your own chat
How AI agent answers arrive through the API and webhooks: numbered citation links, a sources list, and related images you can show in your own chat.
When you build your own chat on the Featurebase API, answers from the Fibi AI Agent arrive ready to show. Citations are numbered links, each answer lists its sources, and related images follow as a separate message. This is the same content your customers see in the Messenger.
Where answers appear
An AI agent answer is a conversation part with partType set to bot_msg. You receive it in two places:
In
conversationPartswhen you get a conversationIn
data.itemof theconversation.admin.repliedwebhook event
Both return the same content, in every API version.
Sources and citations
An answer that cites your knowledge sources looks like this. Other fields of the part are left out:
{
"partType": "bot_msg",
"bodyHtml": "<p>Open Settings and connect your account <a href=\"https://help.example.com/articles/connect\" target=\"_blank\" rel=\"noopener noreferrer\">[1]</a>.</p>",
"bodyMarkdown": "Open Settings and connect your account [[1]](https://help.example.com/articles/connect).",
"sources": [
{ "title": "Connect your account", "url": "https://help.example.com/articles/connect" }
]
}bodyHtmlandbodyMarkdown: the answer text. Each citation is a[n]link to its source.sources: the sources the AI agent used, each with atitleand aurl. The citation[n]links tosources[n-1].
Show bodyHtml as it is to get clickable citations, or build your own source list from sources.
sources lists only sources with a public web address. An answer without such a source has no sources field.
Images
When an answer has related images, they arrive as a second bot_msg right after the answer:
{
"partType": "bot_msg",
"bodyHtml": "<div><img src=\"https://files.example.com/connect-screen.png\" alt=\"The Connect button in Settings\"></div>"
}bodyHtml has one <img> for each image, and bodyMarkdown has the same images as markdown images. With webhooks, this message arrives as its own conversation.admin.replied event.
💡 Links to images that Featurebase hosts can expire after 30 minutes. Show the image right away or copy it to your own storage. To get a fresh link, get the conversation again.
More in Getting started
Receive events with webhooksWebhook events referenceCall the API with OIDC instead of an API keyStill need help? Ask the team