> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wppfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset group invite code

> Generates a new invite code for the group, invalidating the previous one. 
Only group administrators can perform this action.

Main features:
- Invalidates the old invite link
- Creates a new unique link
- Returns updated group information




## OpenAPI

````yaml /openapi-en.json post /group/resetInviteCode
openapi: 3.1.0
info:
  title: WppFy -  WhatsApp API
  version: 1.0.0
  description: >
    API for managing WhatsApp instances and communications.


    ## Important Recommendation: WhatsApp Business

    **It is HIGHLY RECOMMENDED to use WhatsApp Business accounts** instead of
    regular WhatsApp for integration; regular WhatsApp may present
    inconsistencies, disconnections, limitations, and instability when used with
    our API.


    ## Authentication

    - Regular endpoints require a 'token' header with the instance token


    ## Instance States

    Instances can be in the following states:

    - `disconnected`: Disconnected from WhatsApp

    - `connecting`: Connection in progress

    - `connected`: Successfully connected and authenticated
servers:
  - url: https://api.wppfy.com
security:
  - token: []
tags:
  - name: Instance
    description: |
      Operations related to an instance's lifecycle, such as connecting,
      disconnecting, and checking status.
  - name: Proxy
    description: >
      WppFy uses an internal proxy by default.

      You can keep this default, configure your own proxy via `proxy_url`, or
      use your Android phone as a proxy by installing the app from
      https://github.com/WppFy/silver_proxy_apk (direct APK:
      https://github.com/WppFy/silver_proxy_apk/raw/refs/heads/main/silver_proxy.apk).

      If nothing is sent, we keep using the internal proxy. IPs are Brazilian;
      for international clients, consider a proxy in the client's region.
  - name: Profile
    description: |
      Operations related to the WhatsApp instance profile, such as changing
      the profile name and picture.
  - name: Business
    description: |
      ⚠️ **EXPERIMENTAL** - Endpoints not yet fully tested.

      Operations related to the WhatsApp Business business profile.
      Allows querying and updating business profile data such as description,
      address, email, categories, and managing the product catalog.

      **Requirements:**
      - The currently connected account must be a **WhatsApp Business** account
      - Personal WhatsApp accounts do not have a business profile

      **Note:** These endpoints may not work as expected.
      Report any problems found.
  - name: Calls
    description: |
      Operations related to WhatsApp calls.
      Allows making and rejecting calls programmatically.
  - name: Send Message
    description: >
      Endpoints for sending WhatsApp messages with different content types.


      ## Common Optional Fields


      All message sending endpoints support the following optional fields:


      - **`delay`** *(integer)*: Delay in milliseconds before sending
        - During the delay, "Typing..." or "Recording audio..." will appear depending on the type
        - Example: `5000` (5 seconds)

      - **`readchat`** *(boolean)*: Mark chat as read after sending
        - Removes the unread message counter from the chat
        - Example: `true`

      - **`readmessages`** *(boolean)*: Mark last received messages as read
        - Marks the last 10 **received** messages (not sent by you) as read
        - Useful to confirm reading pending messages before replying
        - Different from `readchat` which only removes the unread counter
        - Example: `true`

      - **`replyid`** *(string)*: ID of the message to reply to
        - Creates a reply linked to the original message
        - Support varies by message type
        - Example: `"3A12345678901234567890123456789012"`

      - **`mentions`** *(string)*: Numbers to mention (only for group sending)
        - Specific numbers: `"5511999999999,5511888888888"`
        - Mention all: `"all"`

      - **`forward`** *(boolean)*: Marks the message as forwarded in WhatsApp
        - Adds the "Forwarded" indicator to the message
        - Example: `true`

      - **`track_source`** *(string)*: Message tracking source
        - Identifies the system or source sending the message
        - Useful for integrations (e.g., "chatwoot", "crm", "chatbot")
        - Example: `"chatwoot"`

      - **`track_id`** *(string)*: ID for message tracking
        - Free identifier to track the message in external systems
        - Allows correlating messages between different platforms
        - **Note**: The system accepts duplicate values - there is no uniqueness validation
        - Use the same ID in multiple messages if it makes sense for your integration
        - Example: `"msg_123456789"`

      ### Sending to Groups

      - **`number`** *(string)*: To send a message to a group, use the group ID
      ending with `@g.us`
        - Example: `"120363012345678901@g.us"`
        - **How to get the Group ID:**
          - Use the `chatid` from the webhook received when someone sends a message in the group
          - Use the `GET /group/list` endpoint to list all groups and their IDs

      ## Available Placeholders


      All message sending endpoints support dynamic placeholders for automatic
      personalization:


      ### Name Fields

      - **`{{name}}`**: Consolidated chat name, using the first available
      option:
        1. Lead name (`lead_name`)
        2. Lead full name (`lead_fullName`)
        3. WhatsApp contact name (`wa_contactName`)
        4. WhatsApp profile name (`wa_name`)

      - **`{{first_name}}`**: First valid word of the consolidated name (minimum
      2 characters)


      ### WhatsApp Fields

      - **`{{wa_name}}`**: WhatsApp profile name

      - **`{{wa_contactName}}`**: Contact name as saved in WhatsApp


      ### Lead Fields

      - **`{{lead_name}}`**: Lead name

      - **`{{lead_fullName}}`**: Lead full name

      - **`{{lead_personalid}}`**: Personal ID (SSN, CPF, CNPJ, etc)

      - **`{{lead_email}}`**: Lead email

      - **`{{lead_status}}`**: Current lead status

      - **`{{lead_notes}}`**: Lead notes

      - **`{{lead_assignedAttendant_id}}`**: ID of the assigned attendant


      ### Custom Fields

      Fields added via custom fields are accessible using `{{lead_field01}}` to
      `{{lead_field20}}` or use `{{fieldname}}` defined in
      `/instance/updateFieldsMap`.


      ### Usage Example

      ```

      Hello {{name}}! I saw you work at {{company}}.

      Is your email {{lead_email}} correct?

      ```


      **💡 Tip**: Use `/chat/find` to fetch chat data and see available fields
      before sending messages with placeholders.
  - name: Async Message
    description: >
      Operational controls for the internal asynchronous send queue used when a
      send endpoint receives `async=true`.


      This section is used to:

      - check the current state of the async queue

      - configure the delay between messages sent with `async=true`

      - clear pending backlog and cancel messages not yet completed


      Scope:

      - covers only the internal queue of async direct messages

      - does not change messages already sent successfully
  - name: Message Actions and Search
  - name: Chats
  - name: Contacts
  - name: Blocklist
  - name: Labels
  - name: Groups and Communities
  - name: Newsletters and Channels
    description: >
      Operations for reading and following WhatsApp channels (newsletters).


      Main use cases:

      - list posts already published in a channel

      - edit recent posts in a channel

      - delete recent posts in a channel

      - check post views and reactions

      - integrate channels without needing to persist messages locally


      Notes:

      - `/newsletter/messages` returns the post content

      - `/newsletter/messages/edit` edits the content of recent posts

      - `/newsletter/messages/delete` deletes recent posts

      - views (`viewsCount`) and reactions (`reactionCounts`) come in each post
      of `/newsletter/messages`, not via webhook event

      - `/newsletter/updates` is deprecated: WhatsApp does not respond and the
      API returns 504

      - newsletters use their own routes and must not use `/message/edit` or
      `/message/delete`
  - name: Quick Replies
    description: >
      Management of quick replies to streamline service.


      **⚠️ Important**: This feature is only useful if you use a custom
      frontend/interface

      to register and use the replies. The API only stores the replies, 

      but does not apply them automatically.


      ### How it works:

      - **Create**: Register pre-defined responses with titles and content

      - **List**: Retrieve all registered responses to display in your interface

      - **Use**: Your frontend system can use these responses to speed up typing


      ### Use cases:

      - Custom web service interfaces

      - Mobile apps with reply suggestions

      - CRM systems with message templates

      - Productivity tools for attendants


      **Not a chatbot**: For automatic responses, use Chatbot features.
  - name: CRM
    description: >
      Complete customer relationship management system integrated with the API.


      **💾 Internal Storage**: All lead data is saved directly in the API,

      eliminating the need for external databases. Your application can focus
      only

      on the interface and business logic.


      ### Available Features:

      - **📋 20+ customizable fields**: Name, phone, email, company, notes, etc.

      - **🏷️ Label System**: Organize and categorize your contacts

      - **🔍 Advanced Search**: Filter by any field or label

      - **📊 Complete History**: All interactions are registered automatically


      ### 🎯 Placeholders in messages:

      Use dynamic variables in messages for automatic personalization:


      ```

      Hello {{name}}! I saw you work at {{company}}.

      Is your email {{email}} correct?

      Notes: {{notes}}

      ```


      ### Typical Flow:

      1. **Capture**: Leads arrive via WhatsApp or forms

      2. **Enrichment**: Add data using `/chat/editLead`

      3. **Segmentation**: Organize with labels

      4. **Communication**: Send personalized messages with placeholders

      5. **Follow-up**: History is saved automatically


      **Ideal for**: Sales, marketing, support, lead qualification
  - name: Chatwoot Integration
    description: >
      **🚧 BETA INTEGRATION - Chatwoot integration system for unified service**


      **⚠️ WARNING**: This integration is in BETA phase. Use at your own risk.
      We recommend testing in a non-production environment before use in
      production.


      This category contains resources to configure and manage integration with
      Chatwoot, an open-source customer service platform. The integration allows
      centralizing WhatsApp conversations in Chatwoot.


      ### Available Features:

      - 🔧 **Complete Configuration**: Configure URL, tokens, and Chatwoot
      credentials

      - 📬 **Bidirectional Sync**: New messages between WhatsApp and Chatwoot
      are synced automatically

      - 📱 **Contact Management**: Automatic sync of names and phones

      - 🔄 **LID→PN Update**: Automatic migration from Local ID to Phone Number

      - 🏷️ **Smart Names**: Name system with tilde (~) for automatic update

      - 🚫 **Group Separation**: Option to ignore groups in sync

      - 👤 **Message Signature**: Agent identification in sent messages

      - 🔗 **Automatic Webhook**: URL generated automatically to configure in
      Chatwoot


      ### 🏷️ Smart Name System:

      - **Names with tilde (~)**: Updated automatically when contact modifies
      name in WhatsApp

      - **Specific names**: For fixed name, remove tilde (~) from name in
      Chatwoot

      - **Example**: "~John Doe" = automatic, "John Doe" = fixed

      - **LID→PN Migration**: No conversation duplication during transition

      - **Native responses**: Appear directly in Chatwoot without external
      markings


      ### ⚠️ Known Limitations:

      - **History sync**: Not implemented - only new messages are synced


      ### Use Cases:

      - Centralized service in Chatwoot

      - Support teams with multiple agents

      - CRM integration via Chatwoot

      - Communication channel centralization

      - Automatic contact and name management


      **Ideal for**: Companies with service teams, call centers, technical
      support (in test environment)


      **Requires**: Configured Chatwoot instance, API tokens, and test
      environment


      **🚧 Remember**: BETA integration - features may change without prior
      notice
  - name: Server-Sent Events (SSE)
paths:
  /group/resetInviteCode:
    post:
      tags:
        - Groups and Communities
      summary: Reset group invite code
      description: >
        Generates a new invite code for the group, invalidating the previous
        one. 

        Only group administrators can perform this action.


        Main features:

        - Invalidates the old invite link

        - Creates a new unique link

        - Returns updated group information
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                groupjid:
                  type: string
                  description: Unique group identifier (JID)
                  example: 120363308883996631@g.us
              required:
                - groupjid
      responses:
        '200':
          description: Invite code reset successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  InviteLink:
                    type: string
                    description: Newly generated invite link
                    example: https://chat.whatsapp.com/AbCdEfGhIjKlMnOpQrStUv
                  group:
                    $ref: '#/components/schemas/Group'
                  needs_refresh:
                    type: boolean
                    description: >-
                      Indicates whether the group details need to be fetched
                      again
                    example: false
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Could not parse Group JID
        '403':
          description: User without permission
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: User is not an admin of this group
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Failed to reset group invite link
components:
  schemas:
    Group:
      type: object
      description: Represents a group/collective conversation
      properties:
        JID:
          type: string
          format: jid
          description: Unique group identifier
          example: jid8@g.us
        OwnerJID:
          type: string
          format: jid
          description: Group owner JID
          example: 1232@s.whatsapp.net
        OwnerPN:
          type: string
          format: jid
          description: Owner number/LID (when available)
        Name:
          type: string
          description: Group name
          example: Support Group
        NameSetAt:
          type: string
          format: date-time
          description: Date of the last name change
        NameSetBy:
          type: string
          format: jid
          description: JID of the user who set the name
        NameSetByPN:
          type: string
          format: jid
          description: LID/PN of who set the name
        Topic:
          type: string
          description: Group description
        TopicID:
          type: string
          description: Internal description ID
        TopicSetAt:
          type: string
          format: date-time
          description: Date of the last description change
        TopicSetBy:
          type: string
          format: jid
          description: JID of who changed the description
        TopicSetByPN:
          type: string
          format: jid
          description: LID/PN of who changed the description
        TopicDeleted:
          type: boolean
          description: Indicates whether the description was deleted
        IsLocked:
          type: boolean
          description: |
            Indicates whether only administrators can edit group info
            - true = only admins can edit
            - false = everyone can edit
          example: true
        IsAnnounce:
          type: boolean
          description: Indicates whether only administrators can send messages
        AnnounceVersionID:
          type: string
          description: Announcement settings version
        IsEphemeral:
          type: boolean
          description: Indicates whether messages are disappearing
        DisappearingTimer:
          type: integer
          description: Time in seconds for messages to disappear
          minimum: 0
        IsIncognito:
          type: boolean
          description: Indicates whether the group is incognito
        IsParent:
          type: boolean
          description: Indicates whether it is a parent group (community)
        IsJoinApprovalRequired:
          type: boolean
          description: Indicates whether approval is required for new members
        LinkedParentJID:
          type: string
          format: jid
          description: JID of the linked community
        IsDefaultSubGroup:
          type: boolean
          description: Indicates whether it is a default subgroup of the community
        DefaultMembershipApprovalMode:
          type: string
          description: Default member approval mode (when community)
        GroupCreated:
          type: string
          format: date-time
          description: Group creation date
        CreatorCountryCode:
          type: string
          description: Creator's country code
        ParticipantVersionID:
          type: string
          description: Participant list version
        Participants:
          description: >-
            List of participants. It is null when omitted by noParticipants and
            may be empty when participant_profiles is present.
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/GroupParticipant'
            - type: 'null'
        MemberAddMode:
          type: string
          enum:
            - ''
            - admin_add
            - all_member_add
          description: Mode for adding new members
        AddressingMode:
          type: string
          enum:
            - ''
            - pn
            - lid
          description: Group's preferred addressing
        OwnerCanSendMessage:
          type: boolean
          description: Checks whether you are able to send messages
        OwnerIsAdmin:
          type: boolean
          description: >-
            Indicates confirmed administrator privilege. May be absent when
            false; partial data does not grant administrator privilege.
        DefaultSubGroupId:
          type: string
          description: >-
            If the current group is a community, this field shows the ID of the
            announcements subgroup
        invite_link:
          type: string
          description: >-
            Invite link, exposed only to admins with confirmed permission. May
            be absent; do not assume every read queries WhatsApp.
        request_participants:
          type: string
          description: >-
            Known join requests, comma-separated. Exposed only to administrators
            when requested.
        image_url:
          type: string
          description: >-
            URL of the already persisted full image; the API does not query
            WhatsApp during listing
        image_preview_url:
          type: string
          description: URL of the already persisted preview
        picture_id:
          type: string
          description: Identifier of the full image on WhatsApp
        picture_preview_id:
          type: string
          description: Preview identifier on WhatsApp
        picture_empty_at:
          type: string
          format: date-time
          description: Last confirmation that the group had no image
        image_checked_at:
          type: string
          format: date-time
          description: Last full image query
        image_preview_checked_at:
          type: string
          format: date-time
          description: Last preview query
        parent_community:
          type: object
          description: Summary of a subgroup's parent community
          properties:
            jid:
              type: string
              format: jid
            name:
              type: string
            image_url:
              type: string
            image_preview_url:
              type: string
            default_subgroup_jid:
              type: string
              format: jid
        participant_profiles:
          type: array
          description: >-
            Additional participant profiles, when available. Missing fields must
            not be inferred.
          items:
            type: object
            description: >-
              Additional profile of a participant; missing fields must not be
              inferred.
            properties:
              jid:
                type: string
                format: jid
              pn:
                type: string
                format: jid
              lid:
                type: string
                format: jid
              username:
                type: string
              display_name:
                type: string
              name:
                type: string
              image_url:
                type: string
              image_preview_url:
                type: string
              picture_id:
                type: string
              picture_preview_id:
                type: string
              is_admin:
                type: boolean
              is_super_admin:
                type: boolean
        ParticipantCount:
          type: integer
          minimum: 0
          description: >-
            Known number of participants. May differ from the list size when
            data is partial or has been omitted from the response.
        request_participants_lid:
          type: string
          description: >-
            LIDs of known join requests, comma-separated; admin only, when
            requested.
    GroupParticipant:
      type: object
      description: Group participant
      properties:
        JID:
          type: string
          format: jid
          description: Participant identifier
        LID:
          type: string
          format: jid
          description: Participant local identifier
        PhoneNumber:
          type: string
          format: jid
          description: Participant number (when available)
        IsAdmin:
          type: boolean
          description: Indicates whether is an administrator
        IsSuperAdmin:
          type: boolean
          description: Indicates whether is a super administrator
        DisplayName:
          type: string
          description: Name displayed or resolved locally for the participant
        ImagePreview:
          type: string
          description: >-
            Legacy field not populated. Use
            participant_profiles[].image_preview_url.
          deprecated: true
        Error:
          type: integer
          description: Error code when adding participant
          minimum: 0
        AddRequest:
          description: Join request information
          oneOf:
            - type: object
              properties:
                Code:
                  type: string
                  description: Request code
                Expiration:
                  type: string
                  format: date-time
                  description: Request expiration date
            - type: 'null'
        Username:
          type: string
          description: Username observed on WhatsApp, when available.
  securitySchemes:
    token:
      name: token
      type: apiKey
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.