Create groups, manage join requests, invite links, participants, and settings.
- POST /{PHONE_NUMBER_ID}/groups
- GET /{PHONE_NUMBER_ID}/groups?limit&after&before
- GET /{GROUP_ID}?fields
- POST /{GROUP_ID}
- DELETE /{GROUP_ID}
- GET /{GROUP_ID}/invite_link
- POST /{GROUP_ID}/invite_link
- GET /{GROUP_ID}/join_requests
- POST /{GROUP_ID}/join_requests
- DELETE /{GROUP_ID}/join_requests
- DELETE /{GROUP_ID}/participants
join_approval_modecan beauto_approveorapproval_required.- Participant removal supports up to 8 users per request.
- Group settings updates can include a profile picture file.
import WhatsApp from 'meta-cloud-api';
const client = new WhatsApp({
accessToken: process.env.CLOUD_API_ACCESS_TOKEN!,
phoneNumberId: Number(process.env.WA_PHONE_NUMBER_ID),
businessAcctId: process.env.WA_BUSINESS_ACCOUNT_ID!,
});
const group = await client.groups.createGroup({
subject: 'New Group',
description: 'Group description',
join_approval_mode: 'auto_approve',
});
const info = await client.groups.getGroupInfo(group.id, [
'subject',
'description',
'participants',
]);
const invite = await client.groups.getGroupInviteLink(group.id);
await client.groups.removeParticipants(group.id, ['15551234567']);
await client.groups.deleteGroup(group.id);createGroupsetssubject,description, andjoin_approval_mode.getGroupInfouses a fields array to limit the payload size.getGroupInviteLinkreturns a shareable link;removeParticipantstakes WA IDs.deleteGroupremoves the group permanently.