Get one widget conversation thread
Read one widget thread from the visitor’s browser, with the widget key and the visitor token it started with. A key alone reaches no thread.
GET
/
widget
/
conversations
/
{conversation_id}
// Runs on your website.
const MITHUNAI_API = `${MITHUNAI_URL}/mithunai/api/v1`
const WIDGET_KEY = 'mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e'
const conversationId = sessionStorage.getItem('mithunai.conversation')
const response = await fetch(`${MITHUNAI_API}/widget/conversations/${conversationId}`, {
headers: {
'X-MITHUNAI-Widget-Key': WIDGET_KEY,
'X-MITHUNAI-Visitor-Token': sessionStorage.getItem('mithunai.visitorToken'),
},
})
console.log(await response.json())
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/widget/conversations/0e6a9b52-7d3f-4c18-a2e5-9b8c7d6e5f4a" \
--header "X-MITHUNAI-Widget-Key: mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" \
--header "X-MITHUNAI-Visitor-Token: $VISITOR_TOKEN" \
--header "Origin: https://docs.example.com"
{
"id": "0e6a9b52-7d3f-4c18-a2e5-9b8c7d6e5f4a",
"assistant_id": "5b1e9c2a-7d4f-4e3b-9a61-0c8f2d7e4a13",
"title": "How do I raise my rate limit?",
"status": "active",
"turn_state": "idle",
"message_count": 2,
"created_at": "2026-09-24T10:02:17.559310+00:00",
"updated_at": "2026-09-24T10:02:24.910447+00:00",
"owner": { "type": "widget", "id": "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" },
"metadata": { "page": "/guides/rate-limits" }
}
{ "code": "authentication_error", "message": "Authentication is required." }
{ "code": "authorization_error", "message": "This widget may not be embedded from that origin." }
{ "code": "not_found", "message": "The requested resource was not found." }
Call this from the visitor’s browser. It takes the embed’s public widget key in
X-MITHUNAI-Widget-Key, and the browser’s Origin must be allowed by both the deployment’s allowed_origins and the platform-wide widget allowlist. See Website widget.
You must also send the thread’s X-MITHUNAI-Visitor-Token. A missing token, another thread’s token, an unknown conversation ID and a malformed ID all return the same 404, so a visitor cannot probe for other visitors’ threads.
A refusal made before the key and the origin are accepted (a missing or invalid key, an origin the deployment does not allow, or the per-address limit checked before the key is read) carries no Access-Control-Allow-Origin header, so in a cross-origin browser request fetch rejects with a network error instead of exposing the error body. Once the key is accepted and the origin is allowed, every response carries the header, refusals included, so your page can read a 404, a 429 and its Retry-After.
string
required
The conversation’s ID (UUID), from Start a widget
conversation.
string
required
The deployment’s public widget key,
mithunai_wk_….string
required
The visitor token returned when this thread was started.
string
required
Set by the browser. It must exactly match an origin allowed for this deployment. When you call
from outside a browser, set it yourself.
Response
string
required
The conversation’s ID (UUID).
string
required
The assistant the deployment embeds.
string
required
The thread’s title.
string
required
active or archived.string
required
idle when ready for a question, or awaiting_answer while an answer is being generated.integer
required
Number of messages, questions and answers together.
string
required
ISO 8601 in UTC.
string
required
ISO 8601 in UTC.
object
required
{"type": "widget", "id": <deployment ID>}.object
required
The metadata sent when the thread was started.
// Runs on your website.
const MITHUNAI_API = `${MITHUNAI_URL}/mithunai/api/v1`
const WIDGET_KEY = 'mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e'
const conversationId = sessionStorage.getItem('mithunai.conversation')
const response = await fetch(`${MITHUNAI_API}/widget/conversations/${conversationId}`, {
headers: {
'X-MITHUNAI-Widget-Key': WIDGET_KEY,
'X-MITHUNAI-Visitor-Token': sessionStorage.getItem('mithunai.visitorToken'),
},
})
console.log(await response.json())
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/widget/conversations/0e6a9b52-7d3f-4c18-a2e5-9b8c7d6e5f4a" \
--header "X-MITHUNAI-Widget-Key: mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" \
--header "X-MITHUNAI-Visitor-Token: $VISITOR_TOKEN" \
--header "Origin: https://docs.example.com"
{
"id": "0e6a9b52-7d3f-4c18-a2e5-9b8c7d6e5f4a",
"assistant_id": "5b1e9c2a-7d4f-4e3b-9a61-0c8f2d7e4a13",
"title": "How do I raise my rate limit?",
"status": "active",
"turn_state": "idle",
"message_count": 2,
"created_at": "2026-09-24T10:02:17.559310+00:00",
"updated_at": "2026-09-24T10:02:24.910447+00:00",
"owner": { "type": "widget", "id": "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" },
"metadata": { "page": "/guides/rate-limits" }
}
{ "code": "authentication_error", "message": "Authentication is required." }
{ "code": "authorization_error", "message": "This widget may not be embedded from that origin." }
{ "code": "not_found", "message": "The requested resource was not found." }
Last modified on November 7, 2026
// Runs on your website.
const MITHUNAI_API = `${MITHUNAI_URL}/mithunai/api/v1`
const WIDGET_KEY = 'mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e'
const conversationId = sessionStorage.getItem('mithunai.conversation')
const response = await fetch(`${MITHUNAI_API}/widget/conversations/${conversationId}`, {
headers: {
'X-MITHUNAI-Widget-Key': WIDGET_KEY,
'X-MITHUNAI-Visitor-Token': sessionStorage.getItem('mithunai.visitorToken'),
},
})
console.log(await response.json())
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/widget/conversations/0e6a9b52-7d3f-4c18-a2e5-9b8c7d6e5f4a" \
--header "X-MITHUNAI-Widget-Key: mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" \
--header "X-MITHUNAI-Visitor-Token: $VISITOR_TOKEN" \
--header "Origin: https://docs.example.com"
{
"id": "0e6a9b52-7d3f-4c18-a2e5-9b8c7d6e5f4a",
"assistant_id": "5b1e9c2a-7d4f-4e3b-9a61-0c8f2d7e4a13",
"title": "How do I raise my rate limit?",
"status": "active",
"turn_state": "idle",
"message_count": 2,
"created_at": "2026-09-24T10:02:17.559310+00:00",
"updated_at": "2026-09-24T10:02:24.910447+00:00",
"owner": { "type": "widget", "id": "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" },
"metadata": { "page": "/guides/rate-limits" }
}
{ "code": "authentication_error", "message": "Authentication is required." }
{ "code": "authorization_error", "message": "This widget may not be embedded from that origin." }
{ "code": "not_found", "message": "The requested resource was not found." }