API reference
Conversations
What visitors and the API said, with outcomes, sources and campaigns.
GET /agents/{agent_id}/conversations
List an agent's conversations
Conversations of the agent, newest first, across every channel (the website widget, the hosted page, the API, email, Slack and voice). Filter by state and channel; page with cursor.
Scope: conversations:read
Parameters
agent_idrequired in the path ·stringlimitoptional in the query ·integerRows per page, 1 to 100.
cursoroptional in the query ·stringThe next_cursor of the previous page.
stateoptional in the query ·"ai_active" | "handoff_requested" | "human_active" | "closed"Only conversations in this state.
channeloptional in the query ·"website" | "hosted" | "api" | "email" | "slack" | "voice_web"Only conversations on this channel: website (the chat bubble on a site), hosted (the chat page), api, email, slack or voice_web.
Returns Conversation
idrequiredstringId
agent_idrequiredstringAgent Id
channelrequiredstringwebsite, hosted (the hosted chat page), api, email, slack or voice_web (a browser voice session). The same words as the dashboard's conversation log and the webhooks.
staterequiredstringai_active, handoff_requested, human_active or closed.
started_atrequiredstringStarted At
last_message_atoptionalstringLast Message At
expires_atrequiredstringExpires At
lead_capturedrequiredbooleanLead Captured
summaryoptionalstringSummary
page_urloptionalstringPage Url
utmoptionalobjectThe campaign that brought the visitor: any of utm_source, utm_medium, utm_campaign, utm_term and utm_content, as the first page of the visit carried them. Empty when there was none.
referreroptionalstringThe site that sent the visitor (scheme, host and path, never the query string). Empty when there was none.
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/agents/AGENT_ID/conversations \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"GET /conversations/{conversation_id}
Get a conversation
One conversation: its state, timestamps and the summary the inbox shows.
Scope: conversations:read
Parameters
conversation_idrequired in the path ·string
Returns Conversation
idrequiredstringId
agent_idrequiredstringAgent Id
channelrequiredstringwebsite, hosted (the hosted chat page), api, email, slack or voice_web (a browser voice session). The same words as the dashboard's conversation log and the webhooks.
staterequiredstringai_active, handoff_requested, human_active or closed.
started_atrequiredstringStarted At
last_message_atoptionalstringLast Message At
expires_atrequiredstringExpires At
lead_capturedrequiredbooleanLead Captured
summaryoptionalstringSummary
page_urloptionalstringPage Url
utmoptionalobjectThe campaign that brought the visitor: any of utm_source, utm_medium, utm_campaign, utm_term and utm_content, as the first page of the visit carried them. Empty when there was none.
referreroptionalstringThe site that sent the visitor (scheme, host and path, never the query string). Empty when there was none.
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/conversations/CONVERSATION_ID \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"GET /conversations/{conversation_id}/messages
List a conversation's messages
The messages in the order they were said, with the outcome and the sources behind each AI answer.
Scope: conversations:read
Parameters
conversation_idrequired in the path ·stringlimitoptional in the query ·integerRows per page, 1 to 100.
cursoroptional in the query ·stringThe next_cursor of the previous page.
Returns Message
idrequiredstringId
rolerequiredstringuser or assistant.
contentrequiredstringContent
actor_typerequiredstringvisitor, ai or owner (a person on the team replied).
outcomeoptionalstringWhat the turn came to, on AI answers.
refusedrequiredbooleanRefused
sourcesrequired[]The knowledge behind an AI answer.
blocksoptional[]The widgets an answer carried (a form, open times, options, a status card, products, links), each as the widget draws it; null for a plain message.
langoptionalstringLang
feedbackoptionalFeedback
created_atrequiredstringCreated At
Responses
200Successful Response401Missing, invalid, revoked or expired key. Leaving the workspace, or being removed from it, revokes the keys a teammate made; a key whose maker's membership ended any other way answerskey_maker_left.403The plan has no API, the key lacks the scope, or the role of the teammate who made the key no longer allows it (maker_role_limit; a publishable key saysinsufficient_scope).404Nothing by that id in this workspace.413The request body is larger than this route accepts (1 MB; 3 MB for a text source). On a source:plan_text_limit, the agent's plan cannot hold more text (limit_chars,used_chars).422The request did not validate;detailslists the fields.429Rate limit reached; waitRetry-Afterseconds.500Our fault; quoterequest_idto support.
curl https://www.bidii.ai/api/v2/conversations/CONVERSATION_ID/messages \
-H "Authorization: Bearer bidi_sk_YOUR_KEY"