REST calls use your
hmok_ API key and need the scope channel.manage to change things, or channel.read to read.
CLI commands start with
hookmyapp whatsapp and take --channel and --json.Full request and response details are in the API reference. Make sure the number can use groups first.
Async changes
Creating a group, changing it, setting the photo, removing members, and deleting it finish a moment after the call.The call returns
202 with a requestId. The result arrives as a whatsapp.group.updated event with the same requestId.
Send an Idempotency-Key header on writes so a retry never runs twice.
Create a group
joinApprovalMode is auto_approve (anyone with the link joins) or approval_required (you approve each person). The CLI takes --approval auto or --approval required.
The answer is { "channelId": "ch_AbCdEf12", "requestId": "..." }. The group id arrives in the created event with the same requestId, or find the new group in the list.
List and read groups
groups (each with groupId, subject, createdAt) and nextCursor. Pass nextCursor as cursor for the next page. limit is 1 to 1024.
description, joinApprovalMode, suspended, participantCount, and participants. Each participant has waId (the phone number) or userId (when the member has hidden their phone number).
Change a group
Sendsubject, description, or both.
Set the photo
Send one JPEG asmultipart/form-data, in a part named file. It must be square, at least 192 px, and up to 5 MB.
Delete a group
Deleting a group removes its members.202 with a requestId. The result arrives as a deleted event with the same requestId. succeeded says whether it worked.
Invite link
The answer holds
inviteLink. It is null after a revoke.
Remove members
Remove up to 8 members per call. Each is a phone number (waId) or a userId, as listed on the group.
member_removed event.
Join requests
On anapproval_required group, people who tap the invite link wait for you to approve them.
succeeded ids and failed requests with a reason each.
You get a join_requested event for every new request.