CRM & Sales Pipelines API
Manage sales pipelines, customer enquiries, lead ingestion webhooks, in-chat live chat drawer actions, speed-to-lead SLA response velocity, Meta Click-to-WhatsApp (CTWA) ad attribution, follow-up tasks, internal notes, activity timelines, conversion reports, and team member notification preferences.
Authentication & Scope: All requests use Sanctum Bearer tokens and JSON payloads against https://app.wacm.in/api/v1/crm. All operations are tenant-scoped, role-checked, rate-limited to 60 requests/minute, and guarded by optimistic locking (version) to prevent lost updates.
CRM API reference for developers and AI assistants
LLM ReadyFeed WACM API specs directly to Cursor, Claude, ChatGPT, Antigravity, or custom AI agents.
Pipelines & Stages
List workspace sales pipelines and their configured active stages, or initialize starter templates (simple, sales, appointments).
/pipelinesList all active pipelines and their ordered stages. Paginated (default 25/page).
/pipelinesCreate a custom pipeline (with optional description and stages array) or provision a starter template ('simple', 'sales', 'appointments'). Owner only.
/pipelines/{pipeline}Rename a pipeline or update its description. Owner only.
/pipelines/{pipeline}/stagesAdd a new open, won, or lost stage to an existing pipeline. Owner only.
/pipelines/{pipeline}/stages/{stage}Rename a stage or change its outcome classification (must be empty to change outcome). Owner only.
/pipelines/{pipeline}/stages/{stage}Archive an empty pipeline stage (rejected if any leads remain). Owner only.
{
"status": "success",
"data": [
{
"id": 1,
"name": "Default Sales",
"is_active": true,
"stages": [
{ "id": 1, "name": "New lead", "outcome": "open", "order": 1 },
{ "id": 2, "name": "Qualified", "outcome": "open", "order": 2 },
{ "id": 3, "name": "Proposal", "outcome": "open", "order": 3 },
{ "id": 4, "name": "Won", "outcome": "won", "order": 4 },
{ "id": 5, "name": "Lost", "outcome": "lost", "order": 5 }
]
}
]
}Leads & Enquiries
Enquiries represent commercial sales opportunities linked to contacts. Filter by pipeline, stage, owner, outcome, response velocity (unresponded, sla_breached), or overdue follow-up status.
/leadsList or search enquiries. Filters include the exact source key (indiamart for IndiaMART), contact_id, pipeline_id, stage_id, owner_id, outcome, follow-up status, search, page, per_page, and sort.
/leadsCreate a new enquiry. Requires contact_id, pipeline_id, title, and idempotent creation_key.
/leads/ingestAuthenticated ingestion for web forms and other integrations. Requires name and phone. Accepts optional email, title, requirement, value, currency, pipeline_id, stage_id, and source. Each accepted call creates an enquiry.
/leads/{id}Get complete enquiry details, contact, owner, current stage, next action, first_response_at timestamp, sla_breached flag, and pending task counts.
/leads/{id}Update enquiry fields. Requires version for optimistic concurrency control.
/leads/{id}/stageMove enquiry to another stage. Requires stage_id, version, and lost_reason when outcome is lost.
/leads/{id}/peopleList assignable team members who can own this enquiry or receive follow-up tasks.
/leads/{id}/activitiesPaginated audit timeline of state transitions, stage movements, and notes for this enquiry.
{
"contact_id": 142,
"pipeline_id": 1,
"title": "Annual Enterprise Plan - Acme Corp",
"requirement": "Requires 10 agents, custom webhook sync, and SLA support",
"owner_id": 3,
"value": 120000,
"creation_key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
}{
"phone": "+919876543210",
"name": "Alex Johnson",
"email": "alex@acme.com",
"title": "Website Quote Request",
"requirement": "Interested in WhatsApp broadcast and CRM integration",
"value": 45000,
"currency": "INR",
"source": "website"
}IndiaMART enquiries
In workspaces with IndiaMART pilot access, the provider sends live deliveries to the private URL issued by CRM Lead capture. WACM acknowledges an accepted delivery after storing it. Once processed, the imported lead is available through the authenticated CRM API with its normal workspace and lead visibility rules.
curl --get "$WACM_BASE_URL/api/v1/crm/leads" \
--header "Authorization: Bearer $WACM_API_TOKEN" \
--data-urlencode "source=indiamart"In an MCP build that supports source filtering, call list_crm_leads with { "source": "indiamart" }. Configure the connection, review deliveries, and rotate URLs in WACM. IndiaMART pilot setup guide
In-Chat Live Chat SideApp Drawer
Embedded directly within the WhatsApp agent inbox (/wpbox/chat via hasSidebar: true). Allows agents to view live customer enquiries, change sales stages, record internal notes, and create leads without switching tabs or context.
| Method | Drawer Route | Behavior & Payload |
|---|---|---|
| GET | /crm/sideapp/contact/{id} | Fetch contact details, active enquiries, available pipelines, stages, and recent Meta CTWA ad attribution during an active chat session. |
| POST | /crm/sideapp/contact/{id}/create-lead | Create an enquiry directly from the chat drawer. Automatically inherits ad headline, campaign ID, and CTWA Click ID if the conversation originated from an ad. |
| POST | /crm/sideapp/lead/{id}/stage | Transition enquiry stage directly from the conversation drawer. Validates required lost reasons when moving to lost outcome. |
| POST | /crm/sideapp/lead/{id}/note | Log an internal private agent note attached to the enquiry directly from the live chat interface. |
| POST | /crm/sideapp/lead/{id}/task | Schedule a follow-up task with quick presets (1h, today_5pm, tomorrow_10am, 3d) or custom due_local directly inside the chat drawer. |
| POST | /crm/sideapp/lead/{id}/task/{task}/complete | Mark a pending follow-up task complete in 1 click without leaving the live WhatsApp conversation. |
Meta Click-to-WhatsApp (CTWA) Full Attribution & CAPI
When customers start conversations by clicking Meta Click-to-WhatsApp (CTWA) Facebook or Instagram ads, WACM automatically captures the full referral payload on the very first incoming webhook and locks it into the contact and lead lifecycle:
source_id— Meta Ad IDheadline— Ad headline textbody— Ad description body copysource_url— Destination ad linkctwa_clid— Meta Click ID for CAPI conversion trackingmedia_type,image_url,video_url
- Automatic Contact Tagging:
Ad: <headline>&CTWA Leads - Persistent Stamped
source_detail:Meta Ad: 123 ("Summer Sale") [CLID: fb.1.xxx] - Live Chat Drawer Display: In-drawer Ad Attribution Card showing headline, body, ad link, and CLID status badge
- Meta Conversions API (CAPI): Preserves
ctwa_clidfor downstream offline conversion matching when leads reach 'Won' stage
Internal Notes
Private internal notes attached to an enquiry. Notes stay strictly internal and are never disclosed to customers or included in external notification templates.
/leads/{id}/notesList internal notes for an enquiry, ordered from newest to oldest. Paginated (default 25/page).
/leads/{id}/notesAdd an internal note. Requires body text, optional linked message_id, and optional retry_key.
Follow-up Tasks
Schedule and track team follow-ups. Every task requires an explicit due date, timezone, and assignee. Overdue tasks surface immediately on workspace dashboards.
/tasksList assigned follow-up tasks across enquiries. Filters: lead_id, status (pending/completed/cancelled), assignee_id, mine, reminded, overdue, due_from, due_to.
/tasks/{id}Get details of a specific follow-up task by its task ID.
/leads/{id}/tasksList all follow-up tasks linked to a specific enquiry.
/leads/{id}/tasksSchedule a follow-up task for an enquiry. Requires title, due_at (ISO 8601), optional assignee_id, and optional retry_key.
/leads/{id}/tasks/{task_id}Get details of a specific task within its enquiry context.
/leads/{id}/tasks/{task_id}Update task title, due_at, or assignee. Requires version for optimistic concurrency control.
/leads/{id}/tasks/{task_id}/completeMark a task completed. Requires outcome notes and version.
/leads/{id}/tasks/{task_id}/cancelMark a task cancelled. Requires cancellation reason and version.
{
"title": "Product Demo Call & Pricing Review",
"due_at": "2026-10-20T10:30:00+05:30",
"assignee_id": 3,
"retry_key": "c3a4f891-628d-4a11-8e7c-b3972a91219b"
}Reports & Funnel Analytics
Query conversion cohorts, intake growth, team performance leaderboard (team_leaderboard), Meta Click-to-WhatsApp ad ROI (meta_ads), speed-to-lead first response SLA compliance, and stage stay duration over customizable date ranges and timezones.
/reportsRead CRM conversion cohorts, intake trends, team_leaderboard, meta_ads performance, and stage stay durations. Parameters: from, to, timezone, pipeline_id, owner_id, source, compare, page.
Automation & Notification Preferences
Configure staff WhatsApp notification preferences. Notifications are dispatched only to opted-in, verified work numbers to protect staff privacy and prevent unverified sends.
/automation/preferencesRead the authenticated team member's notification preferences, verified work number, and active verification status.
/automation/preferencesSave work WhatsApp number, opt-in status, and notify_tasks preference. Returns a 10-minute verification code when a new number is enrolled.
Model Context Protocol (MCP) Integration
The official @codingmantra/wacm-mcp package provides 25 dedicated CRM tools (10 read + 15 action) for Claude Desktop, Cursor, and Antigravity:
| MCP Tool Name | Target Endpoint | Description |
|---|---|---|
| list_crm_pipelines | /crm/pipelines | List sales pipelines and their active stages. |
| list_crm_leads | /crm/leads | List enquiries by source, pipeline, stage, owner, or follow-up status. Use source: indiamart with an MCP build that supports the filter. |
| get_crm_lead | /crm/leads/{lead_id} | Read complete details of an enquiry by lead_id. |
| list_crm_lead_notes | /crm/leads/{lead_id}/notes | List internal notes linked to an enquiry. |
| list_crm_lead_activities | /crm/leads/{lead_id}/activities | List timeline activity history for an enquiry. |
| list_crm_lead_people | /crm/leads/{lead_id}/people | List assignable team members and active stakeholders for an enquiry. |
| list_crm_tasks | /crm/tasks | List assigned follow-up tasks and due reminders. |
| get_crm_task | /crm/tasks/{task_id} | Read details of a specific follow-up task. |
| get_crm_reports | /crm/reports | Read conversion cohorts, intake trends, and stage stay durations. |
| get_crm_automation_preferences | /crm/automation/preferences | Read the team member's notification preferences and verification status. |
| create_crm_pipeline / update_crm_pipeline | POST / PATCH /crm/pipelines | Create custom or starter pipelines and rename/update pipeline descriptions. |
| add / update / archive_crm_pipeline_stage | /crm/pipelines/{pipeline_id}/stages | Add custom stages, rename/reclassify stages, or archive empty stages. |
| create_crm_lead / ingest_crm_lead / update_crm_lead | /crm/leads & /crm/leads/ingest | Create leads for existing contacts, 1-step ingest by phone/name, or update deal fields. |
| update_crm_lead_stage / add_crm_lead_note | /crm/leads/{lead_id}/stage & /notes | Move leads across pipeline stages (with lost reason validation) and log internal notes. |
| create / update / complete / cancel_crm_task | /crm/leads/{lead_id}/tasks | Schedule, reschedule, complete, or cancel follow-up tasks with optimistic locking. |
| update_crm_automation_preferences | PUT /crm/automation/preferences | Manage the authenticated team member's WhatsApp notification opt-in preferences. |