The group management endpoint allows you to perform various WhatsApp group operations including creating groups, managing participants, and updating group settings.
Key Operations:
Create new groups with specified participants
Update group details (name, description, picture)
Manage participants (add, remove, promote/demote admins)
Handle group invites and messaging permissions
Example Request
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "create",
"agent_number": "+1234567890",
"title": "New Group",
"participants": ["+1987654321"]
}'
Request Body
The operation to perform. Valid values:
create
update_name
update_description
update_picture
add_participants
remove_participants
promote_admin
demote_admin
join
leave
update_settings
The phone number initiating the action (must start with ’+’)
The group chat ID. Required for all actions except ‘create’
Action-Specific Fields
Required fields for action: "create"
:
title
(string): Group name
participants
(array): Phone numbers to add
initial_message
(string, optional): First message to send
Fields for update actions:
name
(string): New group name (update_name
)
description
(string): New description (update_description
)
image_url
(string): New profile picture URL (update_picture
)
Required for participant management actions:
participants
(array): Phone numbers to modify
For actions: add_participants
, remove_participants
, promote_admin
, demote_admin
Required for action: "join_group"
:
invite_code
(string): Group invite code
thread_id
(string): Direct group ID (if already have access)
Required for update_settings
:
setting
(string): One of:
announcement
: Only admins can send messages in the group
not_announcement
: All participants can send messages in the group
locked
: Only admins can modify group settings (display picture, description, etc)
unlocked
: All participants can modify group settings
Example Requests
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "create",
"agent_number": "+1234567890",
"title": "Project Team",
"participants": ["+1987654321", "+1012345678"],
"initial_message": "Welcome to the project team group!"
}'
# Update Name
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "update_name",
"agent_number": "+1234567890",
"thread_id": "123123",
"name": "A1Base Project Team"
}'
# Update Description
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "update_description",
"agent_number": "+1234567890",
"thread_id": "123123",
"description": "Official group for project coordination"
}'
# Update Picture
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "update_picture",
"agent_number": "+1234567890",
"thread_id": "123123",
"image_url": "https://example.com/group-image.jpg"
}'
# Add Participants
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "add_participants",
"agent_number": "+1234567890",
"thread_id": "123123",
"participants": ["+1555999888", "+1555777666"]
}'
# Remove Participants
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "remove_participants",
"agent_number": "+1234567890",
"thread_id": "123123",
"participants": ["+1555999888"]
}'
# Promote Admin
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "promote_admin",
"agent_number": "+1234567890",
"thread_id": "123123",
"participants": ["+1555777666"]
}'
# Demote Admin
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "demote_admin",
"agent_number": "+1234567890",
"thread_id": "123123",
"participants": ["+1555777666"]
}'
# Join Group
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "join_group",
"agent_number": "+1234567890",
"thread_id": "123123"
}'
# Leave Group
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "leave",
"agent_number": "+1234567890",
"thread_id": "123123"
}'
# Update Group Settings
curl --location 'https://api.a1base.com/v1/whatsapp/{accountId}/group-management' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-api-secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"action": "update_settings",
"agent_number": "+1234567890",
"thread_id": "123123",
"setting": "announcement"
}'