Skip to main content

Chats

Tags: chat, communication, messaging, voice

A Chat is a conversation thread between Members, Agents, and staff. These endpoints create chats, send and read messages, manage participants, place and inspect voice calls, and export conversation history and statistics.

In the product: Chats

Resources​

Request and response models used by the endpoints on this page.

AddChatParticipantRequest​

FieldTypeRequiredDescription
memberIdInteger✓
roleLiteral['user', 'assistant', 'contributor', 'supervisor']Default: contributor

Example:

{
"memberId": 0,
"role": "contributor"
}

BaseAssistantResponse​

FieldTypeRequiredDescription
chatModelString
chatModelConfigDict[str, Any]
codeInterpreterEnabledBooleanDefault: False
descriptionString
idInteger
identityString
nameString✓
orgAgentUuidString
realtimeModelString
realtimeModelConfigDict[str, Any]
toolsArrayDefault: []
webBrowserEnabledBooleanDefault: False

Example:

{
"name": "string",
"tools": [],
"codeInterpreterEnabled": false,
"webBrowserEnabled": false
}

ChatApprovalDecision​

FieldTypeRequiredDescription
answerLiteral['approve', 'approve_always', 'reject', 'edit', 'other']✓
callIdString✓
toolString✓

Example:

{
"callId": "string",
"tool": "string",
"answer": "approve"
}

ChatInterruptResponse​

FieldTypeRequiredDescription
checkoutUrlString
descriptionString
guidedLiteral[beat, question]
interruptIdString
openuiMarkupString
paymentCompleteBoolean
priceString
productNameString
specDataObject
specIdInteger
specStatusString
specTitleString
typeString
userPromptString

Example:

{}

ChatLabelResponse​

FieldTypeRequiredDescription
colorString✓
descriptionString✓
idInteger✓
nameString✓
slugString✓
uuidString✓

Example:

{
"id": 0,
"uuid": "string",
"name": "string",
"slug": "string",
"color": "string",
"description": "string"
}

ChatParticipantAddedResponse​

FieldTypeRequiredDescription
messageString✓
participantIdInteger✓
successBoolean✓

Example:

{
"success": false,
"message": "string",
"participantId": 0
}

ChatParticipantResponse​

FieldTypeRequiredDescription
additionalInstructionsString
avatarColorLiteral[teal, sky, blue, indigo, violet, fuchsia, slate]
avatarIconLiteral[user, stethoscope, heart, shield, sparkles, star]
avatarUrlString
chatModelString
chatModelConfigDict[str, Any]
memberIdInteger
memberTypeString
nameString✓
orgAgentConfigRevisionInteger
orgAgentUuidString
orgAgentVoiceWarningBooleanDefault: False
realtimeModelString
realtimeModelConfigDict[str, Any]
roleString✓

Example:

{
"name": "string",
"role": "string",
"orgAgentVoiceWarning": false
}

ChatResponse​

FieldTypeRequiredDescription
activeInteractionModeLiteral[text, push_to_talk, realtime]
archivedBoolean✓
assignmentIdInteger✓
canSendAsAssistantBoolean✓
channelString✓
chatTypeString✓
createdAtDateTime✓
creationSourceLiteral[web_arrival, inbound_channel, outbound_action, operator_create, background_run, qualification_run]
currentTaskNameString
directionLiteral['inbound', 'outbound', 'unknown']Default: unknown
folderIdInteger✓
fromMessageIdInteger✓
hasRealtimeInteractionBooleanDefault: False
idInteger✓
inboxIdInteger✓
initialMessageErrorString
initiatorLiteral['member', 'workspace', 'system', 'unknown']Default: unknown
interruptChatInterruptResponse | null
isStarredBooleanDefault: False
isTestBoolean✓
labelsArray<ChatLabelResponse>✓
lastMessageReceivedAtDateTime✓
messageCountInteger✓
muteExpiresOnInboundBooleanDefault: False
muteReasonString
mutedBoolean✓
mutedAtDateTime
mutedByMemberIdInteger
outboundCallReceiptOutboundDialQueued
participantsArray<ChatParticipantResponse>✓
pausedBoolean✓
pausedAtDateTime✓
pausedReasonString✓
phoneNumberIdInteger✓
siteIdInteger✓
summaryString✓
summaryUpdatedAtDateTime✓
titleString✓
transportLiteral['web', 'pstn', 'sms', 'whatsapp', 'email', 'fax', 'slack', 'teams', 'discord', 'direct_message', 'a2a', 'routine', 'background', 'cli', 'frame', 'unknown']Default: unknown
updatedAtDateTime✓
uuidString✓
workflowIdInteger✓
workflowRevisionIdInteger

Example:

{
"id": 0,
"uuid": "string",
"archived": false,
"isStarred": false,
"muted": false,
"muteExpiresOnInbound": false,
"channel": "string",
"transport": "unknown",
"direction": "unknown",
"initiator": "unknown",
"hasRealtimeInteraction": false,
"chatType": "string",
"paused": false,
"pausedAt": "2024-01-01T00:00:00Z",
"pausedReason": "string",
"assignmentId": 0,
"workflowId": 0,
"fromMessageId": 0,
"phoneNumberId": 0,
"inboxId": 0,
"siteId": 0,
"folderId": 0,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"title": "string",
"summary": "string",
"summaryUpdatedAt": "2024-01-01T00:00:00Z",
"lastMessageReceivedAt": "2024-01-01T00:00:00Z",
"messageCount": 0,
"participants": [],
"canSendAsAssistant": false,
"labels": [],
"isTest": false
}

ChatTokenUsageResponse​

FieldTypeRequiredDescription
audioInputTokensIntegerDefault: 0
audioOutputTokensIntegerDefault: 0
cachedTokensIntegerDefault: 0
completionTokensIntegerDefault: 0
creditsNumberDefault: 0.0
creditsPerHourNumber
creditsRemainingNumber
extraUsageEnabledBoolean
promptTokensIntegerDefault: 0
sttUsageArray<VoiceUsageResponse>Default: []
totalTokensIntegerDefault: 0
ttsUsageArray<VoiceUsageResponse>Default: []
usageByModelArray<ModelUsageResponse>Default: []
voiceDurationSecondsNumber

Example:

{
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"cachedTokens": 0,
"audioInputTokens": 0,
"audioOutputTokens": 0,
"credits": 0.0,
"usageByModel": [],
"sttUsage": [],
"ttsUsage": []
}

ClearHighlightEvent​

FieldTypeRequiredDescription
kindLiteral['clear_highlight']Default: clear_highlight

Example:

{
"kind": "clear_highlight"
}

EscalationSignalsResponse​

FieldTypeRequiredDescription
engineString
latencyMsNumber
raisedArrayDefault: []
scoresdict[str, float]Default: {}
signalSetString✓
statusString✓

Example:

{
"status": "string",
"signalSet": "string",
"scores": {},
"raised": []
}

FindOrCreateDMChatRequest​

FieldTypeRequiredDescription
memberIdInteger✓

Example:

{
"memberId": 0
}

HighlightEvent​

FieldTypeRequiredDescription
anchorString✓
kindLiteral['highlight']Default: highlight
noteString

Example:

{
"kind": "highlight",
"anchor": "string"
}

MemberExperimentGroupSummary​

FieldTypeRequiredDescription
groupIdInteger✓
groupNameString✓
groupSlugString✓
isControlBoolean✓

Example:

{
"groupId": 0,
"groupName": "string",
"groupSlug": "string",
"isControl": false
}

MemberLabelResponse​

FieldTypeRequiredDescription
colorString✓
descriptionString✓
idInteger✓
nameString✓
slugString✓
uuidString✓

Example:

{
"id": 0,
"uuid": "string",
"name": "string",
"slug": "string",
"color": "string",
"description": "string"
}

MessageFeatureResponse​

FieldTypeRequiredDescription
decisionLiteral['greeting', 'answer']✓
engineString✓
latencyMsNumber✓
questionSetString✓
statusLiteral['decided', 'unavailable']✓
valueLiteral[human, voicemail, call_screening, unknown, answerable, not_found]✓

Example:

{
"decision": "greeting",
"value": null,
"status": "decided",
"engine": "string",
"questionSet": "string",
"latencyMs": 0.0
}

MessageFeatures​

FieldTypeRequiredDescription
greetingMessageFeatureResponse | null
retrievedAnswerMessageFeatureResponse | null

Example:

{}

MessageTokenUsageResponse​

FieldTypeRequiredDescription
cachedTokensIntegerDefault: 0
completionTokensInteger✓
creditsNumberDefault: 0.0
modelString✓
promptTokensInteger✓
totalTokensInteger✓

Example:

{
"model": "string",
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"cachedTokens": 0,
"credits": 0.0
}

ModelUsageResponse​

FieldTypeRequiredDescription
audioInputTokensIntegerDefault: 0
audioOutputTokensIntegerDefault: 0
cachedMultiplierNumberDefault: 1.0
cachedTokensIntegerDefault: 0
completionTokensIntegerDefault: 0
creditsNumber✓Combined credit usage for this model across LLM and image operations. Token fields count LLM tokens only; billing reports separate image credits.
inputMultiplierNumberDefault: 1.0
modelString✓
multiplierNumber✓
outputMultiplierNumberDefault: 1.0
promptTokensIntegerDefault: 0
totalTokensInteger✓

Example:

{
"model": "string",
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"cachedTokens": 0,
"credits": 0.0,
"multiplier": 0.0,
"inputMultiplier": 1.0,
"outputMultiplier": 1.0,
"cachedMultiplier": 1.0,
"audioInputTokens": 0,
"audioOutputTokens": 0
}
FieldTypeRequiredDescription
appUriString✓
kindLiteral['navigate']Default: navigate

Example:

{
"kind": "navigate",
"appUri": "string"
}

OpenAIFunctionToolCall​

FieldTypeRequiredDescription
functionDict[str, Any]Default: {}
idStringDefault: ``
typeStringDefault: function

Example:

{
"id": "",
"type": "function",
"function": {}
}

OpenAIMessageResponse​

FieldTypeRequiredDescription
approvalDecisionChatApprovalDecision | null
audienceString
audioFileUuidString
audioMetadataDict[str, Any]
contentstrList[Dict[str, Any]]
created_atDateTime
email_idInteger
escalationSignalsEscalationSignalsResponse | null
idString
inbox_idInteger
interactionModeLiteral[text, push_to_talk, realtime]
interactionSessionIdString
interactionTurnIdString
isCannedBooleanDefault: False
memberIdInteger
messageFeaturesMessageFeatures | null
originString
originalContentstrList[Dict[str, Any]]
parentMessageIdString
roleString
smsDeliveryErrorCodeString
smsDeliveryFailureReasonString
smsDeliveryStatusString
smsDeliveryUpdatedAtDateTime
sourceCategoriesArray
sttMetadataSttMetadataResponse | null
suggestionsArray
taskIdInteger
tokenUsageMessageTokenUsageResponse | null
toolStatusString
tool_call_idString
tool_callsArray<OpenAIFunctionToolCall>Default: []
truncatedAtMsInteger
truncationReasonString
userRatingNumber
userRatingCommentString
uuidString

Example:

{
"tool_calls": [],
"isCanned": false
}

OutboundCallRequest​

FieldTypeRequiredDescription
chatIdInteger✓
phoneNumberIdInteger✓

Example:

{
"phoneNumberId": 0,
"chatId": 0
}

PhoneCallResponse​

FieldTypeRequiredDescription
agentBaseAssistantResponse | null
callerNumberStringThe number that called in, as the carrier presented it. A forwarded leg carries the original inbound caller.
carrierStatusStringTwilio CallStatus / DialCallStatus terminal value (GRA-6416): completed, busy, no-answer, failed, or canceled. Independent of product intent — a successful transfer is terminationReason=forward + carrierStatus=completed; a transfer whose destination was busy is forward + busy.
chatIdInteger
chatUuidStringUuid of the chat the call belongs to (chatId's public identifier). Null when the call has no chat.
createdAtDateTime✓
creditsNumber
dialedNumberStringThe number an outbound call dialed. It can differ from member's phone: a call placed for a contact Member may dial another number. Null on inbound calls and on outbound calls recorded before this field existed.
failureDetailStringTransport / infra failure detail (GRA-6416): connection_reset (Twilio ErrorCode on completed call), stream_reset (media-stream WebSocket reset, e.g. Twilio 31921), never_connected (bridge-leg provisional), timeout, bridge_call_create_failed, bridge_call_create_missing_sid, fax_t30_failed, other closed fax_* receive codes, or error.
finishedAtDateTime
idInteger✓
inboundBoolean✓
memberWorkspaceMemberResponse | null
phoneNumberIdInteger✓
startedAtDateTime
statusString✓
terminationReasonStringProduct / app outcome for how the call ended (GRA-6416). Preferred values: hangup (assistant ended), forward (call forwarded), handoff, completed (caller hung up / normal end), policy rejects (voice_disabled, anonymous_rejected, …), blocked_outbound_safety, strict_voice_blocked, voicemail, amd_unknown. Legacy rows may also hold carrier strings (busy, no-answer, …) or transport failures (connection_reset, stream_reset, never_connected); prefer carrierStatus / failureDetail when present. Null for in-progress/unknown calls.
twilioCallIdString✓
uuidString✓Public identifier of the call — the uuid the Activity Spine (organization webhooks v2) uses as the call subject.
workflowIdIntegerID of the workflow associated with this call, resolved via the chat's assignment (PhoneCall.chat_id -> Chat.assignment_id -> Assignment.workflow_revision_id -> WorkflowRevision.workflow_id). Null for direct human-to-human calls with no chat, or chats with no assignment.

Example:

{
"id": 0,
"uuid": "string",
"phoneNumberId": 0,
"twilioCallId": "string",
"status": "string",
"createdAt": "2024-01-01T00:00:00Z",
"inbound": false
}

PublishUiEventsRequest​

FieldTypeRequiredDescription
eventsArray<Annotated<NavigateEvent | HighlightEvent | ClearHighlightEvent, annotation=null required=True discriminator='kind'>>✓

Example:

{
"events": []
}

RateMessageRequest​

FieldTypeRequiredDescription
commentString
ratingNumber✓

Example:

{
"rating": 0.0
}

SendAssistantMessageRequest​

FieldTypeRequiredDescription
messageString✓
tool_callsArray<Dict[str, Any]>

Example:

{
"message": "string"
}

SendUserMessageRequest​

FieldTypeRequiredDescription
contentString✓

Example:

{
"content": "string"
}

SharedContactResponse​

FieldTypeRequiredDescription
archivedBooleanDefault: False
fieldLiteral['phone', 'email']✓
memberIdInteger✓

Example:

{
"field": "phone",
"memberId": 0,
"archived": false
}

SttMetadataResponse​

FieldTypeRequiredDescription
eotConfidenceNumber
meanNumber
minNumber
modelString
wordsArray<SttWordConfidenceResponse>Default: []

Example:

{
"words": []
}

SttWordConfidenceResponse​

FieldTypeRequiredDescription
cNumber✓
eNumber
sNumber
wString✓

Example:

{
"w": "string",
"c": 0.0
}

TaskTransitionResponse​

FieldTypeRequiredDescription
actorMemberIdInteger
assignmentIdInteger✓
atDateTime✓
fromTaskIdInteger
idInteger✓
initiatorKind<enum TaskTransitionInitiator✓
isInitialEntryBoolean✓
sourceToolCallIdString
toTaskIdInteger
toTaskNameString

Example:

{
"id": 0,
"at": "2024-01-01T00:00:00Z",
"assignmentId": 0,
"initiatorKind": null,
"isInitialEntry": false
}

VoiceUsageResponse​

FieldTypeRequiredDescription
characterCountInteger
creditsNumber✓
durationSecondsNumber
modelString✓
multiplierNumber✓

Example:

{
"model": "string",
"credits": 0.0,
"multiplier": 0.0
}

WorkspaceMemberResponse​

FieldTypeRequiredDescription
accountEnabledBoolean
accountTosAcceptedBoolean✓
accountUuidString✓
canLoginBooleanDefault: True
createdAtDateTime✓
dateOfBirthDate
descriptionString✓
emailString✓
emailVerifiedBooleanDefault: False
experimentGroupMemberExperimentGroupSummary | null
externalIdString✓
firstNameString
homeFolderIdInteger
idInteger✓
isArchivedBooleanDefault: False
isImportProtectedBooleanDefault: False
isOrgOwnerBoolean
isSuperuserBoolean
labelsArray<MemberLabelResponse>Default: []
lastNameString
localeString✓
memberRoleIdInteger✓
memberRoleNameString✓
memberRoleSystemKeyString
memberTypeStringDefault: member
middleNameString
nameString✓
notifyEmailBoolean✓
notifySmsBoolean✓
notifyVoiceBoolean✓
notifyWhatsappBooleanDefault: False
orgRoleString
personaIdInteger
phoneString✓
phoneTypeString✓
phoneVerifiedBooleanDefault: False
roleString✓
sharedContactPlacementsArray<SharedContactResponse>Default: []
smsDisabledAtDateTime
smsDisabledReasonSmsDisabledReason
testMemberKindLiteral[test, eval]
timezoneString
titleString
tosAcceptedBoolean✓
updatedAtDateTime✓
usagePausedBooleanDefault: False
uuidString✓

Example:

{
"id": 0,
"uuid": "string",
"role": "string",
"tosAccepted": false,
"accountTosAccepted": false,
"accountUuid": "string",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"name": "string",
"description": "string",
"phone": "string",
"phoneType": "string",
"email": "string",
"externalId": "string",
"emailVerified": false,
"phoneVerified": false,
"notifySms": false,
"notifyEmail": false,
"notifyVoice": false,
"notifyWhatsapp": false,
"locale": "string",
"memberRoleId": 0,
"memberRoleName": "string",
"labels": [],
"memberType": "member",
"isArchived": false,
"isImportProtected": false,
"usagePaused": false,
"canLogin": true,
"sharedContactPlacements": []
}

Endpoints​

Direct messages

Messages

Chat actions

Voice calls

Statistics & export

Token usage

Guided UI events

Direct messages​

Find or create the direct-message chat between two members.

Dm​

POST /api/v2/w/{workspace_uuid}/chats/dm

Description:

Find or create a DM chat with a specific member.

Returns the existing DM chat between the current member and the target member, or creates a new one if none exists.

Self-access: a member may always start their own DM with an agent — it is their own conversation, so no scope is required (matching record self-access, where creating your own record needs no records:write). Initiating a DM with another human member is cross-member contact and requires dm:write.

Authentication: Requires workspace member

Parameters:

Response: See ChatResponse


Messages​

Read and send messages in a chat, rate responses, and inspect tool-call messages.

Messages​

GET /api/v2/w/{workspace_uuid}/chats/{chat_id}/messages

Description:

Get messages from a specific chat with pagination.

Retrieves the message history for a chat in OpenAI-compatible format. Messages include content, role (user/assistant/system), tool calls, and metadata. Results are paginated for efficient loading of long conversations.

Path Parameters:

  • id: Chat ID to retrieve messages from

Query Parameters:

  • limit: Maximum number of messages to return (1-100, default: 10)
  • offset: Number of messages to skip for pagination (default: 0)
  • before: Inclusive timestamp bound for a historical window (optional)

Response: Returns an array of OpenAIMessageResponse objects in chronological order (oldest first), each containing message content, role, timestamps, and tool call data.

Permissions: Self-access: Users can view messages in their own chats. Admin access: CHATS_READ scope required to view other members' chat messages. Agent-only messages (workflow notes, actions the engine ran) are returned only to a caller who holds CHATS_READ. A member turn's escalationSignals (per-turn escalation signal scores) is returned only to a caller who holds CHATS_READ, or in a test Chat.

Error Responses:

  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User does not have permission to view this chat
  • 404 Not Found: Chat not found

Related Endpoints:

  • GET /chats/{chat_id} - Get chat details
  • GET /chats/{chat_id}/tool-calls/{call_id}/messages - Get tool call messages
  • POST /chats/{chat_id}/send-assistant-message - Send a message as assistant

Authentication: Requires workspace member

Parameters:

  • chat_id (int | str)
  • limit (Integer) — default: 10, min: 1, max: 100
  • offset (Integer) — default: 0, min: 0
  • before (Annotated[datetime , Query(description='Inclusive ISO-8601 upper bound for a historical message window')])

Response: List of OpenAIMessageResponse


Messages​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/messages

Description:

Send a message as the authenticated Member in a Chat they participate in. Messages cannot be sent on another Member's behalf. Direct messages to human recipients trigger notifications. Use the streaming API for Agent direct-message replies.

Authentication: Requires workspace member

Parameters:

Response: See OpenAIMessageResponse


Rate​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/messages/{message_uuid}/rate

Description:

Rate an assistant message for quality feedback. Submit a numeric rating (for example, 1.0 for positive or 0.0 for negative) and an optional comment of up to 2,000 characters. Requires access to this Chat; rating another Member's Chat also requires chats:write. Returns {"status": "success"} when the workspace rating is saved.

Authentication: Requires workspace member

Parameters:

  • chat_id (int | str)
  • message_uuid (String)
  • rating_data (RateMessageRequest)

Response: JSONResponse


Task Transitions​

GET /api/v2/w/{workspace_uuid}/chats/{chat_id}/task-transitions

Description:

Get who moved the Chat's Assignment between Tasks, for a time window.

Pair with the messages endpoint using its time window. The newest limit moves in the window return oldest first. Each move includes its timestamp, Task IDs, destination Task name when available, initiator kind, initial-entry flag, and acting Member or source tool-call ID when recorded.

Permissions: the same as reading the chat's messages. Self-access, or CHATS_READ for another member's chat.

Error Responses:

  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User does not have permission to view this chat
  • 404 Not Found: Chat not found

Authentication: Requires workspace member

Parameters:

  • chat_id (int | str)
  • after (Annotated[datetime , Query(description='Inclusive ISO-8601 lower bound on when the move happened')])
  • before (Annotated[datetime , Query(description='Inclusive ISO-8601 upper bound on when the move happened')])
  • limit (Integer) — default: 200, min: 1, max: 200

Response: List of TaskTransitionResponse


Messages​

GET /api/v2/w/{workspace_uuid}/chats/{chat_id}/tool-calls/{call_id}/messages

Description:

Get messages from a specific tool call execution.

Retrieves the detailed message history from a tool call's ReACT loop execution. This includes sub-agent messages, tool invocations, and results from custom tools that run their own conversation loops.

Path Parameters:

  • id: Chat ID containing the tool call
  • call_id: Tool call ID to retrieve messages from

Query Parameters:

  • limit: Maximum number of messages to return (1-1000, default: 100)
  • offset: Number of messages to skip for pagination (default: 0)

Response: Returns an array of OpenAIMessageResponse objects representing the internal conversation flow within the tool execution, useful for debugging and transparency.

Permissions: Self-access: Users can view tool call messages in their own chats. Admin access: CHATS_READ scope required to view other members' chat messages.

Error Responses:

  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User does not have permission to view this chat
  • 404 Not Found: Chat or tool call not found

Related Endpoints:

  • GET /chats/{chat_id}/messages - Get main chat messages
  • GET /chats/{chat_id}/tools - Get available tools for chat

Authentication: Requires workspace member

Parameters:

  • chat_id (int | str)
  • call_id (String)
  • limit (Integer) — default: 100, min: 1, max: 1000
  • offset (Integer) — default: 0, min: 0

Response: List of OpenAIMessageResponse


Chat actions​

Act on an existing chat: manage participants, trigger an Agent reply, or summarize.

Participants​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/participants

Description:

Add a Member to a Chat as an assistant, user, contributor or supervisor. Requires chats:admin and access to manage this Chat. Adding a participant grants that Member access to the Chat, so confirm the intended recipient before submitting the request. Invalid roles and duplicate participants are rejected. A human taking over is an assistant participant, not an operator role.

Authorization: Requires chats:admin scope

Parameters:

Response: See ChatParticipantAddedResponse


Send Assistant Message​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/send-assistant-message

Description:

Send a message as the assistant in a chat conversation.

Allows workspace admins to manually send messages on behalf of the chat's assistant. Supports SMS and email channels with automatic delivery. Can optionally include tool calls which will be executed before message delivery. Records the attention clear (the person answered) when used.

Path Parameters:

  • chat_id: Chat ID to send the message in

Request Body:

  • message: Message content to send (supports markdown for email)
  • tool_calls: Optional array of tool calls to execute with the message

Response: Returns a success confirmation with the created message details including ID, UUID, role, content, and timestamp.

success and message describe the stored message, which is persisted on every non-error path. The provider leg is reported separately in delivery_outcome, a closed vocabulary (dispatched, simulated, blocked_validation, blocked_policy, disabled, suppressed, accepted_unrecorded), or null when no send was owed. simulated means the chat is a test chat and nothing was sent, which is correct rather than a failure. accepted_unrecorded means the provider accepted the message and only the local record failed — do not resend. A provider refusal is a 500, not an outcome value.

Permissions: Requires chats:admin scope to send messages as the assistant.

Error Responses:

  • 400 Bad Request: Invalid chat configuration, missing phone/email, or notifications disabled
  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User lacks chats:admin scope
  • 404 Not Found: Chat, assistant, or participant not found
  • 500 Internal Server Error: Failed to send SMS/email or execute tools

Related Endpoints:

  • GET /chats/{id}/messages - Get chat message history
  • POST /chats/{id}/messages/{uuid}/rate - Rate an assistant message
  • GET /chats/{id}/tools - Get available tools for the chat

Authorization: Requires chats:admin scope

Parameters:

Response: Dict[str, Any]


Summarize​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/summarize

Description:

Generate an AI summary of the chat conversation.

Creates an AI-generated summary of the chat's message history, updating the chat's title and summary fields. Optionally analyzes conversation content to automatically update chat labels. Summary generation happens synchronously within the request.

Path Parameters:

  • chat_id: Chat ID to summarize

Query Parameters:

  • update_labels: If true, also updates chat labels based on conversation content (default: false)

Response: Returns the updated ChatResponse object with new title, summary, summary_updated_at timestamp, and optionally updated labels.

Permissions: Self-access: Users can summarize their own chats. Admin access: CHATS_WRITE scope required to summarize other members' chats.

Error Responses:

  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User does not have permission to summarize this chat
  • 404 Not Found: Chat not found
  • 500 Internal Server Error: AI summarization failed

Related Endpoints:

  • GET /chats/{id} - Get chat details including current summary
  • GET /chats/{id}/messages - View messages being summarized
  • PUT /chats/{id} - Update chat manually

Authentication: Requires workspace member

Parameters:

  • chat_id (Integer)
  • update_labels (Boolean) — default: False

Response: See ChatResponse


Voice calls​

Place outbound voice calls on a chat and inspect its phone calls.

Outbound Call Handler​

GET /api/v2/w/{workspace_uuid}/chats/outbound-call-handler/{phone_number_id}/{chat_id}/{phone_call_id}

Description:

Receive the Twilio webhook for an outbound call and return call instructions. Requests must have a valid Twilio signature. phone_call_id identifies the existing outbound call.

Authentication: Requires a valid Twilio request signature

Parameters:

  • chat_id (Integer)
  • phone_number_id (Integer)
  • phone_call_id (Integer)

Response: HTMLResponse


Outbound Call Handler​

POST /api/v2/w/{workspace_uuid}/chats/outbound-call-handler/{phone_number_id}/{chat_id}/{phone_call_id}

Description:

Receive the Twilio webhook for an outbound call and return call instructions. Requests must have a valid Twilio signature. phone_call_id identifies the existing outbound call.

Authentication: Requires a valid Twilio request signature

Parameters:

  • chat_id (Integer)
  • phone_number_id (Integer)
  • phone_call_id (Integer)

Response: HTMLResponse


Outbound Call​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/outbound-call

Description:

Initiate an outbound phone call for a chat.

Starts an outbound voice call from the assistant to the chat participant using Twilio. The call will be connected to the workspace's configured phone number and handled by the chat's assigned assistant with real-time audio streaming.

Path Parameters:

  • chat_id: Chat ID to initiate the call for

Request Body:

  • phoneNumberId: ID of the workspace phone number to use for the outbound call

Response: Returns a status object confirming the call was initiated successfully.

Permissions: Requires workspace management permissions and sufficient phone call budget.

Error Responses:

  • 400 Bad Request: Invalid phone number ID or chat configuration
  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: Insufficient permissions or exceeded budget limits
  • 404 Not Found: Chat or phone number not found
  • 500 Internal Server Error: Failed to initiate call with Twilio

Related Endpoints:

  • GET /chats/{id} - Get chat details
  • POST /chats - Create a new chat for phone conversations

Authorization: Requires phones:write scope

Parameters:

Response: OutboundDialResult


Phone Calls​

GET /api/v2/w/{workspace_uuid}/chats/{chat_id}/phone-calls

Description:

Get phone calls associated with a chat.

Returns all phone calls linked to the given chat, ordered by most recent first. Used by the chat detail view to display call termination information.

Authorization: Requires chats:read scope

Parameters:

  • chat_id (Integer)

Response: List of PhoneCallResponse


Statistics & export​

Chat statistics, needs-response queues, and conversation exports.

Export​

GET /api/v2/w/{workspace_uuid}/chats/export

Description:

Export chats as CSV with filtering applied.

Exports all chats matching the current filters to a CSV file. Respects the same filtering parameters as the list_chats endpoint but returns all matching results (not paginated). Useful for bulk analysis, reporting, and integration with external tools.

Query Parameters: All the same filtering parameters as GET /chats:

  • sortBy, sortOrder: Sort order for consistent output
  • mine, archived, needsResponse, paused: Status filters
  • channel, chatType, memberId, assistantMemberId: Type and participant filters
  • search: Text search across chat content and metadata
  • isTest: Filter test chats
  • isAnonymous: Owner-anonymity scope, identical to GET /chats. true = anonymous-owner chats only (requires chats:admin); false = known-owner chats only; omitted = no owner-anonymity filter, so a chats:admin caller exports both. The export and the list therefore return the same chat set for the same request.
  • filters: JSON-encoded advanced filter rules
  • createdAfter: ISO-8601 timestamp with timezone offset — only export chats created on or after this instant
  • createdBefore: ISO-8601 timestamp with timezone offset — only export chats created on or before this instant

Response: Returns a CSV file with chat data including metadata, participants, and status.

Permissions: Requires chats:read scope. Members without this scope cannot bulk-export chats. Filtering to anonymous chats (isAnonymous=true) additionally requires chats:admin. Members without chats:admin never receive anonymous-owner rows — that is a server-enforced authorization boundary, not a removable filter.

Authorization: Requires chats:read scope

Parameters:

  • sortBy (ChatSortField)
  • sortOrder (SortOrder)
  • mine (Boolean)
  • archived (Boolean)
  • needsResponse (Boolean)
  • paused (Boolean)
  • channel (String)
  • chatType (String)
  • memberId (Integer)
  • search (String)
  • filters (String)
  • query (String)
  • isTest (Boolean)
  • isAnonymous (Boolean)
  • assistantMemberId (Integer)
  • createdAfter (datetime)
  • createdBefore (datetime)

Response: StreamingResponse


Needs Response​

GET /api/v2/w/{workspace_uuid}/chats/needs-response

Description:

Get IDs of chats that need a response.

Returns a lightweight list of chat IDs that require attention from the workspace team. DERIVED from facts — chat_needs_response_clause() — not from a stored flag, so a chat handed back to the AI or answered through a path that never cleared the old column drops out on its own.

Response: Returns an array of chat IDs (integers) that need responses. Empty array if none found.

Permissions: Self-access: Users see their own chats needing response. Admin access: CHATS_READ scope required to see all chats needing response. Private chats (manager / dm / agent_job) stay owner-or-participant only, for every caller.

Authentication: Requires workspace member

Response: Array<Integer>


Daily Creation​

GET /api/v2/w/{workspace_uuid}/chats/stats/daily-creation

Description:

Get daily chat creation statistics for the last 30 days.

Returns aggregated chat creation counts grouped by date and chat type for the past 30 days. This data is useful for visualizing chat activity trends and patterns by type.

Query Parameters:

  • archived: Filter by archived status (true/false, default: excludes archived)
  • isTest: Filter by test status (true/false, default: excludes test chats)

Response: Returns a dictionary with dailyStats array containing objects with:

  • date: YYYY-MM-DD format
  • count: total chat count
  • assignment, manager, dm, testing: breakdown by type

Permissions:

  • Admin users see all workspace chats
  • Regular users see only their own chats

Authentication: Requires workspace member

Parameters:

  • archived (Boolean)
  • isTest (Boolean)

Response: Dict[str, Any]


Tool Call Names​

GET /api/v2/w/{workspace_uuid}/chats/tool-call-names

Description:

Get distinct tool call names used in the chats this caller may receive.

Returns an alphabetically sorted list of unique tool call names from the messages of chats the caller may receive. Useful for populating filter dropdowns.

Permissions: the chat collection policy, as on /needs-response. Private chats (manager / dm / agent_job) count only for their owner or a participant; without CHATS_ADMIN, chats with an anonymous owner do not count; without CHATS_READ, only the caller's own chats count.

Authentication: Requires workspace member

Response: Array<String>


Token usage​

Token usage recorded for a chat.

Token Usage​

GET /api/v2/w/{workspace_uuid}/chats/{chat_id}/token-usage

Description:

Get aggregated token usage statistics for a specific chat.

Returns the total prompt tokens, completion tokens, total tokens, cached tokens, and credits used by all messages in this chat, including STT and TTS usage from voice calls.

Path Parameters:

  • chat_id: Chat ID to retrieve token usage for

Response: Returns a ChatTokenUsageResponse with aggregated token counts and credits.

Permissions: Self-access: Users can view token usage for their own chats. Admin access: CHATS_READ scope required to view other members' chat usage.

Error Responses:

  • 401 Unauthorized: Missing or invalid authentication
  • 403 Forbidden: User does not have permission to view this chat
  • 404 Not Found: Chat not found

Authentication: Requires workspace member

Parameters:

  • chat_id (Integer)

Response: See ChatTokenUsageResponse


Guided UI events​

Stage directions a guided script publishes to the app the member is looking at: take them to a page, point at a control, clear the highlight. Published and returned — what the guide says blocks the script instead, and travels as a parked prompt rather than as an event here.

Ui Events​

POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/ui-events

Description:

Publish a batch of stage directions on the chat's realtime channel.

202 rather than 200: this hands the events to subscribers and returns. It does not — and cannot — report that anyone was listening. A script whose tour surface has been closed should carry on and finish its work, not stall waiting for an audience.

Request body: {"events": [...]} — 1 to 20 events, applied in the order given. Each event is one of:

  • {"kind": "navigate", "appUri": "app:page:workflows"} — a page from the closed registry the navigate_to_admin_page tool also validates against. An unknown URI rejects the whole batch rather than dropping the one event: a script that narrated "here is the workflow list" and then failed to navigate leaves the member reading a caption for a page they are not on.
  • {"kind": "highlight", "anchor": "workflows.create-button", "note": "…"} — anchor is a declared data-tour-id, never a CSS selector, and must match ^[a-z0-9]+(?:[.-][a-z0-9]+)*$ (≤128 chars); note is an optional caption of ≤200 characters.
  • {"kind": "clear_highlight"} — idempotent.

There is deliberately no say event. Narration is a beat: it blocks the script until the member advances it, so it travels as a parked prompt (askUser) rather than as an event here.

Response: {"published": <count>} — how many events were handed to the channel, never how many were rendered.

Permissions: CHATS_WRITE (checked by the request model), plus the ordinary chat-access resolution on the chat itself.

Authentication: Requires workspace member

Parameters:

  • chat_id (Integer)
  • request_body (PublishUiEventsRequest)

Response: dict[str, int]