Source: src/tools/Groups.php
Docs: https://green-api.com/en/docs/api/groups/
Group chatId format: ...@g.us (Chat Id). Never invent IDs — use API responses.
Docs: https://green-api.com/en/docs/api/groups/CreateGroup/
public function createGroup(string $groupName, array $chatIds): stdClass| Param | Required | Docs |
|---|---|---|
groupName |
yes | Max 100 characters |
chatIds |
yes | Array of participant chatIds (phone@c.us) |
Rate (docs): no more than 1 group every 5 minutes. Simulate human pacing.
Success data:
| Field | Description |
|---|---|
created |
boolean |
chatId |
group id @g.us |
groupInviteLink |
invite URL |
Risks: non-WhatsApp numbers in chatIds → errors / ban risk. Prefer serviceMethods->checkWhatsapp first.
Docs: https://green-api.com/en/docs/api/groups/UpdateGroupName/
public function updateGroupName(string $groupId, string $groupName): stdClassDocs: https://green-api.com/en/docs/api/groups/GetGroupData/
public function getGroupData(string $groupId): stdClassReturns group metadata and participants (see docs for full schema).
public function addGroupParticipant(string $groupId, string $participantChatId): stdClass
public function removeGroupParticipant(string $groupId, string $participantChatId): stdClassDocs: SetGroupAdmin, RemoveAdmin
public function setGroupAdmin(string $groupId, string $participantChatId): stdClass
public function removeAdmin(string $groupId, string $participantChatId): stdClassDocs: https://green-api.com/en/docs/api/groups/SetGroupPicture/
public function setGroupPicture(string $groupId, string $path): stdClassLocal file path; SDK uploads as JPEG form-data.
Docs: https://green-api.com/en/docs/api/groups/LeaveGroup/
public function leaveGroup(string $groupId): stdClassCurrent account leaves the group.
$create = $greenApi->groups->createGroup('Team', ['79876543210@c.us']);
if ($create->code === 200 && $create->data->created) {
$groupId = $create->data->chatId;
$greenApi->sending->sendMessage($groupId, 'Hello group');
$greenApi->groups->getGroupData($groupId);
}updateGroupSettings(exists in docs, not in PHPGroups.php)