You run the steps from your own code. Groups give you the building blocks. Before you start:
- The number can use groups.
- You have an approved group invite template.
- You subscribed to
whatsapp.group.updatedwith an event subscription.
The flow
1
A ticket opens: create the group
Create the group and keep the The
requestId next to your ticket.Idempotency-Key protects against network retries. Send the same key again within 24 hours and you get the original answer, not a second group.2
Wait for the created event
Find the
Save its
whatsapp.group.updated event whose requestId matches, with change set to created.Save its
groupId on the ticket. If change is create_failed, read error, then create again with a new key, such as ticket-1042-2. The old key would replay the failed attempt.3
Send the invite 1:1
Send the invite template to each person, with the
People join through the link, so you never add them yourself.
groupId as the group_id parameter.People join through the link, so you never add them yourself.
4
Greet people when they join
On The event’s
member_joined, send a message to the group.member tells you who joined.5
The ticket closes: delete the group
Delete the group. Its members are removed.The call returns
202 with a requestId. A deleted event with the same requestId and succeeded: true confirms it.Tips
- Use
approval_requiredwhen only some people should join. Approve them onjoin_requested. See join requests. - Events can arrive more than once. Drop duplicates by the event
id. - Keep the ticket,
requestId, andgroupIdtogether so you can find the group again when the case closes. - A group holds 8 members. Plan for that when you invite.