Comprehensive WhatsApp sales funnel deal management tool. A deal is one sales opportunity tied to a WhatsApp contact, sitting in one stage of one pipeline. Supports listing, retrieving, creating, updating, archiving, moving between stages, linking to chats, and fetching event history.
Available actions:
- list: Retrieve deals with rich filtering (pipeline, stage, status, agent, contact, device, stalled, chatStatus, unread, updatedAfter/Before, pagination)
- get: Retrieve a single deal by ID
- create: Create a new deal (requires pipeline, device, contactWid)
- update: Update deal fields (title, amount, currency, agent, department) - stage moves are NOT here, use move_stage
- archive: Archive a deal (frees the contact's open-deal slot, preserves as sales history)
- move_stage: Move a deal to another stage (requires previousStage for atomic compare-and-swap)
- link_chat: Link a deal to a WhatsApp conversation by contactWid
- events: Fetch deal event history (limit, skip)
Important notes:
1. move_stage requires previousStage - the stage the client last saw. The server performs an atomic compare-and-swap and answers 409 when it no longer matches. Always read the deal first (action: 'get') and pass its current stage value.
2. Only ONE open deal may exist per contact per pipeline. The API answers 409 otherwise, and the check spans the @c.us/@lid identity equivalence.
3. Restricted agents (plain agent role) only ever see their own deals, regardless of filters.
4. Write operations (create, update, archive, move_stage, link_chat) require the Professional plan or above. Read operations (list, get, events) are not plan-gated.