Group Management
Manage WhatsApp groups including creating, updating, and managing participants.
Create Group
Create a new WhatsApp group.
POST /sessions/{id}/groups/create
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Group name |
participants | array | Yes | Array of phone numbers to add |
Example Request
curl -X POST http://localhost:3000/sessions/{id}/groups/create \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"name": "My New Group",
"participants": ["919988066776", "919876543210"]
}'
Response
{
"success": true,
"group": {
"id": "120363123456789@g.us",
"name": "My New Group"
}
}
Get Group Info
Get detailed information about a group.
GET /sessions/{id}/groups/{groupId}
Example Request
curl -H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/groups/120363123456789@g.us
Response
{
"success": true,
"group": {
"id": "120363123456789@g.us",
"name": "My Group",
"description": "Group description",
"owner": "919878695378@s.whatsapp.net",
"participants": [
{
"id": "919878695378@s.whatsapp.net",
"admin": "superadmin"
},
{
"id": "919988066776@s.whatsapp.net",
"admin": null
}
]
}
}
Update Group Name
Update the name of a group.
PUT /sessions/{id}/groups/{groupId}/name
Request Body
{
"name": "New Group Name"
}
Example Request
curl -X PUT http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/name \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{"name": "New Group Name"}'
Update Group Description
Update the description of a group.
PUT /sessions/{id}/groups/{groupId}/description
Request Body
{
"description": "This is the new group description"
}
Example Request
curl -X PUT http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/description \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{"description": "This is the new group description"}'
Add Participants
Add participants to a group.
POST /sessions/{id}/groups/{groupId}/participants/add
Request Body
{
"participants": ["919988066776", "919876543210"]
}
Example Request
curl -X POST http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/participants/add \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{"participants": ["919988066776", "919876543210"]}'
Remove Participants
Remove participants from a group.
POST /sessions/{id}/groups/{groupId}/participants/remove
Request Body
{
"participants": ["919988066776"]
}
Example Request
curl -X POST http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/participants/remove \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{"participants": ["919988066776"]}'
Promote to Admin
Promote participants to group admin.
POST /sessions/{id}/groups/{groupId}/participants/promote
Request Body
{
"participants": ["919988066776"]
}
Example Request
curl -X POST http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/participants/promote \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{"participants": ["919988066776"]}'
Demote from Admin
Demote participants from group admin.
POST /sessions/{id}/groups/{groupId}/participants/demote
Request Body
{
"participants": ["919988066776"]
}
Example Request
curl -X POST http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/participants/demote \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{"participants": ["919988066776"]}'
Get Group Invite Link
Get the invite link for a group.
GET /sessions/{id}/groups/{groupId}/invite-link
Example Request
curl -H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/invite-link
Response
{
"success": true,
"inviteLink": "https://chat.whatsapp.com/ABC123XYZ"
}
Revoke Group Invite Link
Revoke the current invite link and generate a new one.
POST /sessions/{id}/groups/{groupId}/revoke-invite
Example Request
curl -X POST \
-H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/revoke-invite
Leave Group
Leave a group.
POST /sessions/{id}/groups/{groupId}/leave
Example Request
curl -X POST \
-H "X-API-Key: wask_your_session_key" \
http://localhost:3000/sessions/{id}/groups/120363123456789@g.us/leave
Send Message to Group
Use the same /send endpoint with group ID:
curl -X POST http://localhost:3000/sessions/{id}/send \
-H "X-API-Key: wask_your_session_key" \
-H "Content-Type: application/json" \
-d '{
"to": "120363123456789@g.us",
"text": "Hello group!"
}'
Group IDs always end with @g.us (e.g., 120363123456789@g.us)