CRM Pipeline
SQLite-backed lead tracking with a status pipeline and interaction history.
The CRM service gives your agent a place to track leads, log interactions, and manage a sales or outreach pipeline. It's a SQLite-backed REST service — no external database needed.
What It Does
- Stores leads with contact info, status, and notes
- Tracks a status pipeline from identified → won/lost
- Logs every interaction (email sent, SMS received, call notes)
- Provides a pipeline summary view
Status Pipeline
identified → outreached → responded → qualified → meeting_scheduled → won
→ lost
→ on_hold
API
The service runs on localhost:3033. All endpoints are local-only.
POST /leads/create { name, company?, email?, phone?, source?, notes?, status? }
GET /leads/list { status?, limit? }
GET /leads/:id — returns lead + full interaction history
PUT /leads/:id { name?, company?, email?, status?, notes?, owner_notes?, next_followup_at? }
DELETE /leads/:id
POST /leads/:id/interact { channel, direction, content }
channel: "email" | "sms" | "call" | "manual"
direction: "inbound" | "outbound"
GET /pipeline — count by status + 10 most recently updated leads
GET /health
Data Model
leads
id, source, name, company, email, phone
status, notes, owner_notes
next_followup_at, created_at, updated_at
interactions
id, lead_id, channel, direction, content, timestamp
Human-in-the-Loop Checkpoints
By convention (enforced via SOUL.md, not the API), the agent should pause and wait for your approval before:
- Sending the first outreach to any new prospect batch
- Booking a meeting on your behalf
The CRM doesn't enforce this — your agent's instructions do. Make this explicit in the outreach-agent SOUL.md.
Database Location
The SQLite database lives at /home/openclaw/crm/leads.db. Back this up regularly if it contains real data — it's a single file.
cp /home/openclaw/crm/leads.db /home/openclaw/crm/leads.db.backup
Setup
The CRM service runs as a systemd unit:
systemctl status crm-service
curl http://localhost:3033/health
If better-sqlite3 fails to load on a new server, it needs to compile from source:
cd /home/openclaw/crm-service
rm -rf node_modules
npm install # not --production — needs build tools