Create a group
- iMessage
Start a group chat with an opening message
Creates a group chat and sends its first message in one operation. iMessage has no concept of an empty group, so the opening message is required.
Once the group exists it is a conversation too. A message someone
writes in it arrives under the group's own conversationId, with
isGroup: true; on that id you can send into the group,
rename it or change its members with group.update, and
leave it with group.leave.
Honors Idempotency-Key: a retry under the same key returns the first command,
so a retried group.create never makes a second group.
Body
Target
Prop
Type
Mapier reads each participant the way the channel reads an address (a phone
number to E.164, an email lower-cased) and checks the list before anything is
sent. The first participant is read first: the command's line is the one that
person is on. A participant that is refused, the first included, is reported
at the list's own field (the one you wrote, participantExternalIds or
participants) and its index. Each refusal is
422 validation_failed, the line's channel in the entry:
- a participant the channel cannot read, at
target.participantExternalIds[i](ortarget.participants[i]); - any participant, the first included, that is an email with a control
character in it, over 512 characters or not in composed Unicode (NFC), at
target.participantExternalIds[i](ortarget.participants[i]); - fewer than 2 or more than 32 people once a repeat — the same person written
two ways — is counted once, at
target.participantExternalIds(ortarget.participants).
A first participant who opted out, is blocked or is paused is
403 recipient_not_allowed, with details.reason saying which, as a send to
them would be.
Payload
Prop
Type
Example request
curl https://api.mapier.ai/v1/commands/group.create \
-H "Authorization: Bearer $MAPIER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: create-trip-planning-group" \
-H "x-mapier-version: 2026-12-01" \
-d '{
"target": {
"kind": "new_group",
"channel": "imessage",
"participantExternalIds": ["+14155550100", "+14155550111"]
},
"payload": { "firstMessage": "kickoff" }
}'Retry under the same Idempotency-Key. A new key is a new command, and a new group.create
makes a second group. If a group.create times out, wait for the result on the stream before
deciding whether to retry.
Response
{
"commandId": "0192b3e2-92c4-75a8-86d9-b4f172a3e598",
"status": "queued",
"repeated": false,
"lineId": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d",
"lineSelection": "reused_active_chat"
}A succeeded command event names the new group: conversationId is its id,
and group carries the same id. A conversation.created of kind: "group"
announces it too. Keep the id: it is the target.conversationId that sends
into the group.
{
"commandId": "0192b3e2-92c4-75a8-86d9-b4f172a3e598",
"logicalActionId": "0192b3e2-92c4-75a8-86d9-b4f172a3e598",
"status": "succeeded",
"errorCode": null,
"conversationId": "a0000000-0000-4000-8000-000000000002",
"failureClass": null,
"group": { "conversationId": "a0000000-0000-4000-8000-000000000002" }
}whatsapp.group.create
Makes a new group on a WhatsApp line. Only a number Meta has made an Official
Business Account can make one, and the command is accepted only on a number
Mapier has confirmed is one: on any other it is
404 unsupported_command with
reason: not_on_line, and nothing is written. GET /v1/whoami lists it among
a line's capabilities once the number is confirmed. Nobody is added: people
join by the group's invite link, which the result carries.
Honors Idempotency-Key.
Target
Address the line at target.lineId. target.participants is a
422 validation_failed at that field.
Payload
| Field | |
|---|---|
subject | Required. The group's name, 1 to 128 characters. |
description | Optional. The group's description, up to 2,048 characters. |
Request
curl -X POST https://api.mapier.ai/v1/commands/whatsapp.group.create \
-H "Authorization: Bearer $MAPIER_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: launch-group-1" \
-H "x-mapier-version: 2026-12-01" \
-d '{
"target": { "lineId": "0192a7b0-3e4f-7051-8c6d-7e8f9a0b1c2d" },
"payload": { "subject": "Launch day" }
}'Result
The answer is a 202, and the command ends when WhatsApp reports the group:
succeeded, withgroup: { conversationId, inviteLink }on thecommandevent and onGET /v1/commands/{commandId}, and aconversation.createdofkind: groupfor the new conversation. Send into it by thatconversationId, and send the invite link to the people who should join. The link works for 90 days; keep it.failedwithgroups_not_eligible: Meta refused the group; the number cannot use groups.ambiguouswithgroup_create_unconfirmed: WhatsApp did not confirm the group in time.
Sent to a line of another channel, the type is
404 unsupported_command
with reason: not_on_channel.
Errors
Every command can return the errors listed under How commands work › Errors. Specific to this command:
- No participants is
422 validation_failedattarget.participants, before a line is resolved; a participant list the channel cannot take is refused as above, before anything is sent. firstMessageempty or over 16,384 bytes:422 validation_failed, reasoninvalid_text.- On a test line on a shared number,
404 unsupported_commandwithreason: shared_lineunless group chats are turned on for your organization. Once they are, 2 to 10 people who are all this project's connected Test contacts, or403 recipient_not_allowedwithgroup_member_not_test_contact(orrecipient_must_write_firstfor a member who must text first). Sent again under itsIdempotency-Key, the same people are the same group, never a second one, and other people are409 conflictwithidempotency_key_reused. See Groups on a test line.
Result codes you will see for this command: gateway_rejected when iMessage
refuses the group.
group_content_unverified is not a failure: its command event ends
ambiguous, and it means the line could not confirm the group was created,
not that it was not. A blind retry there makes a second group. See
Groups.