> For the complete documentation index, see [llms.txt](https://docs.360dialog.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.360dialog.com/docs/messaging/groups/group-management.md).

# Group Management

## Overview

The Groups API gives you simple functions to control groups through their lifecycle.

When you create a new group, an invite link is created for inviting participants to the group.

Since you cannot manually add participants to the group, simply send a message with your invite link to WhatsApp users whom you would like to join the group.

## Create a Group Invite Link Template Message

To create a template message that includes a group invite link, you can choose from two primary methods:

* **Using the WhatsApp Manager**: This is a graphical, user-friendly interface suitable for manual creation.
* **Using the API:** This method allows for automated or programmatic creation and is suitable for integration with other systems.

### Via WhatsApp Manager

{% stepper %}
{% step %}

#### Access your WhatsApp Business Account

{% endstep %}

{% step %}

#### Under Message templates > Template Library

<figure><img src="/files/dk9uCQwNbKNWSXAIppGM" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Click on Group Invite Link and select the desired template

<figure><img src="/files/4Fdbd3dQ1tGoiP6crXHM" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Name your template and submit for review

<figure><img src="/files/gNgvGPmTAV3TEloDqCd6" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

Once approved, you will be able to start using this template message for inviting users to your group.

### Via API

{% stepper %}
{% step %}

#### Create a new template using the template creation endpoint

<mark style="color:$success;">`POST`</mark> `https://waba-v2.360dialog.io/v1/configs/templates`

**Payload:**

{% hint style="warning" %}
Use the **group\_invite\_link** in the *library\_template\_name* parameter.
{% endhint %}

```json
{
  "name": "test_template",
  "category": "UTILITY",
  "language": "en_US",
  "library_template_name": "group_invite_link"
  "components": [
  ...
  <MORE_CONTENT_HERE>
  }]
}
```

{% endstep %}

{% step %}

#### Once approved, start using it.

{% endstep %}
{% endstepper %}

{% hint style="success" %}
Please check our [Template section](broken://pages/NRHTZ7dMOFGlTnsxKCJw) to add more parameters to your template message.
{% endhint %}

## Create a group

<mark style="color:$success;">`POST`</mark> `https://waba-v2.360dialog.io/groups`

```json
curl --location 'https://waba-v2.360dialog.io/groups' \
--header 'D360-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "messaging_product": "whatsapp",
  "subject": "<GROUP_SUBJECT>",
  "description": "<GROUP_DESCRIPTION>",
  "join_approval_mode": "<JOIN_APPROVAL_MODE>"
}'
```

{% tabs %}
{% tab title="Request body" %}

```json
{
  "messaging_product": "whatsapp",
  "subject": "<GROUP_SUBJECT>",
  "description": "<GROUP_DESCRIPTION>",
  "join_approval_mode": "<JOIN_APPROVAL_MODE>"
}
```

{% endtab %}

{% tab title="Request parameters" %}

<table><thead><tr><th width="247.21484375">Placeholder</th><th>Description</th><th>Sample Value</th></tr></thead><tbody><tr><td><code>&#x3C;BUSINESS_PHONE_NUMBER_ID></code></td><td><p><strong>Required</strong></p><p></p><p>Business phone number ID.</p></td><td>12784358810</td></tr><tr><td><code>&#x3C;GROUP_SUBJECT></code></td><td><p><strong>Required</strong></p><p></p><p>Group subject.</p><p></p><p>Maximum 128 characters. </p><p></p><p>Whitespace is trimmed.</p></td><td>New Purchase Inquiry</td></tr><tr><td><code>&#x3C;GROUP_DESCRIPTION></code></td><td><p><strong>Optional</strong></p><p></p><p>Group description.</p><p></p><p>Maxium 2048 characters.</p></td><td>Jim, an existing client, would like to learn about new car purchase options for current year models.</td></tr><tr><td><code>&#x3C;JOIN_APPROVAL_MODE></code></td><td><p><strong>Optional</strong></p><p></p><p>Indicates if WhatsApp users who click the inviation link can join the group with or without being approved first.</p><p>Values can be:</p><ul><li><code>approval_required</code> — Indicates WhatsApp users must be approved via <a href="https://developers.facebook.com/docs/whatsapp/cloud-api/groups/reference#groups-with-join-requests">join request</a> before they can access the group.</li><li><code>auto_approve</code> — Indicates WhatsApp users can join the group without approval.</li></ul><p>If omitted, <code>join_approval_mode</code> is set to <code>auto_approve</code> by default.</p></td><td>auto_approve</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

Once the group is created, you will receive a webhook with a `invite_link` parameter that contains an invite link for the group. You can send this invite link to WhatsApp users interested in joining the group.

Optionally, you can create a group that requires join approval. This means that if a WhatsApp user wants to join your group, you can approve or reject their request.

{% hint style="info" %}
A [`group_lifecycle_update`](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#group-lifecycle-update-webhooks) webhook is triggered, and you will receive another webhook showing the outcome: succeed or fail.
{% endhint %}

## Groups with join requests <a href="#groups-with-join-requests" id="groups-with-join-requests"></a>

You can create groups that require join request approval. Once enabled, WhatsApp users who click the group invitation link can submit a request to join the group, or cancel a prior request. To do this, set the *join\_approval\_mode* to approval\_required when creating the group.

When a WhatsApp user joins the group using a join request, a [`group_participants_update` webhook for a user accepting the join request](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#user-accepts-or-cancels-join-request) is triggered.

### Get join requests

You can also get a list of open join requests via API.

<mark style="color:$success;">`GET`</mark> `https://waba-v2.360dialog.io/groups/{group_id}/join_requests`

<details>

<summary>Request parameters</summary>

| Placeholder  | Description                                        | Sample Value                                              |
| ------------ | -------------------------------------------------- | --------------------------------------------------------- |
| `<GROUP_ID>` | <p><strong>Required</strong>.<br><br>Group ID.</p> | Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |

</details>

**Expected Outcomes**

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "data": [
    {
      "join_request_id": "<JOIN_REQUEST_ID>",
      "wa_id": "<WHATSAPP_USER_ID>",
      "creation_timestamp": "<JOIN_REQUEST_CREATION_TIMESTAMP">
    },
    //Additional join request objects would follow, if any
  ],
  "paging": {
    "cursors": {
      "before": "<BEFORE_CURSOR>",
      "after": "<AFTER_CURSOR>"
    }
  }
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Response Parameters</summary>

| Placeholder                                                              | Description                                                 | Sample Value                                                            |
| ------------------------------------------------------------------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------- |
| <mark style="color:$success;">`<JOIN_REQUEST_ID>`</mark>                 | Join request ID                                             | MTY0NjcwNDM1OTU6MTIwMzYzNDA0Njk0MjMzODIw                                |
| <mark style="color:$success;">`<WHATSAPP_USER_ID>`</mark>                | WhatsApp user ID                                            | 16505551234                                                             |
| <mark style="color:$success;">`<JOIN_REQUEST_CREATION_TIMESTAMP>`</mark> | Unix timestamp indicating when the join request was created | 1755548877                                                              |
| <mark style="color:$success;">`<BEFORE_CURSOR>`</mark>                   | Before cursor                                               | eyJvZAmZAzZAXQiOjAsInZAlcnNpb25JZACI6IjE3NTU1NTM3MDUxNzUwNTQ1MTAifQZDZD |
| <mark style="color:$success;">`<AFTER_CURSOR>`</mark>                    | After cursor                                                | eyJvZAmZAzZAXQiOjAsInZAlcnNpb25JZACI6IjE3NTU1NTM3MDUxNzUwNTQ1MTAifQZDZD |

</details>

### **Approve join requests**

<mark style="color:$success;">`POST`</mark> `https://waba-v2.360dialog.io/groups/{group_id}/join_requests`

**Request example**

```json
curl --location --globoff 'https://waba-v2.360dialog.io/groups/{group_id}/join_requests' \
--header 'D360-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "messaging_product": "whatsapp",
  "join_requests": [
    "<JOIN_REQUEST_ID>"
  ]
}'
```

{% tabs %}
{% tab title="Request parameters" %}

| Placeholder                                       | Description                                        | Sample Value                                              |
| ------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------------- |
| <mark style="color:$success;">`<GROUP_ID>`</mark> | <p><strong>Required</strong>.<br><br>Group ID.</p> | Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
| {% endtab %}                                      |                                                    |                                                           |

{% tab title="Request body" %}

```json
{
  "messaging_product": "whatsapp",
  "join_requests": [
    "<JOIN_REQUEST_ID>",
    // Additional join request IDs would go here, if approving in bulk 
  ]
}
```

{% endtab %}
{% endtabs %}

**Expected Outcomes**

Upon success, the API will respond with the following JSON payload, and WhatsApp users whose join requests were approved will be able to access the group when tapping the invite link.

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "messaging_product": "whatsapp",
  "approved_join_requests": [
    "<JOIN_REQUEST_ID>",
    // Additional join request IDs would go here, it approved in bulk 
  ],

  //Only included if unable to approve one or more join requests 
    
  "failed_join_requests": [
    {
      "join_request_id": "<JOIN_REQUEST_ID>",
      "errors": [
        {
          "code": "<ERROR_CODE>",
          "message": "<ERROR_MESSAGE>",
          "title": "<ERROR_TITLE>",
          "error_data": {
            "details": "<ERROR_DETAILS>"
          }
        }
      ]
    }
  ],
  "errors": [
    {
      "code": "<ERROR_CODE>",
      "message": "<ERROR_MESSAGE>",
      "title": "<ERROR_TITLE>",
      "error_data": {
        "details": "<ERROR_DETAILS>"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Response Parameters</summary>

| Placeholder                                              | Description                                                                             | Sample Value                                                                                                      |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| <mark style="color:$success;">`<JOIN_REQUEST_ID>`</mark> | ID of approved join request, or ID of failed join request, if we were unable to approve | MTY0NjcwNDM1OTU6MTIwMzYzNDA0Njk0MjMzODIw                                                                          |
| <mark style="color:$success;">`<ERROR_CODE>`</mark>      | Error code, if unable to approve                                                        | <mark style="color:red;">131203</mark>                                                                            |
| <mark style="color:$success;">`<ERROR_MESSAGE>`</mark>   | Error message, if unable to approve                                                     | <mark style="color:red;">(#131203) Recipient has not accepted our new Terms of Service and Privacy Policy.</mark> |
| <mark style="color:$success;">`<ERROR_TITLE>`</mark>     | Error title, if unable to approve                                                       | Unable to add participant to group                                                                                |
| <mark style="color:$success;">`<ERROR_DETAILS>`</mark>   | Error details, if unable to approve                                                     | Recipient has not accepted our new Terms of Service and Privacy Policy.                                           |

</details>

#### **Webhooks**

A [`group_participants_update`](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#group-participants-update-webhooks) webhook is triggered.

{% hint style="info" %}
[View the "User accepts join request" sample webhook](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#user-accepts-or-cancels-join-request)
{% endhint %}

### Reject join requests

<mark style="color:red;">`DELETE`</mark> `https://waba-v2.360dialog.io/groups/{group_id}/join_requests`

**Request example**

```json
curl --location --globoff --request DELETE 'https://waba-v2.360dialog.io/groups/{group_id}/join_requests' \
--header 'D360-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "messaging_product": "whatsapp",
  "join_requests": [
    "<JOIN_REQUEST_ID>",
    //Additional join request IDs would go here, it rejecting in bulk
  ]
}'
```

{% tabs %}
{% tab title="Request parameters" %}

| Placeholder                                              | Description                                                            | Sample Value                                              |
| -------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------- |
| <mark style="color:$success;">`<GROUP_ID>`</mark>        | <p><strong>Required</strong>.<br><br>Group ID.</p>                     | Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
| <mark style="color:$success;">`<JOIN_REQUEST_ID>`</mark> | <p><strong>Required</strong>.<br><br>ID of join request to reject.</p> | MTY0NjcwNDM1OTU6MTIwMzYzNDA0Njk0MjMzODIw                  |
| {% endtab %}                                             |                                                                        |                                                           |

{% tab title="Request body" %}

```json
{
  "messaging_product": "whatsapp",
  "join_requests": [
    "<JOIN_REQUEST_ID>",
    //Additional join request IDs would go here, it rejecting in bulk 
  ]
}
```

{% endtab %}
{% endtabs %}

**Expected Outcomes**

Upon success, the API will respond with the following JSON payload, and the WhatsApp user will see the **Request to join** button again when accessing the group invite link

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "messaging_product": "whatsapp",
  "rejected_join_requests": [
    "<JOIN_REQUEST_ID>",
    //Additional join request IDs would go here, it rejecting in bulk 
  ],

  //Only included if unable to reject one or more join requests
  "failed_join_requests": [
    {
      "join_request_id": "<JOIN_REQUEST_ID>",
      "errors": [
        {
          "code": "<ERROR_CODE>",
          "message": "<ERROR_MESSAGE>",
          "title": "<ERROR_TITLE>",
          "error_data": {
            "details": "<ERROR_DETAILS>"
          }
        }
      ]
    }
  ],
  "errors": [
    {
      "code": "<ERROR_CODE>",
      "message": "<ERROR_MESSAGE>",
      "title": "<ERROR_TITLE>",
      "error_data": {
        "details": "<ERROR_DETAILS>"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**No webhooks** are triggered for rejection.
{% endhint %}

## Get and Reset Group Invite Link

An invite link for the group is generated when the group is created. Use these endpoints to get and reset group invite links.

{% hint style="info" %}
Once an *invite link* is reset, **all previous invite links will become invalid**.
{% endhint %}

For each endpoint, you will need your **group ID** to get or reset a link for the correct group as follows:

(maybe put here how to get the group id)

| Placeholder                                       | Description                                                                                               | Sample Value                                              |
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| <mark style="color:$success;">`<GROUP_ID>`</mark> | <p><strong>Required.</strong><br><br>The ID of the group you want to get or reset an invite link for.</p> | Y2FwaV9ncm91cDoxOTUwNTU1MDA3OToxMjAzNjMzOTQzMjAdOTY0MTUZD |

### Get Group Invite Link

<mark style="color:$success;">`GET`</mark> `https://waba-v2.360dialog.io/groups/{group_id}/invite_link`

**Expected Outcomes**

```json
{
  "messaging_product": "whatsapp",
  "invite_link": "https://chat.whatsapp.com/<LINK_ID>"
}
```

{% hint style="info" %}
Note that `invite_link` always begins with the prefix `https://chat.whatsapp.com/`. The only variable portion is `<LINK_ID>`
{% endhint %}

### Reset Group Invite Link

<mark style="color:$success;">`POST`</mark> `https://waba-v2.360dialog.io/groups/{group_id}/invite_link`

{% tabs %}
{% tab title="Request body" %}

```json
{
  "messaging_product": "whatsapp",
}
```

{% endtab %}
{% endtabs %}

**Expected Outcomes**

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "messaging_product": "whatsapp",
  "invite_link": "https://chat.whatsapp.com/<LINK_ID>"
}
```

{% endtab %}
{% endtabs %}

## Delete Group

This endpoint deletes the group and removes all participants, including the business. No request body is required.

<mark style="color:red;">`DELETE`</mark> `https://waba-v2.360dialog.io/groups/{group_id}`

{% tabs %}
{% tab title="Request parameters" %}

| Placeholder                                       | Description                                                                                | Sample Value                                              |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------- |
| <mark style="color:$success;">`<GROUP_ID>`</mark> | <p><strong>Required.</strong></p><p><br></p><p>The ID of the group you want to delete.</p> | Y2FwaV9ncm91cDoxOTUwNTU1MDA3OToxMjAzNjMzOTQzMjAdOTY0MTUZD |
| {% endtab %}                                      |                                                                                            |                                                           |
| {% endtabs %}                                     |                                                                                            |                                                           |

#### **Webhooks**

A [`group_lifecycle_update`](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#group-lifecycle-update-webhooks) webhook is triggered.

{% hint style="info" %}
For more details about webhooks, please check the following links:

* **Delete group succeed**

  [View the "Delete group succeed" sample webhook](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#delete-group-succeed)
* **Delete group fails**

  [View the "Delete group fails" sample webhook](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#delete-group-fails)
  {% endhint %}

## Remove Group Participants

Check the steps below to remove participants from the group.

{% hint style="danger" %}
**Note: If a participant is removed from a group, they can no longer join the group via an invite link.**
{% endhint %}

<mark style="color:red;">`DELETE`</mark> `https://waba-v2.360dialog.io/groups/{group_id}/participants`

{% tabs %}
{% tab title="Request parameters" %}

<table><thead><tr><th>Placeholder</th><th>Description</th><th>Sample Value</th></tr></thead><tbody><tr><td>"participants": []</td><td><p><strong>Optional</strong></p><p></p><p>Specifies an array of phone numbers or WhatsApp IDs of WhatsApp accounts. The business phone number used to create the group is always added to the group as the creator and admin.</p><ul><li>Max 8 participants</li><li>The array cannot be empty.</li></ul></td><td><p></p><pre class="language-json"><code class="lang-json">{ "user": "+17865347866" }, 
{ "user": "+7669992245" },
...
</code></pre></td></tr></tbody></table>
{% endtab %}

{% tab title="Request body" %}

```json
{
  "messaging_product": "whatsapp",
  "participants": [
    { "user": "<WHATSAPP_USER_PHONE_NUMBER> or <WHATSAPP_USER_ID>" },
    { "user": "<WHATSAPP_USER_PHONE_NUMBER> or <WHATSAPP_USER_ID>"" },
    ...
  ]
}
```

{% endtab %}
{% endtabs %}

#### **Webhooks**

A [`group_participants_update`](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks#group-participants-update-webhooks) webhook is triggered.

## Get Group Info

Use this to retrieve metadata about a single group.

{% hint style="info" %}
**Note:** Specifying no fields in the query parameters will just return the group ID and messaging product.
{% endhint %}

<mark style="color:$success;">`GET`</mark> `https://waba-v2.360dialog.io/groups/{group_id}`

**Request example**

```json
curl --location --globoff --request GET 'https://waba-v2.360dialog.io/groups/{group_id}?fields=description%2Cparticipants' \
--header 'D360-API-KEY: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "messaging_product": "whatsapp",
  "join_requests": [
    "<JOIN_REQUEST_ID>"
  ]
}'
```

{% tabs %}
{% tab title="Request parameters" %}

| Placeholder                                       | Description                                                                                                                                          | Sample Value                                              |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| <mark style="color:$success;">`<GROUP_ID>`</mark> | <p><strong>Required</strong><br></p><p>The ID of the group you are querying info from.</p>                                                           | Y2FwaV9ncm91cDoxOTUwNTU1MDA3OToxMjAzNjMzOTQzMjAdOTY0MTUZD |
| <mark style="color:$success;">`<FIELDS>`</mark>   | <p><strong>Optional</strong></p><p></p><p>A comma-separated list of fields to return. If no fields are passed in, only the group id is returned.</p> | "subject,description,participants,join\_approval\_mode"   |
| {% endtab %}                                      |                                                                                                                                                      |                                                           |
| {% endtabs %}                                     |                                                                                                                                                      |                                                           |

<details>

<summary>Available Fields</summary>

| Field                                                                                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Sample Return Value                                                                                                                |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| <kbd><mark style="color:$success;">join\_approval\_mode<mark style="color:$success;"></kbd>      | <p>Indicates if WhatsApp users who click the inviation link can join the group with or without being approved first.</p><p>Values can be:</p><ul><li><code>approval\_required</code> — Indicates WhatsApp users must be approved via <a href="https://developers.facebook.com/docs/whatsapp/cloud-api/groups/reference#groups-with-join-requests">join request</a> before they can access the group.</li><li><code>auto\_approve</code> — Indicates WhatsApp users can join the group without approval.</li></ul> | auto\_approve                                                                                                                      |
| <kbd><mark style="color:$success;">subject<mark style="color:$success;"></kbd>                   | The subject for the group.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | "Artificial Intelligence Insights"                                                                                                 |
| <kbd><mark style="color:$success;">description<mark style="color:$success;"></kbd>               | The group description, if set during creation time.                                                                                                                                                                                                                                                                                                                                                                                                                                                               | "Explore AI developments, share knowledge, and discuss the future of artificial intelligence with fellow enthusiasts and experts." |
| <kbd><mark style="color:$success;">suspended<mark style="color:$success;"></kbd>                 | Returns `true` if the group has been suspended by whatsapp.                                                                                                                                                                                                                                                                                                                                                                                                                                                       | false                                                                                                                              |
| <kbd><mark style="color:$success;">creation\_timestamp<mark style="color:$success;"></kbd>       | UNIX timestamp in seconds at which the group was created.                                                                                                                                                                                                                                                                                                                                                                                                                                                         | 683731200                                                                                                                          |
| <kbd><mark style="color:$success;">participants<mark style="color:$success;"></kbd>              | A list of objects `{"wa_id": "<WA_ID>"}`, where `<WA_ID>` is a participant in the group being queried.                                                                                                                                                                                                                                                                                                                                                                                                            | \[{"wa\_id": "2228675309"}, {"wa\_id": "7693349922"}]                                                                              |
| <kbd><mark style="color:$success;">total\_participant\_count<mark style="color:$success;"></kbd> | The total number of participants in the group, excluding your business.                                                                                                                                                                                                                                                                                                                                                                                                                                           | 6                                                                                                                                  |

</details>

**Expected Outcomes**

{% tabs %}
{% tab title="200: OK" %}

```json
{
  "messaging_product": "whatsapp",
  "id": "<GROUP_ID>",
  "subject": "<SUBJECT>",
  "creation_timestamp": "<TIMESTAMP>",
  "suspended": "<SUSPENDED>",
  "description": "<DESCRIPTION>",
  "total_participant_count": "<TOTAL_PARTICIPANT_COUNT>",
  "participants": [
    {
      "wa_id": "<WA_ID>"
    },
    {
      "wa_id": "<WA_ID>"
    }
  ],
  "join_approval_mode": "<JOIN_APPROVAL_MODE>"
}
```

{% endtab %}
{% endtabs %}

## Get Active Groups

Use this to retrieve a list of active groups for a given business phone number.

<mark style="color:$success;">`GET`</mark> `https://waba-v2.360dialog.io/groups`

**Request example**

```json
curl --location 'https://waba-v2.360dialog.io/groups' \
--header 'D360-API-KEY: <API_KEY>'
```

{% tabs %}
{% tab title="Query Parameters" %}

```html
 ?limit=<LIMIT>, // Optional
  &after=<AFTER_CURSOR>, // Optional
  &before=<BEFORE_CURSOR> // Optional
```

{% endtab %}

{% tab title="Parameters" %}

| Parameter                                              | Description                                                                       |                              |                                |
| ------------------------------------------------------ | --------------------------------------------------------------------------------- | ---------------------------- | ------------------------------ |
| <mark style="color:$success;">`<LIMIT>`</mark>         | <p>Number of groups to fetch in the request.</p><p></p><p><strong>Min</strong>: 1 | <strong>Default</strong>: 25 | <strong>Max</strong>: 1024</p> |
| <mark style="color:$success;">`<BEFORE_CURSOR>`</mark> | Cursor that points to the beginning of a page of data                             |                              |                                |
| <mark style="color:$success;">`<AFTER_CURSOR>`</mark>  | Cursor that points to the end of a page of data                                   |                              |                                |
| {% endtab %}                                           |                                                                                   |                              |                                |
| {% endtabs %}                                          |                                                                                   |                              |                                |

**Expected Outcomes**

{% tabs %}
{% tab title="200: OK" %}

```
{ 
  "data": {
    "groups": [
      {"id": "GROUP_ID", "subject": SUBJECT, "created_at": "TIMESTAMP"},
      {"id": "GROUP_ID", "subject": SUBJECT, "created_at": "TIMESTAMP"}
      …
    ]
  },
  "paging": {
    "cursors": {
      "after": "MTAxNTExOTQ1MjAwNzI5NDE=",
      "before": "NDMyNzQyODI3OTQw"
    },
    "previous": "https://graph.facebook.com/VERSION/PHONE_NUMBER_ID/groups?limit=10&before=NDMyNzQyODI3OTQw",
    "next": "https://graph.facebook.com/VERSION/PHONE_NUMBER_ID/groups?limit=25&after=MTAxNTExOTQ1MjAwNzI5NDE="
  }
}
```

{% endtab %}
{% endtabs %}

<details>

<summary>Response Parameters</summary>

| Parameter                                           | Description                                                                                           |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| <mark style="color:$success;">`data[groups]`</mark> | A list of groups, each containing the group id, group subject, and UNIX timestamp for group creation. |
| <mark style="color:$success;">`paging`</mark>       | A pagination object.                                                                                  |

</details>

## Update Group Settings

Use this request to update your group's subject, description, and photo.

<mark style="color:$success;">`POST`</mark> `https://waba-v2.360dialog.io/groups/{group_id}`

{% tabs %}
{% tab title="Request body" %}

```json
{
  "messaging_product": "whatsapp",
  "subject": "<GROUP_SUBJECT>",
  "profile_picture_file": "<FILE_PATH>",
  "description": "<GROUP_DESCRIPTION>",
}
```

{% endtab %}

{% tab title="Request properties" %}

<table><thead><tr><th>Placeholder</th><th>Description</th><th>Sample value</th></tr></thead><tbody><tr><td><mark style="color:$success;"><code>&#x3C;FILE_PATH></code></mark></td><td><p><strong>Optional</strong></p><p></p><p>A path to an image file stored in your local directory.</p><p></p><p><strong>To upload a file</strong>: Follow the same request structure as the <a href="https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#upload-media">Upload Media</a> endpoint.</p><p>Sample file upload cURL:</p><pre><code>curl 'https://graph.facebook.com/v23.0/&#x3C;GROUP_ID> \
-X POST \
-H 'Authorization: Bearer ...' \
-F 'messaging_product=whatsapp' \
-F 'file=@/media/pictures/square_pic.png'
</code></pre><p>Group profile picture requirement:</p><ul><li>Only support mime type image/jpeg</li><li>Maximum size: 5MB</li><li>Image should be in square, that is, height = width.</li><li>Minimum size: 192 x 192</li></ul></td><td>/local/path/file.jpg</td></tr><tr><td><mark style="color:$success;"><code>&#x3C;GROUP_SUBJECT></code></mark></td><td><p><strong>Optional</strong></p><p></p><p>The new subject for the group.</p><ul><li>Max length: 128 characters</li><li>Must not be empty if provided.</li></ul></td><td>"Watch Enthusiasts"</td></tr><tr><td><mark style="color:$success;"><code>&#x3C;GROUP_DESCRIPTION></code></mark></td><td><p><strong>Optional</strong></p><p></p><p>The new description for the group.</p><ul><li>Max length: 2048 characters</li></ul></td><td>"Join our community to discuss the latest timepieces, share watch reviews, and connect with fellow horology enthusiasts."</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

#### Webhooks

A [`group_settings_update`](https://developers.facebook.com/docs/whatsapp/cloud-api/groups/webhooks) webhook is triggered.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.360dialog.com/docs/messaging/groups/group-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
