Group Type
Group chats are represented by theGroup type:
Fields
Snowflake Chat ID - Unique identifier for this group chat
Display name of the group chat
Whether the current user is the owner of this group. Only the owner can update settings and remove members
Array of Snowflake User IDs representing all members of the group chat
CreateChat
Create a new group chat with specified users and a name.Parameters
Array of user references to add as initial participants in the group chat. You can specify users by ID or username
Display name for the group chat
Response
Returns atypes.Group object representing the newly created group chat. The creator automatically becomes the owner.
Notes
- The creating user is automatically added as a participant and becomes the owner
- All specified users are added immediately without requiring acceptance
- Group chat IDs are Snowflakes generated server-side
UpdateChat
Update settings for an existing group chat. Only the owner can update group settings.Parameters
Reference to the group chat to update
New display name for the group chat. If not provided, the name remains unchanged
Response
Returns achats.Chat object with the updated group information:
Permissions
- Only the group owner (
owner = true) can update the group chat - Attempting to update a group you don’t own will result in an error
RemoveChatMember
Remove a participant from a group chat. Only the owner can remove members.Parameters
Reference to the group chat
Snowflake User ID of the member to remove from the group
Response
Returns empty on success.Permissions
- Only the group owner can remove members
- Users can remove themselves (leave the group) regardless of ownership
- Removing the last member may delete the group
Adding Members
Members can be added to an existing group chat through invites. See the Conversations page for information on creating and managing chat invites.Group Chat Workflow
Creating a Group
- Call
CreateChatwith initial participants and a name - Server creates the group and assigns you as owner
- Receive the
Groupobject with the new group ID - All participants receive a notification about the new group
Managing Participants
- Add members: Create a chat invite with
CreateChatInvite - Remove members: Call
RemoveChatMemberwith the user’s ID - Leave group: Call
RemoveChatMemberwith your own user ID - View members: Access
participant_idsin theGroupobject
Updating Settings
- Call
UpdateChatwith the group’sChatRef - Provide new values for fields you want to change
- Omit fields that should remain unchanged
- Only the owner can perform updates
Group vs Direct Messages
| Feature | Direct Message | Group Chat |
|---|---|---|
| Participants | 2 users | 2+ users |
| Name | Derived from participants | Custom name |
| Ownership | No owner | Has owner |
| Member management | N/A | Owner can add/remove |
| Settings | Per-user only | Group-level settings |
| Invites | Not needed | Can create invites |
Related
- Direct Messages - One-on-one conversations
- Conversations - Read states and chat invites
- Communities - Structured group spaces with channels and roles