Overview
Ravi can create and manage WhatsApp groups programmatically through the CLI. Groups are managed via theravi whatsapp group commands, which communicate with the WhatsApp instance through NATS request/reply. All commands require the daemon to be running with a connected WhatsApp account.
Prerequisites
- Daemon running:
ravi daemon start - WhatsApp connected:
ravi whatsapp connect - Participants must exist as contacts before being added to groups
Creating Groups
Basic Group Creation
Group Creation with Agent Routing
The--agent flag is the recommended approach. It creates the group, approves the group contact, sets up the route, creates the session, and sends an introductory prompt to the agent — all in one command:
- Creates the WhatsApp group
- Registers the group as an approved contact
- Creates a route mapping the group to the specified agent
- Creates a named session for the group
- Sends an
[System] Informso the agent introduces itself to the group
Group Creation Without Agent
Without--agent, the group contact is still auto-approved, but routing must be configured manually:
Admin Auto-Promotion
When creating a group, Ravi automatically promotes any contacts tagged withadmin to group admin. This happens silently after group creation:
Managing Members
Adding Participants
Removing Participants
Promoting to Admin
Demoting from Admin
Group Info and Listing
List All Groups
View Group Details
- Group ID, owner, and size
- Creation date
- Announcement mode (admins-only messaging)
- Restrict mode (locked info editing)
- Description
- Ephemeral message timer (if set)
- Full participant list with admin status
Group ID Formats
Commands accept two formats for group IDs:Invite Links
Generate an Invite Link
Revoke and Regenerate
Revoking invalidates the current invite link and generates a new one:Join via Invite Link
Group Settings
Announcement Mode
Controls who can send messages in the group:Locked Mode
Controls who can edit group info (name, description, picture):Renaming a Group
Updating the Description
Leaving a Group
Group Routing
Groups are routed to agents through the same mechanism as direct messages — via routes on the instance.Automatic Routing (Recommended)
Use--agent when creating the group:
Manual Routing
Add a route for an existing group:Routing Priority
Group messages follow the same resolution order as DMs:- Route match on the instance (pattern
group:<id>) - Account-agent mapping
- Default agent
Multi-Account Support
All group commands accept--account to specify which WhatsApp account to use. This is essential when running multiple WhatsApp instances:
--account is omitted, the first connected WhatsApp instance is used.