manage_whatsapp_deals
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:
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.
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.
Restricted agents (plain agent role) only ever see their own deals, regardless of filters.
Write operations (create, update, archive, move_stage, link_chat) require the Professional plan or above. Read operations (list, get, events) are not plan-gated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card | No | Display-only card seed | |
| page | No | Page number (1-based) | |
| size | No | Page size (default 50) | |
| skip | No | Number of events to skip | |
| agent | No | Assigned agent user ID. Filter value on list; on update, pass null to unassign | |
| limit | No | Number of events to return (default 50) | |
| stage | No | Stage ID within the pipeline | |
| title | No | Deal title (defaults to contact name) | |
| action | Yes | Action to perform on deals | |
| amount | No | Deal amount. On update, pass null to clear it | |
| dealId | No | Deal ID (required for get, update, archive, move_stage, link_chat, events) | |
| device | No | WhatsApp device ID. A single ID when creating a deal; one or more IDs when filtering a list | |
| status | No | Deal status filter (defaults to open) | |
| unread | No | Only deals whose conversation has unread messages | |
| chatWid | No | WhatsApp ID of the chat the deal was created from | |
| contact | No | Deals for one contact (spans @c.us/@lid identity equivalence) | |
| stalled | No | Deals stuck in their stage (requires pipeline) | |
| currency | No | ISO 4217 currency code. Defaults to the pipeline currency; on update, pass null to clear it | |
| pipeline | No | Filter by pipeline ID | |
| chatStatus | No | State of the deal's WhatsApp conversation (requires pipeline, only for open deals) | |
| contactWid | No | WhatsApp ID of the contact (required for create and link_chat) | |
| department | No | Department ID. On update, pass null to clear it | |
| lostReason | No | Reason for losing the deal (only meaningful when moving to a lost stage) | |
| unassigned | No | Only deals with no agent (cannot be combined with agent) | |
| updatedAfter | No | ISO 8601 date-time, e.g. 2026-08-01T00:00:00.000Z (half-open range [after, before)) | |
| previousStage | No | The stage the client last saw (required for move_stage). Must be the current stage value from a prior get. Server answers 409 if stale. | |
| updatedBefore | No | ISO 8601 date-time, e.g. 2026-08-01T00:00:00.000Z (half-open range [after, before)) | |
| confirmDeletion | No | Confirm deal archiving (required for archive action) |