API & Integration Guide
Complete API reference, MCP server integration, and user guide for CaveauCRM. Connect your tools, automate your workflows, and manage your CRM through natural language.
CRM Bot API Reference
The CRM Bot API exposes 13 actions for managing leads, calendar, tasks, notifications, and AI-powered insights. All requests are sent as POST with a JSON body containing the action name and parameters.
https://yourdomain.com/api/crm-bot/Method: POST
Content-Type:
application/jsonAuth:
Authorization: Bearer <token>Body format:
{"action": "leads.list", "params": {...}}
Lead Management
status Filter by status (New, Assigned, In Process, etc.)since_days Only leads from the last N dayslimit Max results (1–50, default 20)
lead_id required — SuiteCRM lead UUID
query required — Search termlimit Max results (1–30, default 10)
first_name last_name email phonecompany description lead_source status
lead_id requiredPlus any:
status first_name last_name email phone company description
Calendar
date_from Start date, YYYY-MM-DD (default: today)date_to End date (default: today + 5 days)duration_minutes Slot length (default: 30)
datetime required — ISO format (e.g. 2026-03-30T10:00:00)attendee_name required attendee_email requiredtopic Meeting subject (default: Consultation)duration_minutes Duration (default: 30)
Tasks
status Filter (Not Started, In Progress, Completed, etc.)limit Max results (1–50, default 20)
name required — Task titledescription priority (High/Medium/Low)due_date YYYY-MM-DD format
Notifications & AI
lead_id required
lead_id requiredcontext Additional context (e.g. "follow up on demo request")
lead_id required
Example Requests
CaveauAI API Reference
The CaveauAI API provides health scoring and RAG knowledge base ingestion. These endpoints power the intelligence layer behind CaveauCRM.
https://yourdomain.com/api/caveau/Auth:
Authorization: Bearer <token>
ticket_id required — FOSSbilling ticket ID
MCP Server Integration
CaveauCRM integrates with the Model Context Protocol (MCP), enabling AI assistants like Claude to manage your CRM through natural language. Ask questions, create leads, book meetings, and monitor client health — all conversationally.
Architecture
MCP Integration Flow Claude Code Claude Desktop │ (via SSH stdio) │ (via SSE HTTP) │ │ └──────────┐ ┌──────────┘ ▼ ▼ ┌─────────────────────────────────────────┐ │ MCP Server (Python / FastMCP) │ │ │ │ 14 CRM Tools + 9 Legal Knowledge Tools │ │ │ └───────────┬─────────────┬───────────────┘ │ │ HTTPS + Bearer HTTPS + Bearer │ │ ▼ ▼ ┌──────────────┐ ┌──────────────────┐ │ CRM Bot API │ │ CaveauAI API │ │ 13 actions │ │ Health + Ingest │ └──────┬───────┘ └────────┬─────────┘ │ │ ▼ ▼ ┌─────────────────────────────────────────┐ │ SuiteCRM Baikal CalDAV Claude AI │ │ FOSSbilling Qdrant RAG Pipeline │ └─────────────────────────────────────────┘
Available MCP Tools
| MCP Tool | API Action | Description |
|---|---|---|
crm_list_leads | leads.list | List CRM leads with optional filters |
crm_get_lead | leads.get | Get a specific lead by ID |
crm_search_leads | leads.search | Search leads by name, email, or company |
crm_create_lead | leads.create | Create a new CRM lead |
crm_update_lead | leads.update | Update an existing lead |
crm_check_availability | calendar.availability | Check calendar availability |
crm_book_meeting | calendar.book | Book a consultation meeting |
crm_list_tasks | tasks.list | List CRM tasks |
crm_create_task | tasks.create | Create a new task |
crm_get_notifications | notifications.pending | Get pending notifications |
crm_summarize_lead | ai.summarize_lead | AI-powered lead summary |
crm_draft_email | ai.draft_email | AI-drafted follow-up email |
crm_qualify_lead | ai.qualify_lead | AI lead qualification |
crm_health_report | CaveauAI GET | Client health score report |
Configuration
Add the MCP server to your Claude Code or Claude Desktop configuration:
Natural Language Usage
Claude: calls
crm_list_leads(status="New", since_days=7) → Returns a formatted list of recent leadsYou: "Draft a follow-up email for the Nordberg lead"
Claude: calls
crm_search_leads(query="Nordberg") then crm_draft_email(lead_id="...") → Returns a personalised email draftYou: "How are our clients doing?"
Claude: calls
crm_health_report() → Returns a summary with green/amber/red scores
User Guide
Whether you're using the REST API directly, the MCP tools via Claude, or both — this guide covers the key workflows for getting the most out of CaveauCRM.
Getting Started
.mcp.json configuration to enable natural language CRM access from Claude.leads.list or notifications.pending to verify your setup. Or just ask Claude "show me today's notifications".Managing Leads
leads.search to find leads by name, email, or company before performing updates. The search runs across all four fields simultaneously.
The lead management workflow follows a natural progression: list to see what's new, search to find specific contacts, create for new prospects, and update to change status or add notes. AI tools layer on top: summarize for quick context, qualify for scoring, and draft_email for personalised outreach.
Calendar Management
calendar.availability.
Always check availability first with calendar.availability, then book with calendar.book. The system creates a CalDAV event with the attendee's name, email, and meeting topic.
AI Features
| Feature | Action | What It Does |
|---|---|---|
| Lead Summary | ai.summarize_lead |
Generates a concise summary of the lead's profile, activity history, and recommended next steps. |
| Email Draft | ai.draft_email |
Creates a personalised follow-up email based on lead data. Add context for more targeted messaging. |
| Lead Qualification | ai.qualify_lead |
Scores the lead based on completeness, source quality, and engagement signals. Returns a recommendation. |
Health Monitoring
Client health scores run on a weekly schedule and are available on-demand via the API. Scores start at 100 and are adjusted based on:
Deductions
Bonuses
| Risk Level | Score Range | Action |
|---|---|---|
| Green | 80 – 100 | Healthy. No intervention needed. |
| Amber | 50 – 79 | At risk. Review recommended. |
| Red | 0 – 49 | Critical. Immediate attention required. Telegram alert sent. |
Notifications
The notifications.pending action aggregates three notification types into a single response: new leads created today, overdue follow-ups (leads in "New" status for more than 48 hours), and today's calendar events. Use this as your daily morning check-in.
Authentication
All API endpoints require authentication via Bearer tokens. Inbound webhooks use HMAC-SHA256 signatures for verification.
Bearer Token Authentication
Every request to the CRM Bot API and CaveauAI API must include a Bearer token in the Authorization header:
Tokens are validated server-side using timing-safe comparison to prevent timing attacks. Invalid or missing tokens return a 401 Unauthorized response.
Webhook Signature Verification
Inbound webhooks from CaveauCRM include an HMAC-SHA256 signature for payload verification. The signature is sent in the X-CaveauAI-Signature header:
Timing-safe — Both Bearer token and HMAC signature verification use
hash_equals() to prevent timing attacks.Token rotation — Rotate API tokens periodically. Revoked tokens are rejected immediately.
Network isolation — Internal services (vector store, workflow engine, embeddings) are never exposed publicly. Only the API gateway handles external traffic.
Ready to Integrate?
Connect CaveauCRM to your tools. We'll help you set up the API, configure MCP, and get your team running.