Groups

Create and manage WhatsApp groups over the API

Everything under /v1/connections/{connection}/groups. Group management is on paid plans, needs a linked connection, and every change is audited.

Create a group

A group for one property's viewings
curl https://www.chatrail.dev/v1/connections/sales/groups \
  -H "Authorization: Bearer $CHATRAIL_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "Riverside viewings",
    "participants": ["+447700900123", "+447700900456"]
  }'

The response is the group in full — id, name, settings and each member's role. Use the id to send to it as { "group": "…" }, and to manage it below.

Members, admins and settings

FieldTypeNotes
POST /{group}/participants{ action, participants }add, remove, promote or demote.
PATCH /{group}name, description, …messages_admins_only, info_admins_only.
GET /{group}/inviteThe chat.whatsapp.com link.
POST /{group}/invite/revokeInvalidate the link and get a new one.
POST /{group}/leaveThis number leaves.

Changing settings or members needs this number to be an admin; if it is not, WhatsApp refuses and the API says so. Joins, leaves and role changes — yours or anyone's — arrive as group.participants_changed.

The member-add guardrail

Adding people who did not ask to be in a group is one of the quickest ways to get a number reported. So a connection can add at most 20 people per hour — founding members included — and the request that would pass it is refused with 429 and how many are left this hour, before WhatsApp is contacted. Removals and role changes are not counted. Invite links are the better route for a large group: people join because they chose to.

Related documentation

API reference · Webhook events · WhatsApp API · Security

BUILD IT

Wire it against the real schemas.

Every shape on this page is the one the endpoint validates. Verify it in your own stack before production rollout.

Start free