> For the complete documentation index, see [llms.txt](https://support.whapi.cloud/help-desk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.whapi.cloud/help-desk/receiving/webhooks/incoming-webhooks-format/groups.md).

# Groups

WhatsApp Cloud API Webhooks for Groups

The groups array contains all groups that were sent to the webhook URL. Sent on event "`groups.post`".

The groups participants event array contains all groups participants event that were sent to the webhook URL. Sent on event "`groups.put`"

The groups updates array contains all groups updates that were sent to the webhook URL. Sent on event "`groups.patch`"

You can find more details about all parameters and their types in [the WebHook documentation](https://app.swaggerhub.com/apis-docs/HELLO_137/Whapi-Cloud-WhatsApp-API/1.8.5#/WebhookPayload). We mentioned more about the events here:

### New group

You have been added to a group, or a group has been created with you. Use the `groups.post` setting to get this webhook.

```
{
  "groups": [
    {
      "id": "120363271212442249@g.us",
      "name": "Group name! 😃",
      "type": "group",
      "timestamp": 1713791253,
      "participants": [
        {
          "id": "919984351847@s.whatsapp.net",
          "rank": "creator"
        },
        {
          "id": "61371989950@s.whatsapp.net",
          "rank": "member"
        }
      ],
      "participants_count": 2,
      "name_at": 1713791253,
      "name_owner": "919984351847@s.whatsapp.net",
      "created_at": 1713791253,
      "created_by": "919984351847@s.whatsapp.net",
      "joinApprovalMode": false,
      "performed_by": "919984351847@s.whatsapp.net"
    }
  ],
  "event": {
    "type": "groups",
    "event": "post"
  },
  "channel_id": "MANTIS-M72HC"
}
```

The fields `description`, `description_id`, `description_owner`, `announcements` and `adminAddMemberMode` appear only if they are set for the group.

***

### New message in the group

Use the `messages.post` setting to get this webhook.

```
{
  "messages": [
    {
      "id": ".juaBlBX6cgpT8UKLNnVEw-kh8Bq53B6TdEoQ-E8JdK1c",
      "from_me": false,
      "type": "text",
      "chat_id": "120363271212442249@g.us",
      "timestamp": 1713791337,
      "source": "mobile",
      "text": {
        "body": "Hey, what's up"
      },
      "from": "919984351847",
      "from_name": "Gerald"
    }
  ],
  "event": {
    "type": "messages",
    "event": "post"
  },
  "channel_id": "MANTIS-M72HC"
}
```

***

### A new member has been added

Use the `groups.put` setting to get this webhook.

```
{
  "groups_participants": [
    {
      "group_id": "120363271212442249@g.us",
      "participants": [
        "61280155346@s.whatsapp.net"
      ],
      "action": "add"
    }
  ],
  "event": {
    "type": "groups",
    "event": "put"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### A new member joined via an invitation link

```
{
  "groups_participants": [
    {
      "group_id": "120363271212442249@g.us",
      "participants": [
        "61280155346@s.whatsapp.net"
      ],
      "action": "add",
      "performed_by": "link"
    }
  ],
  "event": {
    "type": "groups",
    "event": "put"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### Participant removed

Use the `groups.put` setting to get this webhook.

```
{
  "groups_participants": [
    {
      "group_id": "120363271212442249@g.us",
      "participants": [
        "61280155346@s.whatsapp.net"
      ],
      "action": "remove"
    }
  ],
  "event": {
    "type": "groups",
    "event": "put"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### Participant became an admin

Use the `groups.put` setting to get this webhook.

```
{
  "groups_participants": [
    {
      "group_id": "120363271212442249@g.us",
      "participants": [
        "61371989950@s.whatsapp.net"
      ],
      "action": "promote"
    }
  ],
  "event": {
    "type": "groups",
    "event": "put"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### The participant is no longer an administrator

Use the `groups.put` setting to get this webhook.

```
{
  "groups_participants": [
    {
      "group_id": "120363271212442249@g.us",
      "participants": [
        "61371989950@s.whatsapp.net"
      ],
      "action": "demote"
    }
  ],
  "event": {
    "type": "groups",
    "event": "put"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### New request to join a group

Use the `groups.put` setting to get this webhook.

```
{
  "groups_participants": [
    {
      "group_id": "120363471232412449@g.us",
      "participants": [
        "61371989850@s.whatsapp.net"
      ],
      "action": "request"
    }
  ],
  "event": {
    "type": "groups",
    "event": "put"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### Group name changed

Use the `groups.patch` setting to get this webhook.

```
{
  "groups_updates": [
    {
      "before_update": {
        "id": "120363498775936551@g.us",
        "name": "Our journey ⛰️",
        "type": "group",
        "participants": [
          {
            "id": "61371989950@s.whatsapp.net",
            "rank": "member"
          },
          {
            "id": "919984351847@s.whatsapp.net",
            "rank": "creator"
          }
        ],
        "name_at": 1747661405,
        "created_at": 1743410397,
        "created_by": "919984351847@s.whatsapp.net",
        "adminAddMemberMode": true
      },
      "after_update": {
        "id": "120363498775936551@g.us",
        "name": "Good trip ⛰️🏔️",
        "type": "group",
        "participants": [
          {
            "id": "61371989950@s.whatsapp.net",
            "rank": "member"
          },
          {
            "id": "919984351847@s.whatsapp.net",
            "rank": "creator"
          }
        ],
        "name_at": 1747661405,
        "created_at": 1743410397,
        "created_by": "919984351847@s.whatsapp.net",
        "adminAddMemberMode": true
      },
      "changes": [
        "name"
      ]
    }
  ],
  "event": {
    "type": "groups",
    "event": "patch"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### Changed group profile picture

Use the `groups.patch` setting to get this webhook.

```
{
  "groups_updates": [
    {
      "before_update": {
        "id": "120363498775936551@g.us",
        "name": "Our journey ⛰️",
        "type": "group",
        "timestamp": 1747391325,
        "chat_pic": "changed",
        "not_spam": true,
        "last_message": {
          "id": "EFgJZBk-kusBq53fm7NK5g-E8JdK1c",
          "type": "system",
          "subtype": "group_change_icon",
          "chat_id": "120363498775936551@g.us",
          "from": "919984351847",
          "from_me": false,
          "source": "system",
          "timestamp": 1747661806
        },
        "participants": [
          {
            "id": "61371989950@s.whatsapp.net",
            "rank": "member"
          },
          {
            "id": "919984351847@s.whatsapp.net",
            "rank": "creator"
          }
        ],
        "name_at": 1747661405,
        "created_at": 1743410397,
        "created_by": "919984351847@s.whatsapp.net",
        "adminAddMemberMode": true
      },
      "after_update": {
        "id": "120363498775936551@g.us",
        "name": "Our journey ⛰️",
        "type": "group",
        "timestamp": 1747391325,
        "chat_pic": "https://pps.whatsapp.net/v/t62.24694-24/491878509_1329198295045131_8243456031832458554_n.jpg?stp=dst-jpg_s96x96_tt6&ccb=11-4&oh=01_Q5Aa1gEq-WZYAgjAZMZd6UEZFN30lEsxoha3JZH0bs07_p7F7Q&oe=683838BA&_nc_sid=5e03e0&_nc_cat=111",
        "chat_pic_full": "https://pps.whatsapp.net/v/t62.24694-24/491878509_1329198295045131_8243456031832458554_n.jpg?ccb=11-4&oh=01_Q5Aa1gEQcMhEWHOOb7XuktZhPH4l-uN1CcLGU46zZsWMt90VGQ&oe=683838BA&_nc_sid=5e03e0&_nc_cat=111",
        "not_spam": true,
        "last_message": {
          "id": "EFgJZBk-kusBq53fm7NK5g-E8JdK1c",
          "type": "system",
          "subtype": "group_change_icon",
          "chat_id": "120363498775936551@g.us",
          "from": "919984351847",
          "from_me": false,
          "source": "system",
          "timestamp": 1747661806
        },
        "participants": [
          {
            "id": "61371989950@s.whatsapp.net",
            "rank": "member"
          },
          {
            "id": "919984351847@s.whatsapp.net",
            "rank": "creator"
          }
        ],
        "name_at": 1747661405,
        "created_at": 1743410397,
        "created_by": "919984351847@s.whatsapp.net",
        "adminAddMemberMode": true
      },
      "changes": [
        "chat_pic",
        "chat_pic_full"
      ]
    }
  ],
  "event": {
    "type": "groups",
    "event": "patch"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### Join approval mode changed

Use the `groups.patch` setting to get this webhook. `joinApprovalMode` is `true` when admins must approve new members who join via the invite link, and `false` when anyone with the link can join.

```
{
  "groups_updates": [
    {
      "before_update": {
        "id": "120363498775936551@g.us",
        "name": "Our journey ⛰️",
        "type": "group",
        "participants": [
          {
            "id": "61371989950@s.whatsapp.net",
            "rank": "member"
          },
          {
            "id": "919984351847@s.whatsapp.net",
            "rank": "creator"
          }
        ],
        "created_at": 1743410397,
        "created_by": "919984351847@s.whatsapp.net",
        "joinApprovalMode": true
      },
      "after_update": {
        "id": "120363498775936551@g.us",
        "name": "Our journey ⛰️",
        "type": "group",
        "participants": [
          {
            "id": "61371989950@s.whatsapp.net",
            "rank": "member"
          },
          {
            "id": "919984351847@s.whatsapp.net",
            "rank": "creator"
          }
        ],
        "created_at": 1743410397,
        "created_by": "919984351847@s.whatsapp.net",
        "joinApprovalMode": false,
        "performed_by": "919984351847@s.whatsapp.net"
      },
      "changes": [
        "joinApprovalMode"
      ]
    }
  ],
  "event": {
    "type": "groups",
    "event": "patch"
  },
  "channel_id": "MANTIS-M72HC"
}
```

### Changing a participant's number

{% hint style="warning" %}
**Technical note:**\
Currently, if a member in your group changes their phone number, the system will trigger the same event as if a new member was added to the group. Please keep this in mind.\
We will update this page if in the future we can distinguish between new members and number updates for existing members.
{% endhint %}
