Group Join (V2)
Triggered when a new member joins or is added to a group.
Best practices
Verify if the user joined via a link or was manually added by an admin.
Store the new participant's ID in your CRM database.
Community Onboarding: Mastering the Group Join Webhook
In the high-scale world of community management and enterprise collaboration, the point of entry is the most critical moment of the lifecycle. The [group.v2.join] webhook is the primary signal that a new entity has entered a shared conversational space. Whether a user joins via a shared invitation link or is manually added by a community moderator, this event provides your infrastructure with the real-time data required to execute onboarding flows, security audits, and membership tracking.
This guide provides an architectural deep-dive into the strategic importance of group entry events, moving beyond "Membership Tracking" into the realm of Automated Community Governance and Operational Security.
🏗️ Architectural Philosophy: The Gatekeeper Pattern
To build a premium group experience, one must treat the group join event as a "Membership Handshake." A group in WhatsApp is identified by its unique Group JID (ending in @g.us), and its members are Individual JIDs (ending in @c.us).
1. The Membership Handshake
When an entry event occurs, your system is handed a two-layer payload: the [chatId] (the Group) and a list of [participants] (the new members). This allows for Batch Ingestion. If a moderator adds five users at once, your system receives a single atomic event containing all five IDs. This efficiency is critical for preventing "Webhook Flood" during large community migrations.
2. Identifying the Entry Vector
While the current event primarily confirms "Who Joined," a sophisticated architecture correlates this with the Join Method.
- The Invitation Link: If a user joins via a link, your system should treat them as a "Self-Service Lead."
- The Manual Add: If they were added by an admin, they are an "Invited Participant." Your onboarding logic (e.g., the welcome message) should adapt based on this vector to ensure the tone of the interaction matches the user's entry experience.
🚀 Strategic Use Cases: Powering the Responsive Community
The group join webhook is the "Sensor" that triggers your community's automated greeting and security protocols.
1. Zero-Latency Onboarding and Rule Enforcement
First impressions are permanent. As soon as the [group.v2.join] webhook fires, your bot can instantly send a personalized welcome message to the group: "Welcome to the team, [User Name]! Please read our #rules and introduce yourself."
Strategic Value: By automating this, you ensure every new member is immediately integrated into the community standards without requiring a human moderator to be online 24/7. This creates a sense of "Active Presence" for your brand.
2. Dynamic CRM Hydration and KYC
For subscription-based communities (e.g., "Premium Trading Groups"), the join event is a Verification Trigger.
The Logic: When a user joins the [@g.us] group, your system looks up their [@c.us] ID in your payment database. If no active subscription is found, your system can autonomously remove the user and send them a private message explaining how to join legally. This "Automated Perimeter Defense" protects your revenue stream from unauthorized link sharing.
3. Community Health and Growth Analytics
Track "Join Velocity." By logging every entry event, you can build a real-time dashboard showing your community's growth rate. If you see a spike in joins after a specific marketing email, you have direct, high-fidelity attribution of that campaign's success. This data allows you to move from "Managing Chats" to Managing a Growing Ecosystem.
🛡️ Administrative Mandate: Designing for Community Security
1. The "Shadow Directory" Strategy
WhatsApp groups do not naturally sync with external CRMs. You must build a "Shadow Directory"—a local database that mirrors every group's membership. The [group.v2.join] and [group.v2.leave] webhooks are the "Sync Sentinels" that keep this directory accurate.
Benefit: When an agent needs to send a broadcast to all "Active Community Members," they don't have to query WhatsApp; they query your fast, local directory.
2. Guarding against "Number Scraping"
Malicious actors often join groups solely to harvest the phone numbers of other participants. By monitoring the join stream, your system can cross-reference new IDs against a global "Blacklist" of known scrapers. If a flagged ID joins, the system can autonomously eject them within seconds, protecting the privacy of your genuine community members.
🛡️ Operational Best Practices: Optimizing the Onboarding Loop
- The "Welcome Debounce" Rule: If three users join within 5 seconds, don't send three separate welcome messages. Your system should "Debounce" the event—wait 10 seconds, then send a single message: "Welcome to our new members: [User 1], [User 2], and [User 3]!" This keeps the chat history clean and professional.
- Private vs. Public Greetings: For high-privacy groups, consider having the bot send the "Rules" message to the new user's Private Chat (@c.us) instead of the main group. This provides a personal, 1-on-1 welcome while keeping the group chat focused on its primary topic.
- Handling the "me" Identity: Note that if your instance ID (the [
me] field in the metadata) is added to a new group, this webhook will also fire. Your system should detect this "Self-Join" event to automatically initialize the group's metadata and settings in your local records.
⚙️ Engineering Best Practices: The Validation Loop
- Deduplicate Participants: Always iterate through the [
participants] array and treat each ID as a separate transactional update in your database. Ensure your "Member Count" logic is idempotent to handle potential event retries. - Verify Group Integrity: Before sending a welcome message, verify that the [
chatId] is still an active, non-archived group in your logic. - Coordinate with Presence: If a user joins but their presence state is "Invisible" or has no status, your system might wait for their first message before triggering a complex onboarding flow to ensure they are actually seen by the bot.
🎯 Conclusion: Beyond Membership—Building the Conversational Perimeter
The Group Join Webhook is the "Front Door" of your digital community. By building an architecture that listens, verifies, and greets, you move your organization from "Hosting a Chat" to Governing an Interface. You build systems that reward genuine interest, enforce community standards, and protect user privacy with engineered precision. In the world of Wawp, an entry event is not just a log entry; it is the strategic signal that turns a stranger into a member of your conversational ecosystem.
Expected Responses
Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.
Example
{
"id": "evt_01...",
"timestamp": 1634567890123,
"session": "default",
"metadata": {
"user.id": "123",
"user.email": "email@example.com"
},
"engine": "WEBJS",
"event": "group.v2.join",
"payload": {
"chatId": "1234567890@g.us",
"participants": {
"0": "11111111111@c.us"
}
},
"me": {
"id": "11111111111@c.us",
"lid": "123@lid",
"pushName": "Instance"
}
}Command Palette
Search for a command to run...