WhatsApp Groups
Create and manage WhatsApp groups, invite participants, handle join requests, and send group messages (templates and free-form text).
All group management requests use HTTP Basic Auth (api_key / api_token) and Content-Type: application/json.
Prerequisites
| Requirement | Detail |
|---|---|
| WhatsApp Cloud API number | The from number must be connected to Exotel on the WhatsApp Cloud API. Other setups are rejected (422 / 1033). |
| Official Business Account (OBA) | The number must be a Meta Official Business Account (green tick). Otherwise create fails (422 / 1034). |
| Number ownership | The from number must belong to your Exotel account (404 / 1021 otherwise). |
| Active account with KYC | Your Exotel account must be active (403 / 1006 otherwise) with KYC completed (403 / 1007 otherwise). |
| WhatsApp Groups enabled | Groups is enabled per Exotel account. Until it is enabled, Group API calls and group sends return 403 / 1038. Contact Exotel support to enable it. |
| Approved invite template | To invite users by message, you need an approved template with a group-invite (group_id) body parameter. |
Limits
| Limit | Value |
|---|---|
| Groups per business number (not deleted) | 10,000 |
| Group subject | 1–128 characters |
| Group description | Up to 2,048 characters |
| Invite recipients per invite request | 1–7 numbers |
| Participants removed per request | 1–8 |
Invite template.body_parameters | Up to 20 |
| Join requests approved/rejected per request | 1–100 |
| Maximum participants per group | 8 (set by WhatsApp; see Meta Groups API) |
List limit | 1–100 (default 25) |
Response Format
Every Group API response uses the same envelope. On success, response.data holds the result:
{
"request_id": "<exotel_request_id>",
"method": "POST",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {}
}
}
On error, response.status is failure, data is omitted and error_data holds the error. error_data.message is the short error name; error_data.description gives the specific reason (for example which field failed validation, or WhatsApp's reason for 1003).
{
"request_id": "<exotel_request_id>",
"method": "GET",
"http_code": 404,
"response": {
"code": 404,
"error_data": {
"code": 1036,
"description": "Group not found",
"message": "Group not found"
},
"status": "failure"
}
}
See Error Codes for the full list.
Create Group
Create a WhatsApp group owned by your business phone number. Creation is asynchronous: the API returns PENDING with Exotel's internal id. Keep that id to match the group in List results while it is pending.
When WhatsApp confirms the group, status becomes ACTIVE and a WhatsApp group_id (and invite link) become available. If WhatsApp rejects the create, or does not confirm it within about 30 minutes (rarely up to 24 hours), status becomes FAILED — create a new group (use a new Idempotency-Key).
POST /v2/accounts/{account_sid}/whatsapp/groups
Headers
| Header | Required | Description |
|---|---|---|
Idempotency-Key | Optional | Up to 128 characters. Retrying with the same key returns the group created by the first request (in its current status, which may already be ACTIVE) instead of creating a new one. Reusing a key with a different from or subject returns 409 / 1039. |
Idempotency-Key
Because create is asynchronous, callers often time out and retry. Always send an Idempotency-Key on create and reuse it on retries (timeouts, 502 / 1040, 5xx).
- Same key + same
from/subject→ returns the original group (no duplicate Meta create). - Same key + different
fromorsubject→409/1039. - Retrying without the key after a timeout can create a second real group against your Meta quota.
Request Body
{
"from": "+919876500001",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required"
}
Parameters
| Field | Required | Description |
|---|---|---|
from | Mandatory | Business WhatsApp number that owns the group (with or without leading +) |
subject | Mandatory | Group name. 1–128 characters after trimming spaces. |
description | Optional | Group description. Up to 2,048 characters. |
join_approval_mode | Optional | auto_approve (default when omitted) — anyone with the link joins directly; approval_required — you approve each join request. |
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. response.data.status is PENDING. response.data.id is Exotel's identifier — use it to match List results while pending. |
response.data.request_id is WhatsApp's create request reference when Meta returns it in the create response. It may be absent if WhatsApp's answer was delayed; the group still completes in the background. Match on Exotel id when polling, not on request_id.
group_id and invite_link are not returned while the group is PENDING.
{
"request_id": "a3f1c2d4e5b64f7a8b9c0d1e2f3a4b5c",
"method": "POST",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {
"id": 1042,
"request_id": "<whatsapp_request_id>",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required",
"status": "PENDING",
"phone_number_id": "<phone_number_id>",
"waba_id": "<waba_id>"
}
}
}
If WhatsApp rejects the create outright, the create call itself returns an error and the group is stored as FAILED. A PENDING response means WhatsApp accepted the request, or did not answer in time; poll as below.
Poll List Groups with status=PENDING, status=ACTIVE and status=FAILED (one status per call) and match by id until the group is ACTIVE (then use group_id) or FAILED (stop and create again with a new Idempotency-Key). Do not call invite, invite-link, join-request, or send APIs that require group_id until the group is ACTIVE.
List Groups
List your groups, oldest first (ascending id), one status at a time. Deleted groups are not listed.
GET /v2/accounts/{account_sid}/whatsapp/groups
GET /v2/accounts/{account_sid}/whatsapp/groups?status=ACTIVE
GET /v2/accounts/{account_sid}/whatsapp/groups?status=PENDING
GET /v2/accounts/{account_sid}/whatsapp/groups?status=FAILED
Query Parameters
| Parameter | Required | Description |
|---|---|---|
status | Optional | ACTIVE (default), PENDING, or FAILED |
from | Optional | Filter by business number (with or without +). Must belong to your account. |
limit | Optional | Page size, 1–100. Default 25. Values outside 1–100 return 400 / 1002. |
after | Optional | Cursor from the previous page's paging.after |
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. response.data.groups is an array of groups. paging is omitted on the last page. |
400 | 1002 — invalid status, from, limit or after cursor |
404 | 1021 — from number not in your account |
Each item in groups has id, group_id, request_id, invite_link, subject, description, join_approval_mode, status, phone_number_id and waba_id. group_id and invite_link are returned only for ACTIVE groups. In rare cases a newly ACTIVE group has no link stored yet; call Get Invite Link to fetch it.
{
"request_id": "<exotel_request_id>",
"method": "GET",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {
"groups": [
{
"id": 1042,
"group_id": "<group_id>",
"request_id": "<whatsapp_request_id>",
"invite_link": "https://chat.whatsapp.com/XXXXXXXXXXXX",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required",
"status": "ACTIVE",
"phone_number_id": "<phone_number_id>",
"waba_id": "<waba_id>"
}
],
"paging": {
"after": "MTA0Mg"
}
}
}
}
List does not return why a group failed. If Create itself returned an error, that error is the reason. If the group failed later, WhatsApp's reason is in the errors of the group_create event (see Group Events).
Get Group
Retrieve a single group by WhatsApp group_id, with live details from WhatsApp (current subject and description, participants, suspension state).
GET /v2/accounts/{account_sid}/whatsapp/groups/{group_id}
Path Parameters
| Parameter | Required | Description |
|---|---|---|
group_id | Mandatory | WhatsApp group ID returned when the group is ACTIVE |
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. response.data.status is ACTIVE for a live group. |
404 | Unknown or deleted group (1036) |
409 | Group exists but is not ACTIVE (1037) |
response.data has the same fields as a List item, plus these details from WhatsApp:
| Field | Description |
|---|---|
participants | Array of participants, each with wa_id. Omitted when the group has no participants. |
suspended | true when WhatsApp has suspended the group for policy reasons. Sends to a suspended group fail (WhatsApp error 131207). |
creation_timestamp | Creation time, Unix seconds (number) |
total_participant_count | Number of participants (number) |
{
"request_id": "<exotel_request_id>",
"method": "GET",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {
"id": 1042,
"group_id": "<group_id>",
"request_id": "<whatsapp_request_id>",
"invite_link": "https://chat.whatsapp.com/XXXXXXXXXXXX",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required",
"status": "ACTIVE",
"phone_number_id": "<phone_number_id>",
"waba_id": "<waba_id>",
"participants": [
{ "wa_id": "919876543210" },
{ "wa_id": "919811122233" }
],
"suspended": false,
"creation_timestamp": 1764487800,
"total_participant_count": 2
}
}
}
Send Group Invite
Send an invite template (Meta library template with the group link) to one or more phone numbers, one message each. Invites are ordinary template messages: they are billed, reported and get status callbacks like any other template send.
POST /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/invites
Request Body
{
"from": "+919876500001",
"to": [
"+919876543210",
"+919811122233"
],
"template": {
"name": "group_invite_link_concise",
"language": "en",
"body_parameters": [
"Order updates",
"Acme"
],
"group_id_position": 3
}
}
Parameters
| Field | Required | Description |
|---|---|---|
from | Mandatory | The business WhatsApp number that created the group (with or without leading +). Any other number is rejected (400 / 1002). |
to | Mandatory | Array of 1–7 recipient phone numbers in E.164. Each must start with +; numbers without it are rejected. |
template.name | Mandatory | Approved invite template name |
template.language | Mandatory | Template language code (e.g. en) |
template.body_parameters | Optional | Your text substitutions for the template body, in order. Up to 20; values must not be empty. Omit when the template has no text parameters besides the group. |
template.group_id_position | Optional | 1-based position, among all body parameters, of the group parameter that Exotel adds. Exotel adds a group_id parameter there and WhatsApp renders it as the group invite link. Must be between 1 and the number of body_parameters + 1. Default: last (after all body_parameters), as in Meta's library invite templates. |
You may include or omit the leading + on from; Exotel normalizes it. Each to number must include the leading +.
Expected Response
| HTTP | Notes |
|---|---|
200 | Request processed. response.data.messages has one entry per recipient, in the same format as the Send Message API response. Check each entry's status: the request can succeed while an individual invite fails. |
429 | 1011 — messaging rate limit hit; invites were not sent |
502 | 1040 — messaging service unavailable; retry |
{
"request_id": "<exotel_request_id>",
"method": "POST",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {
"group_id": "<group_id>",
"messages": [
{
"code": 202,
"error_data": null,
"status": "success",
"data": { "sid": "<message_sid_1>" }
},
{
"code": 202,
"error_data": null,
"status": "success",
"data": { "sid": "<message_sid_2>" }
}
]
}
}
}
The total number of body parameters (your body_parameters plus the group parameter) must match the template's placeholders, or WhatsApp rejects the message.
Recipients must open the invite, join the group, and (for free-form messaging) post in the group to open the 24-hour customer care window.
Get Invite Link
Return the current WhatsApp invite link for the group (https://chat.whatsapp.com/...).
GET /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/invite-link
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. Response includes a https://chat.whatsapp.com/... link. |
Reset Invite Link
Invalidate the current invite link and issue a new one. Opening the old link shows that the invite link was reset.
POST /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/invite-link
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. A new https://chat.whatsapp.com/... link is returned. |
List Join Requests
List pending join requests for a group created with join_approval_mode: approval_required. Empty when the group is auto_approve, or when no one has requested to join yet.
GET /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/join-requests
Query Parameters
| Parameter | Required | Description |
|---|---|---|
after | Optional | Cursor from the previous page's paging.cursors.after |
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. WhatsApp's data and paging are returned as-is in response.data, with group_id added. |
Each request has join_request_id, user_id (WhatsApp user ID) and creation_timestamp (Unix seconds, number). wa_id is omitted when the user's phone number is not available. When there are no pending requests, data is empty and paging is omitted.
{
"request_id": "<exotel_request_id>",
"method": "GET",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {
"group_id": "<group_id>",
"data": [
{
"join_request_id": "<join_request_id>",
"wa_id": "919876543210",
"user_id": "<whatsapp_user_id>",
"creation_timestamp": 1764488400
}
],
"paging": {
"cursors": { "before": "<cursor>", "after": "<cursor>" }
}
}
}
}
Approve Join Requests
Approve one or more pending join requests. Approved users are added to the group.
POST /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/join-requests
Request Body
{
"join_requests": [
"<join_request_id>"
]
}
Parameters
| Field | Required | Description |
|---|---|---|
join_requests | Mandatory | Array of 1–100 join request IDs from List Join Requests. Empty IDs are rejected. |
Expected Response
| HTTP | Notes |
|---|---|
200 | Request processed. WhatsApp's result is returned as-is in response.data, with group_id added. |
approved_join_requests lists the approved IDs. failed_join_requests (each with join_request_id and errors) appears only when some requests could not be processed, so a 200 can still contain failures.
{
"request_id": "<exotel_request_id>",
"method": "POST",
"http_code": 200,
"response": {
"code": 200,
"error_data": null,
"status": "success",
"data": {
"group_id": "<group_id>",
"approved_join_requests": ["<join_request_id_1>"],
"failed_join_requests": [
{
"join_request_id": "<join_request_id_2>",
"errors": [
{
"code": 0,
"message": "<error_message>",
"title": "<error_title>",
"error_data": { "details": "<error_details>" }
}
]
}
]
}
}
}
Reject Join Requests
Reject one or more pending join requests.
DELETE /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/join-requests
Request Body
{
"join_requests": [
"<join_request_id>"
]
}
Parameters
| Field | Required | Description |
|---|---|---|
join_requests | Mandatory | Array of 1–100 join request IDs to reject. Empty IDs are rejected. |
Expected Response
| HTTP | Notes |
|---|---|
200 | Request processed. Same format as Approve Join Requests, with rejected_join_requests instead of approved_join_requests. Check failed_join_requests. |
Remove Participants
Remove one or more participants from the group.
DELETE /v2/accounts/{account_sid}/whatsapp/groups/{group_id}/participants
Request Body
{
"participants": [
{
"user": "+919811122233"
}
]
}
Parameters
| Field | Required | Description |
|---|---|---|
participants | Mandatory | Array of participant objects |
participants[].user | Mandatory | Participant phone number or WhatsApp user ID. Up to 8 participants per request. Exotel trims the value but does not check its format. |
Expected Response
| HTTP | Notes |
|---|---|
200 | Request accepted. WhatsApp's result is returned as-is in response.data, with group_id added. |
Removal is processed by WhatsApp. Check the result with Get Group or the group_participants_update event (see Group Events). Removed users can no longer post in the group.
Delete Group
Delete the group on WhatsApp (all participants are removed) and mark it DELETED. Remaining participants see that the group is no longer available. A deleted group cannot be used again; later calls with its group_id return 404 / 1036.
DELETE /v2/accounts/{account_sid}/whatsapp/groups/{group_id}
Expected Response
| HTTP | Notes |
|---|---|
200 | Success. response.data is the group (same fields as a List item) with status: DELETED. |
404 | Unknown or already deleted group (1036) |
409 | Group exists but is not ACTIVE (1037) |
Send Messages to a Group
Send WhatsApp messages to a group using the standard Messages API:
- Set
toto the WhatsAppgroup_idandcontent.recipient_typetogroup. frommust be the business number that created the group.- The group must be
ACTIVEand belong to your account. - Do not set
recipient.
content.recipient_type accepts individual (default when omitted) or group; any other value returns 400 / 1002.
POST /v2/accounts/{account_sid}/messages
Group Template Content Object (Utility)
{
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "order-utility",
"messages": [
{
"from": "+919876500001",
"to": "<group_id>",
"content": {
"recipient_type": "group",
"type": "template",
"template": {
"name": "order_confirmation",
"language": {
"code": "en_US"
},
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Rahul" },
{ "type": "text", "text": "ORD-12345" }
]
}
]
}
}
}
]
}
}
Group Template Content Object (Marketing)
{
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "promo-marketing",
"messages": [
{
"from": "+919876500001",
"to": "<group_id>",
"content": {
"recipient_type": "group",
"type": "template",
"template": {
"name": "simple_promo_test",
"language": {
"code": "en"
}
}
}
}
]
}
}
Group Text Content Object (Free-form)
{
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "group-text",
"messages": [
{
"from": "+919876500001",
"to": "<group_id>",
"content": {
"recipient_type": "group",
"type": "text",
"text": {
"body": "Hello group — your order has been shipped."
}
}
}
]
}
}
Message Parameters
| Field | Required | Description |
|---|---|---|
whatsapp.status_callback | Optional | URL for delivery status callbacks |
whatsapp.custom_data | Optional | Opaque string echoed in callbacks |
messages[].from | Mandatory | Business WhatsApp number that created the group |
messages[].to | Mandatory | WhatsApp group_id |
messages[].content.recipient_type | Mandatory | Must be group |
messages[].content.type | Mandatory | template, text, image, video, audio, document or sticker. interactive, location, contacts and reaction are not supported for groups. |
messages[].content.template restrictions | — | Not supported for groups: carousel templates; template buttons of type copy_code, catalog, mpm, spm, flow, order_details or voice_call; interactive template parameters (action / limited-time offer). |
messages[].content.template | Conditional | Required when type is template |
messages[].content.text.body | Conditional | Required when type is text |
messages[].content.<media type> | Conditional | Media object (same as for individual messages) when type is image, video, audio, document or sticker |
Invite via Messages API (alternative)
You can also send a group invite template through the Messages API as a normal 1:1 template (phone number in to, no recipient_type) with a group_id body parameter. The group_id must not be empty, must be an ACTIVE group in your account, and from must be the number that created it.
{
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "group-invite",
"messages": [
{
"from": "+919876500001",
"to": "+919876543210",
"content": {
"type": "template",
"template": {
"name": "group_invite_link_concise",
"language": {
"code": "en"
},
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Order updates" },
{ "type": "text", "text": "Acme" },
{ "type": "group_id", "group_id": "<group_id>" }
]
}
]
}
}
}
]
}
}
Expected Response
The response has the same format as for individual messages. The HTTP status (and top-level http_code) is 202 when every message is accepted, 207 when some are accepted and some fail, and the first message's error code when all fail.
Request checks reject the whole request with 400: missing to, recipient set, unsupported content.type, interactive / location / contacts / reaction content, carousel or blocked template buttons, interactive template parameters, and an invalid content.recipient_type. Group checks are reported per message in response.whatsapp.messages[].
| HTTP | Code | description |
|---|---|---|
400 | 1001 | to (group_id) is mandatory for group messages |
400 | 1002 | recipient is not supported for group messages |
400 | 1002 | content.type not supported for group messages; allowed: text, image, video, audio, document, sticker, template |
400 | 1002 | interactive, location, contacts and reaction content are not supported for group messages |
400 | 1002 | carousel templates are not supported for group messages / template button <type> is not supported for group messages / interactive template parameters are not supported for group messages |
400 | 1002 | content.recipient_type must be individual or group |
400 | 1002 | to is not an active WhatsApp group in your account (or template group_id ... for invites) — per message |
400 | 1002 | from must be the number that created the group — per message |
400 | 1002 | template group_id parameter is empty — per message |
403 | 1038 | WhatsApp groups are not enabled for this account — per message |
403 | 1016 | Whatsapp number doesn't exist in your account — per message |
500 | 1004 | Unable to verify the group — per message; retry |
The Send Message API has its own error code numbering. Codes 1001, 1002 and 1038 mean the same thing as in the Group APIs; other numbers differ.
Template messages can be sent anytime. Free-form messages (text and media) require an open 24-hour window (a participant must have posted in the group).
Group Status Callbacks
Status callbacks for a group send use the same format as individual messages, with these differences:
tois not present.recipient_typeisgroupandgroup_idis the WhatsApp group.SENTis reported once for the group, without participant fields.DELIVEREDandREADare reported per participant.recipient_participant_idis the participant's phone number,recipient_participant_user_idis the participant's WhatsApp user ID andrecipient_participant_parent_user_idis the participant's parent user ID (each when WhatsApp provides it). WhatsApp can omit the phone number, so userecipient_participant_user_idto identify the participant.template_categoryis the WhatsApp pricing category of the group message:group_marketing,group_utilityorgroup_service. Free-form text and media messages also get agroup_*category.- The message's own status moves forward once (sent → delivered → read), not once per participant.
- Expect up to 1 + (2 × participants) callbacks per group message. De-duplicate on
sid+recipient_participant_id(orrecipient_participant_user_id) + status.
{
"whatsapp": {
"messages": [
{
"callback_type": "dlr",
"sid": "2FdiiEQUosckPhpZfuVwfjxiSlc16a4",
"recipient_type": "group",
"group_id": "<group_id>",
"recipient_participant_id": "919876543210",
"recipient_participant_user_id": "<participant_user_id>",
"exo_status_code": 30002,
"exo_detailed_status": "EX_MESSAGE_DELIVERED",
"description": "Message delivered",
"timestamp": "2026-11-30T10:30:05.000+05:30",
"custom_data": "Order12",
"template_category": "group_utility"
}
]
}
}
If the send fails before it reaches participants, one failure callback is sent for the group, without participant fields:
{
"whatsapp": {
"messages": [
{
"callback_type": "dlr",
"sid": "2FdiiEQUosckPhpZfuVwfjxiSlc16a4",
"recipient_type": "group",
"group_id": "<group_id>",
"exo_status_code": 30012,
"exo_detailed_status": "EX_INVALID_RECIPIENT",
"description": "Group not found or the business is not a member",
"timestamp": "2026-11-30T10:30:05.000+05:30",
"custom_data": "Order12"
}
]
}
}
WhatsApp errors specific to groups map to these Exotel statuses. Other WhatsApp errors map as for individual messages (see Status Codes).
| WhatsApp code | exo_status_code | exo_detailed_status | Type | Description |
|---|---|---|---|---|
131020 | 30012 | EX_INVALID_RECIPIENT | Permanent | Cannot send messages to single-member groups |
131041 | 30012 | EX_INVALID_RECIPIENT | Permanent | Group not found or the business is not a member |
131207 | 30043 | EX_RESTRICTED_BY_META | Permanent | Group suspended — violates platform policies |
131208 | 30009 | EX_RATE_LIMIT_HIT | Temporary | Too many group operations from this number in a short period |
131047 | 30018 | EX_REENGAGEMENT_ERROR | Permanent | Free-form message sent outside the 24-hour customer service window; send a template instead |
Inbound Group Messages
Messages that participants post in the group are delivered to the same incoming-message webhook as your 1:1 inbound messages, with group_id added. from is the participant who posted the message and to is your business number.
{
"whatsapp": {
"messages": [
{
"callback_type": "incoming_message",
"sid": "<message_sid>",
"from": "919876543210",
"to": "+919876500001",
"group_id": "<group_id>",
"profile_name": "Asha",
"timestamp": "2026-11-30T10:35:00+05:30",
"content": {
"type": "text",
"text": { "body": "Thanks, got it." }
}
}
]
}
}
1:1 inbound messages never carry group_id, and inbound group messages do not carry recipient_type. Use group_id to tell them apart.
Group Events
Group events from WhatsApp are forwarded to your WhatsApp business webhook URL in WhatsApp's webhook format, with a top-level waba_number (your business number) added. Each event type is forwarded only once it is enabled for your WhatsApp Business Account; contact Exotel support with the event types you need.
| Event field | groups[].type values | When |
|---|---|---|
group_lifecycle_update | group_create, group_delete | Group created (with group_id and invite_link) or create failed (with errors); group deleted |
group_participants_update | group_participants_add, group_participants_remove, group_join_request_created, group_join_request_revoked | Participant joined, left or was removed; join request created or cancelled |
group_settings_update | group_settings_update | Subject, description or profile picture changed |
group_status_update | group_suspend, group_suspend_cleared | Group suspended by WhatsApp, or its suspension cleared |
Match the request_id of a group_create event to the request_id returned by Create Group. For payload details, see Meta Groups API. WhatsApp user IDs (user_id, parent_user_id) and usernames are not forwarded in group events.
Billing and Reports
- Group messages (templates and free-form) are priced by WhatsApp's group pricing categories:
group_marketing,group_utilityandgroup_service, charged per participant the message is delivered to. The category is reported in the status callbacktemplate_category. - Message reports show one row per participant the message was delivered to.
- Invites sent with Send Group Invite are ordinary 1:1 template messages and are billed and reported as such.
Code Examples
Create Group
- cURL
- Python
- JavaScript
- PHP
- Go
curl -u '<api_key>:<api_token>' \
-X POST "https://api.exotel.com/v2/accounts/<account_sid>/whatsapp/groups" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-updates-2026-11-30-001" \
-d '{
"from": "+919876500001",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required"
}'
import requests
import json
payload = {
"from": "+919876500001",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required",
}
response = requests.post(
"https://api.exotel.com/v2/accounts/<account_sid>/whatsapp/groups",
auth=("<api_key>", "<api_token>"),
headers={
"Content-Type": "application/json",
# Reuse the same key when you retry this create.
"Idempotency-Key": "order-updates-2026-11-30-001",
},
data=json.dumps(payload),
)
print(response.json())
const apiKey = '<api_key>';
const apiToken = '<api_token>';
const accountSid = '<account_sid>';
const url = `https://api.exotel.com/v2/accounts/${accountSid}/whatsapp/groups`;
const payload = {
from: '+919876500001',
subject: 'Order updates',
description: 'Customer order notifications',
join_approval_mode: 'approval_required',
};
const response = await fetch(url, {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from(`${apiKey}:${apiToken}`).toString('base64'),
'Content-Type': 'application/json',
// Reuse the same key when you retry this create.
'Idempotency-Key': 'order-updates-2026-11-30-001',
},
body: JSON.stringify(payload),
});
const data = await response.json();
console.log(data);
<?php
$payload = json_encode(array(
"from" => "+919876500001",
"subject" => "Order updates",
"description" => "Customer order notifications",
"join_approval_mode" => "approval_required"
));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_USERPWD => "<api_key>:<api_token>",
CURLOPT_URL => "https://api.exotel.com/v2/accounts/<account_sid>/whatsapp/groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
// Reuse the same key when you retry this create.
"Idempotency-Key: order-updates-2026-11-30-001"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.exotel.com/v2/accounts/<account_sid>/whatsapp/groups"
payload := strings.NewReader(`{
"from": "+919876500001",
"subject": "Order updates",
"description": "Customer order notifications",
"join_approval_mode": "approval_required"
}`)
req, _ := http.NewRequest("POST", url, payload)
req.SetBasicAuth("<api_key>", "<api_token>")
req.Header.Add("Content-Type", "application/json")
// Reuse the same key when you retry this create.
req.Header.Add("Idempotency-Key", "order-updates-2026-11-30-001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Send Text to a Group
- cURL
- Python
- JavaScript
- PHP
- Go
curl -u '<api_key>:<api_token>' \
-X POST "https://api.exotel.com/v2/accounts/<account_sid>/messages" \
-H "Content-Type: application/json" \
-d '{
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "group-text",
"messages": [{
"from": "+919876500001",
"to": "<group_id>",
"content": {
"recipient_type": "group",
"type": "text",
"text": { "body": "Hello group — your order has been shipped." }
}
}]
}
}'
import requests
import json
payload = {
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "group-text",
"messages": [{
"from": "+919876500001",
"to": "<group_id>",
"content": {
"recipient_type": "group",
"type": "text",
"text": {"body": "Hello group — your order has been shipped."},
},
}],
}
}
response = requests.post(
"https://api.exotel.com/v2/accounts/<account_sid>/messages",
auth=("<api_key>", "<api_token>"),
headers={"Content-Type": "application/json"},
data=json.dumps(payload),
)
print(response.json())
const apiKey = '<api_key>';
const apiToken = '<api_token>';
const accountSid = '<account_sid>';
const url = `https://api.exotel.com/v2/accounts/${accountSid}/messages`;
const payload = {
whatsapp: {
status_callback: 'https://example.com/whatsapp/callback',
custom_data: 'group-text',
messages: [{
from: '+919876500001',
to: '<group_id>',
content: {
recipient_type: 'group',
type: 'text',
text: { body: 'Hello group — your order has been shipped.' },
},
}],
},
};
const response = await fetch(url, {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from(`${apiKey}:${apiToken}`).toString('base64'),
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});
const data = await response.json();
console.log(data);
<?php
$payload = json_encode(array(
"whatsapp" => array(
"status_callback" => "https://example.com/whatsapp/callback",
"custom_data" => "group-text",
"messages" => array(array(
"from" => "+919876500001",
"to" => "<group_id>",
"content" => array(
"recipient_type" => "group",
"type" => "text",
"text" => array("body" => "Hello group — your order has been shipped.")
)
))
)
));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_USERPWD => "<api_key>:<api_token>",
CURLOPT_URL => "https://api.exotel.com/v2/accounts/<account_sid>/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.exotel.com/v2/accounts/<account_sid>/messages"
payload := strings.NewReader(`{
"whatsapp": {
"status_callback": "https://example.com/whatsapp/callback",
"custom_data": "group-text",
"messages": [{
"from": "+919876500001",
"to": "<group_id>",
"content": {
"recipient_type": "group",
"type": "text",
"text": { "body": "Hello group — your order has been shipped." }
}
}]
}
}`)
req, _ := http.NewRequest("POST", url, payload)
req.SetBasicAuth("<api_key>", "<api_token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Send Group Invite
- cURL
- Python
- JavaScript
curl -u '<api_key>:<api_token>' \
-X POST "https://api.exotel.com/v2/accounts/<account_sid>/whatsapp/groups/<group_id>/invites" \
-H "Content-Type: application/json" \
-d '{
"from": "+919876500001",
"to": ["+919876543210", "+919811122233"],
"template": {
"name": "group_invite_link_concise",
"language": "en",
"body_parameters": ["Order updates", "Acme"],
"group_id_position": 3
}
}'
import requests
import json
payload = {
"from": "+919876500001",
"to": ["+919876543210", "+919811122233"],
"template": {
"name": "group_invite_link_concise",
"language": "en",
"body_parameters": ["Order updates", "Acme"],
"group_id_position": 3,
},
}
response = requests.post(
"https://api.exotel.com/v2/accounts/<account_sid>/whatsapp/groups/<group_id>/invites",
auth=("<api_key>", "<api_token>"),
headers={"Content-Type": "application/json"},
data=json.dumps(payload),
)
print(response.json())
const apiKey = '<api_key>';
const apiToken = '<api_token>';
const accountSid = '<account_sid>';
const groupId = '<group_id>';
const url = `https://api.exotel.com/v2/accounts/${accountSid}/whatsapp/groups/${groupId}/invites`;
const payload = {
from: '+919876500001',
to: ['+919876543210', '+919811122233'],
template: {
name: 'group_invite_link_concise',
language: 'en',
body_parameters: ['Order updates', 'Acme'],
group_id_position: 3,
},
};
const response = await fetch(url, {
method: 'POST',
headers: {
'Authorization': 'Basic ' + Buffer.from(`${apiKey}:${apiToken}`).toString('base64'),
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});
const data = await response.json();
console.log(data);
Group status lifecycle
| Status | Meaning |
|---|---|
PENDING | Create accepted; waiting for WhatsApp to confirm. No group_id or invite_link yet. |
ACTIVE | Group exists on WhatsApp. group_id available; invite, join-request, and send APIs work. |
FAILED | WhatsApp rejected the create, or did not confirm it within about 30 minutes (rarely up to 24 hours). Create a new group with a new Idempotency-Key. |
DELETED | Deleted via the API or on WhatsApp. Not listed; endpoints return 404 / 1036. |
POST /groups ──► PENDING ──(WhatsApp confirms)──► ACTIVE ──(DELETE)──► DELETED
│
└──(reject / no confirmation ~30 min)──► FAILED
Error Codes
Group API errors. For errors on group sends through the Messages API, see Send Messages to a Group.
| HTTP | Code | When |
|---|---|---|
401 | 1014 | Missing / invalid authentication |
403 | 1009 | Authentication failed, or message sending not allowed for this account (invites) |
403 | 1006 | Account inactive |
403 | 1007 | Account KYC not completed |
400 | 1001 | Mandatory parameter missing (e.g. from or subject on create) |
400 | 1002 | Invalid parameter (e.g. subject > 128 chars, description > 2048, Idempotency-Key > 128 chars, limit outside 1–100) |
400 | 1003 | WhatsApp rejected the request; error_data.description has WhatsApp's reason |
400 | 1004 | Request body is not valid JSON, or is empty on an endpoint that needs a body (remove participants, join requests, invites). An empty create body returns 1001. |
429 | 1011 | Too many requests (Exotel or WhatsApp rate limit, including "Too many group create requests."); retry later |
415 | 1016 | Unexpected response from WhatsApp |
500 | 1010 | Internal error; retry, and contact support if it persists |
404 | 1021 | Number not found, not in your account, or not fully configured |
422 | 1033 | Number is not on the WhatsApp Cloud API |
422 | 1034 | Number is not an Official Business Account (OBA) |
422 | 1035 | 10,000 non-deleted group limit reached for this number |
404 | 1036 | Unknown or deleted group_id |
409 | 1037 | Group exists but is not ACTIVE |
403 | 1038 | WhatsApp Groups is not enabled for this account |
409 | 1039 | Idempotency-Key already used with a different from or subject |
502 | 1040 | Upstream (WhatsApp) unavailable; safe to retry with the same Idempotency-Key |
Typical Flow
- Create Group with an
Idempotency-Key→ receivePENDING+ Exotelid - List Groups (
status=PENDING/ACTIVE/FAILED) and match byiduntilACTIVE(usegroup_id) orFAILED(stop; create again with a new key) - Send Group Invite (and/or share Get Invite Link)
- Participants join (approve via Join Requests if
approval_required) - Send Messages to a Group (templates anytime; free-form after a participant message)
- Optionally Reset Invite Link, Remove Participants, or Delete Group
Adding participants directly (users join through the invite link or an invite template), and updating the group subject, description or picture through the API.