im.groups covers iMessage group-only operations: display names, participants, group icons, leaving, and group events.
Group methods use the group chat’s chat.guid. If you only have email addresses or phone numbers, create the group first with im.chats.create(...).
Direct chats cannot use group APIs. Shared chat features, such as chat creation, read state, typing, and chat backgrounds, are documented under chats.
What You Can Do
| Need | Use this when |
|---|---|
| Rename a group | You want to change the group display name |
| Add participants | You want to invite new email addresses or phone numbers |
| Remove participants | You want to remove existing group members |
| Set an icon | You want to use image bytes as the group avatar |
| Download an icon | You need the current custom group avatar |
| Remove an icon | You want to clear the custom group avatar |
| Leave a group | The current account should leave the group |
| Subscribe to events | You need live group name, participant, or icon changes |
Group Chat GUIDs
Except forsubscribeEvents(...), which takes an optional { chat } filter, group methods take the group chat.guid as their first argument.
Create or fetch a group chat first:
group.guid to group operations:
any;+;group-id. Do not pass email addresses, phone numbers, or direct-chat GUIDs to group methods.
Rename
Chat. The display name is trimmed and must not be empty after trimming.
Add Participants
Chat.
| Input | Rule |
|---|---|
chat | Group chat.guid |
addresses | Non-empty array; each item must be a full email address or E.164 phone number |
Remove Participants
Chat.
| Input | Rule |
|---|---|
chat | Group chat.guid |
addresses | Non-empty array; each item must already be a participant |
Group Icons
Group icons use raw image bytes. They are not attachment GUIDs, and you do not upload them throughim.attachments first.
Set an Icon
void. data must not be empty. The server detects the image type from the bytes. PNG, JPEG, GIF, HEIC, and HEIF are supported.
Download an Icon
GroupIcon:
getIcon(...) throws NotFoundError, with error.code === ErrorCode.groupIconNotFound.
Remove an Icon
void. Removing an icon is safe to repeat, even when no custom icon is set.
Leave a Group
void.
Group write methods accept optional
{ clientMessageId } for idempotent retries from your job system. Most direct calls can omit it. See error handling for details.Group Events
subscribeEvents(...) returns TypedEventStream<GroupEvent>. Use the stream to observe changes made by other people, other devices, or another part of your system. Immediately after your code calls a write method, use that method’s Chat result or completion status.
Scope
Only one group:Outer Event
Every group event hastype: "group.changed". The outer fields answer which group changed, who triggered it, and when:
Change Types
event.change.type tells you what changed. Each type carries different fields:
event.change.type | Meaning | Extra fields |
|---|---|---|
displayNameChanged | The group was renamed | displayName |
participantAdded | A participant joined | participant |
participantRemoved | A participant was removed | participant |
participantLeft | A participant left on their own | participant |
iconChanged | The group icon was set or replaced | None |
iconRemoved | The group icon was cleared | None |
Handle Events
Switch onevent.change.type. When you subscribe to one group, you do not need to check chatGuid again:
event.chatGuid to identify the group:
Next Steps
- Chats — create a group chat and get
chat.guid - Messages — send messages, attachments, and reactions in a group chat
- Events — catch up on durable events after a disconnect
- Error Handling — handle
NotFoundError,ValidationError, and idempotent retries