Get the invite code for the group
Get the current invite code for the group.
Authentication Required
Login to swap the placeholders with your real Instance ID and Access Token.
Log InNo query parameters required
This endpoint doesn't expect data in the URL.
Best practices
Only share this code in secure channels.
Revoke the code immediately if you detect unauthorized joins.
Use this for 'open' communities where manual adding is too slow.
The Key to the Kingdom: Mastering the Distribution of Group Access
In the landscape of conversational growth, scale is achieved through friction-free entry. The Get Invite Code endpoint is your primary tool for Strategic Access Management and Community Expansion. While traditional participant management relies on direct "Add" operations—which require the business to have the user's contact saved—Invite Codes reverse the onboarding flow. They provide a portable, cryptographically secure token that allows any user to programmatically bridge themselves into your community. By retrieving this code via the API, you turn the "Closed Gate" of a private group into an "Open Door" that can be integrated into your website, your email campaigns, and your QR codes.
For enterprise architects, the invite code is the Growth Engine of the ecosystem. This guide explores the strategic imperatives of code-driven membership and the stewardship of entry rights.
🏗️ Architectural Philosophy: The Relationship Between JIDs and Tokens
From a technical perspective, an invite code is a Public Proxy for a Private Identifier.
Key Architectural Objectives:
- Decoupling Discovery from Identity: A Global-JID (
@g.us) is an internal identifier that is difficult for a regular user to use directly. The invite code provides a user-friendly, textual representation (chat.whatsapp.com/ABC123...) that the WhatsApp mobile app can instantly resolve. By retrieving this code, your system creates a "Portable Link" that travels through the public internet, ready to be resolved by the first user who clicks it. - The Power of Admin Stewardship: Only a Group Admin can retrieve or manage the group's invite code. This ensures that the generation of entry links is a governed act. If your Wawp instance is a regular member, your request for the code will be denied, protecting the group's privacy from unauthorized link extraction.
- Persistence and Volatility: An invite code is persistent until it is explicitly Revoked. This allows you to print a QR code on a billboard or include a link in a monthly newsletter, confident that it will remain functional for the life of the campaign unless you choose to reset it for security reasons.
🚀 Strategic Use Case: High-Velocity Acquisition and Funnel Integration
The invite code is the ultimate "Call to Action" for modern conversational marketing.
1. The "Zero-Friction" Landing Page Funnel
Traditionally, a customer has to "Message us first" to start a relationship. With the Get Invite Code endpoint, you can place a "Join our VIP Community" button directly on your checkout page or in an abandoned cart email. When the user clicks, they are instantly transported into your branded group environment. This eliminates the "Add to Contacts" friction, significantly increasing the conversion rate from a lead to a community member.
2. Physical-to-Digital Bridge (QR Code Orchestration)
For events, retail stores, or packaged goods, the invite code is the primary link to a digital support group. Your system can programmatically retrieve the code for a specific regional group and generate a dynamic QR code for a store display. Customers can scan the code to instantly join a support group for that specific location, creating a "Hyper-Local" conversational layer that is centrally managed by your API.
3. "Viral" Community Expansion
In customer loyalty programs, you can encourage existing members to "Invite a Friend." By retrieving the invite code and sharing it with a loyal member, you empower them to act as a growth agent for your brand. Because the invite link is "Native" to WhatsApp, it is easily forwarded within the app, creating an organic sharing loop that allows your communities to grow exponentially without increasing your CAC (Customer Acquisition Cost).
🔐 Administrative Mandate: The Stewardship of Entry Rights
While invite codes enable scale, they also introduce a unique security surface area. Anyone with the link can join the room.
Governance of the "Open Gate"
The invite code should be treated as a Dynamic Permission. We recommend that your system periodically rotates the code using the Revoke Invite Code endpoint. This "Rotational Security" ensures that old links found on cached Google pages or in legacy emails eventually stop working, allowing you to maintain control over the "Cohort" of users entering your groups at any given time.
Monitoring the "Entry Pulse"
Your system should listen for the group.participants.update webhook. When a user joins via an invite code, the notification often includes a flag indicating the method of entry. By cross-referencing this with the time your API last retrieved the code, you can build "Channel Analytics"—measuring exactly which campaigns or websites are driving the most members into your WhatsApp communities.
🛡️ Operational Best Practices: Consistency, Analytics, and Tracking
- URL Prefixing for Professionalism: When sharing the code, always present it as a full URL:
https://chat.whatsapp.com/{code}. This ensures that every operating system (Android, iOS, Web) recognizes it as a clickable deep link. - Metadata Preparation: Before sharing an invite code publicly, ensure that the group's Name, Icon, and Description are professional and ready for a first-time visitor. The "Join" screen is your customer's first impression of your conversational brand.
- Limit the Group Size: WhatsApp groups have a current limit of 1,024 members. Your system should monitor the member count via Get Group Info. Once a group approaches 90% capacity, your backend should "Switch" its landing page links to point to the invite code of a newly created "Secondary Cell" group.
⚙️ Engineering Best Practices: The Validation Loop
- Check Admin Permissions: Your request for the invite code will fail if the Wawp instance is not an admin. Always perform a pre-flight check or implement a retry-after-promotion logic to ensure your link-generation service is always functional.
- Graceful Handling of Revocation: If your system has previously stored an invite code in a database and a human admin revokes it manually from their phone, the old code in your database will become dead. Your logic should include a "Periodic Refresh" or a "Check-on-Click" mechanism to ensure the links you are serving to customers are still active.
- Cross-Instance Synchronization: If you use multiple WhatsApp accounts to manage the same group, ensure only the "Primary Account" is responsible for managing the invite link to avoid "Link Conflict" or accidental revocation by a secondary instance.
🎯 Conclusion: Mastering the Art of the Accessible Community
The Get Invite Code endpoint is the "Marketing Engine" of your community architecture. It is your most powerful tool for building scalable, friction-free entries into your branded spaces. By treating the invite link as a dynamic, programmable asset, you move beyond "Manual Onboarding" and into the world of Automated Acquisition, where your communities grow in lockstep with your marketing reach. You bridge the gap between your web presence and your conversational world, ensuring that every customer is only one click away from a high-trust, professional interaction with your brand.
Request Parameters
Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.
URL Parameters
Passed in the URL query stringstring | Your unique WhatsApp Instance ID Example: | ||
string | Your API Access Token Example: | ||
string | The unique ID of the group Example: |
Request Samples
Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.
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
{
"code": "ABC123XYZ"
}Command Palette
Search for a command to run...