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
| Field | Type | Required | Description |
|---|---|---|---|
memberId | Integer | ✓ | |
role | Literal['user', 'assistant', 'contributor', 'supervisor'] | Default: contributor |
Example:
{
"memberId": 0,
"role": "contributor"
}
BaseAssistantResponse
| Field | Type | Required | Description |
|---|---|---|---|
chatModel | String | ||
chatModelConfig | Dict[str, Any] | ||
codeInterpreterEnabled | Boolean | Default: False | |
description | String | ||
id | Integer | ||
identity | String | ||
name | String | ✓ | |
orgAgentUuid | String | ||
realtimeModel | String | ||
realtimeModelConfig | Dict[str, Any] | ||
tools | Array | Default: [] | |
webBrowserEnabled | Boolean | Default: False |
Example:
{
"name": "string",
"tools": [],
"codeInterpreterEnabled": false,
"webBrowserEnabled": false
}
ChatApprovalDecision
| Field | Type | Required | Description |
|---|---|---|---|
answer | Literal['approve', 'approve_always', 'reject', 'edit', 'other'] | ✓ | |
callId | String | ✓ | |
tool | String | ✓ |
Example:
{
"callId": "string",
"tool": "string",
"answer": "approve"
}
ChatInterruptResponse
| Field | Type | Required | Description |
|---|---|---|---|
checkoutUrl | String | ||
description | String | ||
guided | Literal[beat, question] | ||
interruptId | String | ||
openuiMarkup | String | ||
paymentComplete | Boolean | ||
price | String | ||
productName | String | ||
specData | Object | ||
specId | Integer | ||
specStatus | String | ||
specTitle | String | ||
type | String | ||
userPrompt | String |
Example:
{}
ChatLabelResponse
| Field | Type | Required | Description |
|---|---|---|---|
color | String | ✓ | |
description | String | ✓ | |
id | Integer | ✓ | |
name | String | ✓ | |
slug | String | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0,
"uuid": "string",
"name": "string",
"slug": "string",
"color": "string",
"description": "string"
}
ChatParticipantAddedResponse
| Field | Type | Required | Description |
|---|---|---|---|
message | String | ✓ | |
participantId | Integer | ✓ | |
success | Boolean | ✓ |
Example:
{
"success": false,
"message": "string",
"participantId": 0
}
ChatParticipantResponse
| Field | Type | Required | Description |
|---|---|---|---|
additionalInstructions | String | ||
avatarColor | Literal[teal, sky, blue, indigo, violet, fuchsia, slate] | ||
avatarIcon | Literal[user, stethoscope, heart, shield, sparkles, star] | ||
avatarUrl | String | ||
chatModel | String | ||
chatModelConfig | Dict[str, Any] | ||
memberId | Integer | ||
memberType | String | ||
name | String | ✓ | |
orgAgentConfigRevision | Integer | ||
orgAgentUuid | String | ||
orgAgentVoiceWarning | Boolean | Default: False | |
realtimeModel | String | ||
realtimeModelConfig | Dict[str, Any] | ||
role | String | ✓ |
Example:
{
"name": "string",
"role": "string",
"orgAgentVoiceWarning": false
}
ChatResponse
| Field | Type | Required | Description |
|---|---|---|---|
activeInteractionMode | Literal[text, push_to_talk, realtime] | ||
archived | Boolean | ✓ | |
assignmentId | Integer | ✓ | |
canSendAsAssistant | Boolean | ✓ | |
channel | String | ✓ | |
chatType | String | ✓ | |
createdAt | DateTime | ✓ | |
creationSource | Literal[web_arrival, inbound_channel, outbound_action, operator_create, background_run, qualification_run] | ||
currentTaskName | String | ||
direction | Literal['inbound', 'outbound', 'unknown'] | Default: unknown | |
folderId | Integer | ✓ | |
fromMessageId | Integer | ✓ | |
hasRealtimeInteraction | Boolean | Default: False | |
id | Integer | ✓ | |
inboxId | Integer | ✓ | |
initialMessageError | String | ||
initiator | Literal['member', 'workspace', 'system', 'unknown'] | Default: unknown | |
interrupt | ChatInterruptResponse | null | ||
isStarred | Boolean | Default: False | |
isTest | Boolean | ✓ | |
labels | Array<ChatLabelResponse> | ✓ | |
lastMessageReceivedAt | DateTime | ✓ | |
messageCount | Integer | ✓ | |
muteExpiresOnInbound | Boolean | Default: False | |
muteReason | String | ||
muted | Boolean | ✓ | |
mutedAt | DateTime | ||
mutedByMemberId | Integer | ||
outboundCallReceipt | OutboundDialQueued | ||
participants | Array<ChatParticipantResponse> | ✓ | |
paused | Boolean | ✓ | |
pausedAt | DateTime | ✓ | |
pausedReason | String | ✓ | |
phoneNumberId | Integer | ✓ | |
siteId | Integer | ✓ | |
summary | String | ✓ | |
summaryUpdatedAt | DateTime | ✓ | |
title | String | ✓ | |
transport | Literal['web', 'pstn', 'sms', 'whatsapp', 'email', 'fax', 'slack', 'teams', 'discord', 'direct_message', 'a2a', 'routine', 'background', 'cli', 'frame', 'unknown'] | Default: unknown | |
updatedAt | DateTime | ✓ | |
uuid | String | ✓ | |
workflowId | Integer | ✓ | |
workflowRevisionId | Integer |
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
| Field | Type | Required | Description |
|---|---|---|---|
audioInputTokens | Integer | Default: 0 | |
audioOutputTokens | Integer | Default: 0 | |
cachedTokens | Integer | Default: 0 | |
completionTokens | Integer | Default: 0 | |
credits | Number | Default: 0.0 | |
creditsPerHour | Number | ||
creditsRemaining | Number | ||
extraUsageEnabled | Boolean | ||
promptTokens | Integer | Default: 0 | |
sttUsage | Array<VoiceUsageResponse> | Default: [] | |
totalTokens | Integer | Default: 0 | |
ttsUsage | Array<VoiceUsageResponse> | Default: [] | |
usageByModel | Array<ModelUsageResponse> | Default: [] | |
voiceDurationSeconds | Number |
Example:
{
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"cachedTokens": 0,
"audioInputTokens": 0,
"audioOutputTokens": 0,
"credits": 0.0,
"usageByModel": [],
"sttUsage": [],
"ttsUsage": []
}
ClearHighlightEvent
| Field | Type | Required | Description |
|---|---|---|---|
kind | Literal['clear_highlight'] | Default: clear_highlight |
Example:
{
"kind": "clear_highlight"
}
EscalationSignalsResponse
| Field | Type | Required | Description |
|---|---|---|---|
engine | String | ||
latencyMs | Number | ||
raised | Array | Default: [] | |
scores | dict[str, float] | Default: {} | |
signalSet | String | ✓ | |
status | String | ✓ |
Example:
{
"status": "string",
"signalSet": "string",
"scores": {},
"raised": []
}
FindOrCreateDMChatRequest
| Field | Type | Required | Description |
|---|---|---|---|
memberId | Integer | ✓ |
Example:
{
"memberId": 0
}
HighlightEvent
| Field | Type | Required | Description |
|---|---|---|---|
anchor | String | ✓ | |
kind | Literal['highlight'] | Default: highlight | |
note | String |
Example:
{
"kind": "highlight",
"anchor": "string"
}
MemberExperimentGroupSummary
| Field | Type | Required | Description |
|---|---|---|---|
groupId | Integer | ✓ | |
groupName | String | ✓ | |
groupSlug | String | ✓ | |
isControl | Boolean | ✓ |
Example:
{
"groupId": 0,
"groupName": "string",
"groupSlug": "string",
"isControl": false
}
MemberLabelResponse
| Field | Type | Required | Description |
|---|---|---|---|
color | String | ✓ | |
description | String | ✓ | |
id | Integer | ✓ | |
name | String | ✓ | |
slug | String | ✓ | |
uuid | String | ✓ |
Example:
{
"id": 0,
"uuid": "string",
"name": "string",
"slug": "string",
"color": "string",
"description": "string"
}
MessageFeatureResponse
| Field | Type | Required | Description |
|---|---|---|---|
decision | Literal['greeting', 'answer'] | ✓ | |
engine | String | ✓ | |
latencyMs | Number | ✓ | |
questionSet | String | ✓ | |
status | Literal['decided', 'unavailable'] | ✓ | |
value | Literal[human, voicemail, call_screening, unknown, answerable, not_found] | ✓ |
Example:
{
"decision": "greeting",
"value": null,
"status": "decided",
"engine": "string",
"questionSet": "string",
"latencyMs": 0.0
}
MessageFeatures
| Field | Type | Required | Description |
|---|---|---|---|
greeting | MessageFeatureResponse | null | ||
retrievedAnswer | MessageFeatureResponse | null |
Example:
{}
MessageTokenUsageResponse
| Field | Type | Required | Description |
|---|---|---|---|
cachedTokens | Integer | Default: 0 | |
completionTokens | Integer | ✓ | |
credits | Number | Default: 0.0 | |
model | String | ✓ | |
promptTokens | Integer | ✓ | |
totalTokens | Integer | ✓ |
Example:
{
"model": "string",
"promptTokens": 0,
"completionTokens": 0,
"totalTokens": 0,
"cachedTokens": 0,
"credits": 0.0
}
ModelUsageResponse
| Field | Type | Required | Description |
|---|---|---|---|
audioInputTokens | Integer | Default: 0 | |
audioOutputTokens | Integer | Default: 0 | |
cachedMultiplier | Number | Default: 1.0 | |
cachedTokens | Integer | Default: 0 | |
completionTokens | Integer | Default: 0 | |
credits | Number | ✓ | Combined credit usage for this model across LLM and image operations. Token fields count LLM tokens only; billing reports separate image credits. |
inputMultiplier | Number | Default: 1.0 | |
model | String | ✓ | |
multiplier | Number | ✓ | |
outputMultiplier | Number | Default: 1.0 | |
promptTokens | Integer | Default: 0 | |
totalTokens | Integer | ✓ |
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
}
NavigateEvent
| Field | Type | Required | Description |
|---|---|---|---|
appUri | String | ✓ | |
kind | Literal['navigate'] | Default: navigate |
Example:
{
"kind": "navigate",
"appUri": "string"
}
OpenAIFunctionToolCall
| Field | Type | Required | Description |
|---|---|---|---|
function | Dict[str, Any] | Default: {} | |
id | String | Default: `` | |
type | String | Default: function |
Example:
{
"id": "",
"type": "function",
"function": {}
}
OpenAIMessageResponse
| Field | Type | Required | Description |
|---|---|---|---|
approvalDecision | ChatApprovalDecision | null | ||
audience | String | ||
audioFileUuid | String | ||
audioMetadata | Dict[str, Any] | ||
content | str | List[Dict[str, Any]] | |
created_at | DateTime | ||
email_id | Integer | ||
escalationSignals | EscalationSignalsResponse | null | ||
id | String | ||
inbox_id | Integer | ||
interactionMode | Literal[text, push_to_talk, realtime] | ||
interactionSessionId | String | ||
interactionTurnId | String | ||
isCanned | Boolean | Default: False | |
memberId | Integer | ||
messageFeatures | MessageFeatures | null | ||
origin | String | ||
originalContent | str | List[Dict[str, Any]] | |
parentMessageId | String | ||
role | String | ||
smsDeliveryErrorCode | String | ||
smsDeliveryFailureReason | String | ||
smsDeliveryStatus | String | ||
smsDeliveryUpdatedAt | DateTime | ||
sourceCategories | Array | ||
sttMetadata | SttMetadataResponse | null | ||
suggestions | Array | ||
taskId | Integer | ||
tokenUsage | MessageTokenUsageResponse | null | ||
toolStatus | String | ||
tool_call_id | String | ||
tool_calls | Array<OpenAIFunctionToolCall> | Default: [] | |
truncatedAtMs | Integer | ||
truncationReason | String | ||
userRating | Number | ||
userRatingComment | String | ||
uuid | String |
Example:
{
"tool_calls": [],
"isCanned": false
}
OutboundCallRequest
| Field | Type | Required | Description |
|---|---|---|---|
chatId | Integer | ✓ | |
phoneNumberId | Integer | ✓ |
Example:
{
"phoneNumberId": 0,
"chatId": 0
}
PhoneCallResponse
| Field | Type | Required | Description |
|---|---|---|---|
agent | BaseAssistantResponse | null | ||
callerNumber | String | The number that called in, as the carrier presented it. A forwarded leg carries the original inbound caller. | |
carrierStatus | String | Twilio 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. | |
chatId | Integer | ||
chatUuid | String | Uuid of the chat the call belongs to (chatId's public identifier). Null when the call has no chat. | |
createdAt | DateTime | ✓ | |
credits | Number | ||
dialedNumber | String | The 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. | |
failureDetail | String | Transport / 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. | |
finishedAt | DateTime | ||
id | Integer | ✓ | |
inbound | Boolean | ✓ | |
member | WorkspaceMemberResponse | null | ||
phoneNumberId | Integer | ✓ | |
startedAt | DateTime | ||
status | String | ✓ | |
terminationReason | String | Product / 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. | |
twilioCallId | String | ✓ | |
uuid | String | ✓ | Public identifier of the call — the uuid the Activity Spine (organization webhooks v2) uses as the call subject. |
workflowId | Integer | ID 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
| Field | Type | Required | Description |
|---|---|---|---|
events | Array<Annotated<NavigateEvent | HighlightEvent | ClearHighlightEvent, annotation=null required=True discriminator='kind'>> | ✓ |
Example:
{
"events": []
}
RateMessageRequest
| Field | Type | Required | Description |
|---|---|---|---|
comment | String | ||
rating | Number | ✓ |
Example:
{
"rating": 0.0
}
SendAssistantMessageRequest
| Field | Type | Required | Description |
|---|---|---|---|
message | String | ✓ | |
tool_calls | Array<Dict[str, Any]> |
Example:
{
"message": "string"
}
SendUserMessageRequest
| Field | Type | Required | Description |
|---|---|---|---|
content | String | ✓ |
Example:
{
"content": "string"
}
SharedContactResponse
| Field | Type | Required | Description |
|---|---|---|---|
archived | Boolean | Default: False | |
field | Literal['phone', 'email'] | ✓ | |
memberId | Integer | ✓ |
Example:
{
"field": "phone",
"memberId": 0,
"archived": false
}
SttMetadataResponse
| Field | Type | Required | Description |
|---|---|---|---|
eotConfidence | Number | ||
mean | Number | ||
min | Number | ||
model | String | ||
words | Array<SttWordConfidenceResponse> | Default: [] |
Example:
{
"words": []
}
SttWordConfidenceResponse
| Field | Type | Required | Description |
|---|---|---|---|
c | Number | ✓ | |
e | Number | ||
s | Number | ||
w | String | ✓ |
Example:
{
"w": "string",
"c": 0.0
}
TaskTransitionResponse
| Field | Type | Required | Description |
|---|---|---|---|
actorMemberId | Integer | ||
assignmentId | Integer | ✓ | |
at | DateTime | ✓ | |
fromTaskId | Integer | ||
id | Integer | ✓ | |
initiatorKind | <enum TaskTransitionInitiator | ✓ | |
isInitialEntry | Boolean | ✓ | |
sourceToolCallId | String | ||
toTaskId | Integer | ||
toTaskName | String |
Example:
{
"id": 0,
"at": "2024-01-01T00:00:00Z",
"assignmentId": 0,
"initiatorKind": null,
"isInitialEntry": false
}
VoiceUsageResponse
| Field | Type | Required | Description |
|---|---|---|---|
characterCount | Integer | ||
credits | Number | ✓ | |
durationSeconds | Number | ||
model | String | ✓ | |
multiplier | Number | ✓ |
Example:
{
"model": "string",
"credits": 0.0,
"multiplier": 0.0
}
WorkspaceMemberResponse
| Field | Type | Required | Description |
|---|---|---|---|
accountEnabled | Boolean | ||
accountTosAccepted | Boolean | ✓ | |
accountUuid | String | ✓ | |
canLogin | Boolean | Default: True | |
createdAt | DateTime | ✓ | |
dateOfBirth | Date | ||
description | String | ✓ | |
email | String | ✓ | |
emailVerified | Boolean | Default: False | |
experimentGroup | MemberExperimentGroupSummary | null | ||
externalId | String | ✓ | |
firstName | String | ||
homeFolderId | Integer | ||
id | Integer | ✓ | |
isArchived | Boolean | Default: False | |
isImportProtected | Boolean | Default: False | |
isOrgOwner | Boolean | ||
isSuperuser | Boolean | ||
labels | Array<MemberLabelResponse> | Default: [] | |
lastName | String | ||
locale | String | ✓ | |
memberRoleId | Integer | ✓ | |
memberRoleName | String | ✓ | |
memberRoleSystemKey | String | ||
memberType | String | Default: member | |
middleName | String | ||
name | String | ✓ | |
notifyEmail | Boolean | ✓ | |
notifySms | Boolean | ✓ | |
notifyVoice | Boolean | ✓ | |
notifyWhatsapp | Boolean | Default: False | |
orgRole | String | ||
personaId | Integer | ||
phone | String | ✓ | |
phoneType | String | ✓ | |
phoneVerified | Boolean | Default: False | |
role | String | ✓ | |
sharedContactPlacements | Array<SharedContactResponse> | Default: [] | |
smsDisabledAt | DateTime | ||
smsDisabledReason | SmsDisabledReason | ||
testMemberKind | Literal[test, eval] | ||
timezone | String | ||
title | String | ||
tosAccepted | Boolean | ✓ | |
updatedAt | DateTime | ✓ | |
usagePaused | Boolean | Default: False | |
uuid | String | ✓ |
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
GET /api/v2/w/{workspace_uuid}/chats/{chat_id}/messages- MessagesPOST /api/v2/w/{workspace_uuid}/chats/{chat_id}/messages- MessagesPOST /api/v2/w/{workspace_uuid}/chats/{chat_id}/messages/{message_uuid}/rate- RateGET /api/v2/w/{workspace_uuid}/chats/{chat_id}/task-transitions- Task TransitionsGET /api/v2/w/{workspace_uuid}/chats/{chat_id}/tool-calls/{call_id}/messages- Messages
Chat actions
POST /api/v2/w/{workspace_uuid}/chats/{chat_id}/participants- ParticipantsPOST /api/v2/w/{workspace_uuid}/chats/{chat_id}/send-assistant-message- Send Assistant MessagePOST /api/v2/w/{workspace_uuid}/chats/{chat_id}/summarize- Summarize
Voice calls
GET /api/v2/w/{workspace_uuid}/chats/outbound-call-handler/{phone_number_id}/{chat_id}/{phone_call_id}- Outbound Call HandlerPOST /api/v2/w/{workspace_uuid}/chats/outbound-call-handler/{phone_number_id}/{chat_id}/{phone_call_id}- Outbound Call HandlerPOST /api/v2/w/{workspace_uuid}/chats/{chat_id}/outbound-call- Outbound CallGET /api/v2/w/{workspace_uuid}/chats/{chat_id}/phone-calls- Phone Calls
Statistics & export
GET /api/v2/w/{workspace_uuid}/chats/export- ExportGET /api/v2/w/{workspace_uuid}/chats/needs-response- Needs ResponseGET /api/v2/w/{workspace_uuid}/chats/stats/daily-creation- Daily CreationGET /api/v2/w/{workspace_uuid}/chats/tool-call-names- Tool Call Names
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:
request- See FindOrCreateDMChatRequest
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 authentication403 Forbidden: User does not have permission to view this chat404 Not Found: Chat not found
Related Endpoints:
GET /chats/{chat_id}- Get chat detailsGET /chats/{chat_id}/tool-calls/{call_id}/messages- Get tool call messagesPOST /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: 100offset(Integer) — default: 0, min: 0before(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:
chat_id(int | str)request- See SendUserMessageRequest
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 authentication403 Forbidden: User does not have permission to view this chat404 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 callcall_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 authentication403 Forbidden: User does not have permission to view this chat404 Not Found: Chat or tool call not found
Related Endpoints:
GET /chats/{chat_id}/messages- Get main chat messagesGET /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: 1000offset(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:
chat_id(Integer)request- See AddChatParticipantRequest
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 disabled401 Unauthorized: Missing or invalid authentication403 Forbidden: User lackschats:adminscope404 Not Found: Chat, assistant, or participant not found500 Internal Server Error: Failed to send SMS/email or execute tools
Related Endpoints:
GET /chats/{id}/messages- Get chat message historyPOST /chats/{id}/messages/{uuid}/rate- Rate an assistant messageGET /chats/{id}/tools- Get available tools for the chat
Authorization: Requires chats:admin scope
Parameters:
chat_id(Integer)payload- See SendAssistantMessageRequest
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 authentication403 Forbidden: User does not have permission to summarize this chat404 Not Found: Chat not found500 Internal Server Error: AI summarization failed
Related Endpoints:
GET /chats/{id}- Get chat details including current summaryGET /chats/{id}/messages- View messages being summarizedPUT /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 configuration401 Unauthorized: Missing or invalid authentication403 Forbidden: Insufficient permissions or exceeded budget limits404 Not Found: Chat or phone number not found500 Internal Server Error: Failed to initiate call with Twilio
Related Endpoints:
GET /chats/{id}- Get chat detailsPOST /chats- Create a new chat for phone conversations
Authorization: Requires phones:write scope
Parameters:
chat_id(Integer)request- See OutboundCallRequest
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 outputmine,archived,needsResponse,paused: Status filterschannel,chatType,memberId,assistantMemberId: Type and participant filterssearch: Text search across chat content and metadataisTest: Filter test chatsisAnonymous: Owner-anonymity scope, identical toGET /chats.true= anonymous-owner chats only (requireschats:admin);false= known-owner chats only; omitted = no owner-anonymity filter, so achats:admincaller exports both. The export and the list therefore return the same chat set for the same request.filters: JSON-encoded advanced filter rulescreatedAfter: ISO-8601 timestamp with timezone offset — only export chats created on or after this instantcreatedBefore: 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 formatcount: total chat countassignment,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 authentication403 Forbidden: User does not have permission to view this chat404 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 thenavigate_to_admin_pagetool 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": "…"}—anchoris a declareddata-tour-id, never a CSS selector, and must match^[a-z0-9]+(?:[.-][a-z0-9]+)*$(≤128 chars);noteis 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]