I Automated 50 WhatsApp Groups With This Simple API Hack Copy My Exact Code

August 20, 2025

Learn everything you need to know about managing, automating and sending messages on WhatsApp Groups in 2025. Includes ready-to-use code examples!

This tutorial will explore all the possible use cases for WhatsApp Groups automation using the API — code examples included.

🤩 🤖 Wassenger is a complete communication platform and API solution for WhatsApp. Explore more than 100+ API use cases and automate anything on WhatsApp by signing up for a free trial and get started in minutes!

# Create a new group chat

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the POST method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

{
  "name": "Group name",
  "description": "This is a group sample description",
  "participants": [
    {
      "phone": "+12345678900",
      "admin": true
    },
    {
      "phone": "+12345678901",
      "admin": false
    }
  ],
  "permissions": {
    "edit": "admins",
    "send": "all",
    "invite": "admins",
    "approval": false
  }
}

🖥️ Looking for a code example? Go to the API live tester and get ready-to-use code examples in 15+ programming languages, including Python, JavaScript, PHP, C#, Java, Ruby, Go, Powershell, cURL and more.

# Get a list of available group chats

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the GET method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

# Update group information and permissions

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the PATCH method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

{
  "name": "New group name",
  "description": "This is a new group sample description",
  "ephemeral": "7d",
  "permissions": {
    "edit": "admins",
    "send": "all",
    "invite": "all",
    "approval": false
  }
}

# Update group image

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the PUT method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/image

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

{
  "url": "https://picsum.photos/200"
}

# Add participants to a group

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the POST method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/participants

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

{
  "participants": [
    {
      "phone": "+1234567890",
      "admin": true
    },
    {
      "phone": "+1234567890",
      "admin": false
    }
  ]
}

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

# Remove participants from a group

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the DELETE method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/participants

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

['+1234567890', '+1234567890'];

# Promote participants as administrators in a group chat

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the PATCH method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/participants

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

{
  "participants": [
    {
      "phone": "+1234567890",
      "admin": true
    },
    {
      "phone": "+1234567890",
      "admin": true
    }
  ]
}

🖥️ Looking for a code example? Go to the API live tester and get ready-to-use code examples in 15+ programming languages, including Python, JavaScript, PHP, C#, Java, Ruby, Go, Powershell, cURL and more.

# Demote participants as administrators in a group chat

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the PATCH method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/participants

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use body in JSON format

{
  "participants": [
    {
      "phone": "+1234567890",
      "admin": false
    },
    {
      "phone": "+1234567890",
      "admin": false
    }
  ]
}

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

# Get pending approvals for new group members

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the GET method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/members

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

# Approve group members by phone number

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the POST method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/members

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use the body in JSON format

{
  "phones": ["+1234567890"]
}

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

# Approve all pending group members

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to numbers settings > Groups > Copy the Group WID.
  2. API: query the available groups for your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the POST method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/members

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use the body in JSON format

{
  "all": true
}

# Reject group members by phone number

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to numbers settings > Groups > Copy the Group WID.
  2. API: query the available groups for your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the DELETE method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/members

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use the body in JSON format

{
  "phones": ["+1234567890"]
}

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

# Reject all pending group members

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to numbers settings > Groups > Copy the Group WID.
  2. API: query the available groups for your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the DELETE method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/members

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use the body in JSON format

{
  "all": true
}

# Get group invite code and URL

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to numbers settings > Groups > Copy the Group WID.
  2. API: query the available groups for your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the GET method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/invite

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

# Revoke group invite code

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to numbers settings > Groups > Copy the Group WID.
  2. API: query the available groups for your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the DELETE method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups/{groupId}/invite

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

# Join a group by invitation code

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to numbers settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the PUT method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use the body in JSON format

{
"code": "{{GROUP INVITE CODE}}", 
"url": "{{GROUP INVITE URL}}"
}

Replace the following expressions with an actual value:

  • {{GROUP INVITE CODE}} Replace this expression with the specific value
  • {{GROUP INVITE URL}} Replace this expression with the correct value

# Leave a group

Requirements

  • Have a WhatsApp number already linked to the platform and online.
  • Get your Wassenger API key here.
  • Group WhatsApp ID (WID) that you can find in two ways:

How to obtain the Group WhatsApp ID

You can obtain the Group WhatsApp ID by using one of these methods:

  1. Web: go to number’s settings > Groups > Copy the Group WID.
  2. API: query the available groups in your number using this endpoint.

API endpoint

We will use the following API endpoint to create the group:

Prepare the request

Target API URL using the DELETE method

Test the API directly on your browser clicking here

https://api.wassenger.com/v1/devices/{deviceId}/groups

Required HTTPS headers > Obtain your API key here

Content-Type: application/json
Token: $API_TOKEN

Use the body in JSON format

{
"id": "$GROUP_ID@g.us", 
"remove": true
}

🤩 🤖 Wassenger is a complete API solution for WhatsApp. Sign up for a 7-day free trial and get started in minutes!

Live API testing

You can live-test and play with the API directly from your browser.

Once you are done testing, get the auto-generated code example in your preferred programming language and you will be ready to go.

Try our API-Live tester now

Ready to transform your WhatsApp communication?

Start automating your customer interactions today with Wassenger

Get Started Free