Select a client to start chatting
| Time | Agent | Action | Type | Chat Name | Message |
|---|
Team Members
API Keys
Manage API keys for external integrations (MCP servers, automations, etc.)
| Name | API Key | Status | Created | Last Used | Actions |
|---|---|---|---|---|---|
| Loading... | |||||
API Documentation
All API endpoints require the x-api-key header.
/api/v1/dashboard
Dashboard summary: total clients, unread messages, total messages, active agents
/api/v1/activity
Recent activity log. Params: limit, offset, action (filter by type)
/api/v1/clients
All clients/chats with message counts and agent assignments. Params: limit, offset
/api/v1/messages/:chatId
Messages for a specific chat. Params: limit, offset
/api/v1/agents
All team members/agents with roles and status
MCP Server Configuration
Connect this CRM to Claude Desktop or Claude Code using the MCP (Model Context Protocol) server.
1. Install the MCP server
git clone <your-repo>/wa-crm-mcp
cd wa-crm-mcp
npm install
2. Add to Claude Desktop config
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"wa-crm": {
"command": "node",
"args": ["/path/to/wa-crm-mcp/index.js"],
"env": {
"WA_CRM_URL": "YOUR_CRM_URL",
"WA_CRM_API_KEY": "YOUR_API_KEY"
}
}
}
}
3. Available MCP Tools
get_dashboard
Returns total clients, unread count, total messages, active agents
get_activity
Recent activity log with filters for action type, limit & offset
get_clients
All clients/chats with message counts, unread counts, assignments
get_messages
Messages for a chat. Requires chat_id (e.g. 919876543210@c.us)
get_agents
All team members with roles, email, and active status
API Usage Examples
Use these examples to test the API with cURL or any HTTP client.
Get Dashboard Summary
curl -H "x-api-key: YOUR_API_KEY" \
https://datadrivencode.com/wa-crm/api/v1/dashboard
# Response:
{
"total_clients": 310,
"unread_messages": 4,
"total_messages": 953,
"active_agents": 1
}
Get Recent Activity
curl -H "x-api-key: YOUR_API_KEY" \
https://datadrivencode.com/wa-crm/api/v1/activity?limit=10&action=received_message
# Response:
[{
"agent_name": null,
"sender_name": "John Doe",
"action": "received_message",
"chat_name": "John Doe",
"message_preview": "Hi, I need help with...",
"msg_type": "chat",
"created_at": "2026-09-27 20:33:52"
}]
Get Client Messages
curl -H "x-api-key: YOUR_API_KEY" \
https://datadrivencode.com/wa-crm/api/v1/messages/919876543210@c.us?limit=50
# Response:
[{
"id": 142,
"direction": "in",
"body": "Hello!",
"msg_type": "chat",
"timestamp": "2026-09-27 20:30:00",
"sender_name": "John Doe",
"agent_name": null
}, {
"id": 143,
"direction": "out",
"body": "Hi! How can I help?",
"msg_type": "chat",
"timestamp": "2026-09-27 20:31:00",
"agent_name": "Admin"
}]
List All Agents
curl -H "x-api-key: YOUR_API_KEY" \
https://datadrivencode.com/wa-crm/api/v1/agents
# Response:
[{
"id": 1,
"name": "Admin",
"email": "admin@example.com",
"role": "admin",
"is_active": 1
}]