Workspace.Chats.Crud
Tags: chat, communication, messaging
Endpoints
Create
POST /api/v2/w/{workspace_uuid}/chats
Description:
Chat CRUD operations
Create a new chat conversation in the workspace.
Self-access: Any authenticated member can create a chat (becomes the owner).
Creates either a simple chat or, when workflowId is provided, a workflow
assignment chat. The assignment is created automatically; callers do not
create or pass an assignment first. For phone-voice assignment chats with
the assistant enabled, chat creation also places the outbound call.
Request Body:
channel: Communication channel (web-chat, phone-sms, phone-voice, email)workflowId: Workflow to run; creates the assignment automatically when providedworkflowVersionNumber: Published workflow version to pin this assignment tomemberId: Member this chat is for; defaults to the authenticated memberphoneNumberId: Workspace phone number for SMS/voice; workflow default is used when availableinboxId: Workspace inbox for email chats; mutually exclusive withphoneNumberIdparticipants: Additional member participants such as an assistant/operator memberassistantEnabled: Whether the AI assistant runs the chat (default: true)assistantMemberId: Specific assistant member to use instead of the workflow agentassistantChatModelId/assistantRealtimeModelId: Per-chat assistant model overridesinitialMessage: Initial operator message for agent-disabled SMS/email chatstitle,siteId,isTest,chatType: Optional metadata and chat classification
Response:
Returns a ChatResponse object with the newly created chat, including all participants,
message counts, and metadata. When an operator-typed initialMessage could not be
sent (SMS/email dispatch failed, recipient opted out, missing phone/inbox), the chat
is still created and returned with initialMessageError set to a PHI-free reason
code — a partial success, not an error. Callers should surface a "reload and retry"
warning when that field is present.
Permissions: Requires authenticated member session. Chat ownership is automatically assigned to the creator.
Error Responses:
400 Bad Request: Invalid request parameters or missing required fields401 Unauthorized: Missing or invalid authentication404 Not Found: Referenced workflow, member, or assistant member not found500 Internal Server Error: Database or processing error
Related Endpoints:
GET /chats- List all chatsGET /chats/{chat_id}- Get chat detailsPUT /chats/{chat_id}- Update chat properties
Authentication: Requires workspace member
Parameters:
chat(CreateChatRequest)
Response: See ChatResponse
Dm
POST /api/v2/w/{workspace_uuid}/chats/dm
Description:
Chat CRUD operations
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