Build real-time voice and chat experiences with Dasha BlackBox. WebSockets provide instant bidirectional communication with agents for browser-based voice calls, live chat, and client-side tool execution. What you’ll learn: Connection lifecycle, call types, and when to use WebSockets vs REST.Documentation Index
Fetch the complete documentation index at: https://docs.blackbox.dasha.ai/llms.txt
Use this file to discover all available pages before exploring further.
All WebSocket examples require authentication with a web integration token or API key.
Connection lifecycle
Connection endpoints
| Endpoint | Use case | Auth |
|---|---|---|
wss://blackbox.dasha.ai/api/v1/ws/webCall?token={TOKEN} | Production | Web integration token |
wss://blackbox.dasha.ai/api/v1/ws/dev?authorization={KEY} | Development | API key |
Call types
| Type | Value | Use case |
|---|---|---|
| Text Chat | chat | Customer support, FAQ bots |
| Web Call | webCall | Browser-based voice support |
| Phone Call | onPhone | Outbound campaigns, call centers |
Quick start: Chat
Example: Basic chat connection
Example: Basic chat connection
When to use WebSockets vs REST
Use WebSockets for:- Real-time chat conversations
- Browser-based voice calls (WebRTC)
- Tool execution with immediate results
- Creating and configuring agents
- Enqueueing outbound phone calls
- Fetching call history and results
Message types
Client → Server
| Type | Description |
|---|---|
initialize | Start conversation |
incomingChatMessage | Send text message |
sdpAnswer | WebRTC SDP answer |
websocketToolResponse | Tool execution result |
terminate | End conversation |
Server → Client
| Type | Description |
|---|---|
event | Connection lifecycle events |
text | Agent responses |
sdpInvite | WebRTC SDP offer |
websocketToolRequest | Tool execution request |
conversationResult | Conversation summary |
error | Error notification |
Message Reference
Complete schema documentation
What’s next
Chat Implementation
Build a complete text chat interface
Voice Call Implementation
Add WebRTC voice calls
Message Reference
Complete message schemas
Tool Execution
Handle agent tool calls