Create a conversation group
Create a conversation group and optionally add one conversation at the same time.
Use createConversationGroup() to create a conversation group for the signed-in user. A normal group requires at least a name. Pass conversationID to place one conversation into the group immediately.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Group name. |
order | number | No | Group ordering value. Define the sort direction consistently in the product. |
ex | string | No | Application-defined group extension string. |
conversationID | string | No | Conversation ID to add immediately after creating the group. |
conversationGroupType | ConversationGroupType | No | Group type. Explicitly use ConversationGroupTypeNormal for a normal custom group. |
import { ConversationGroupType } from '@openim/wasm-client-sdk';
const { data: group } = await openimsdk.createConversationGroup({
name: 'Work',
order: 100,
conversationID,
conversationGroupType: ConversationGroupType.ConversationGroupTypeNormal,
});Return result
After the Promise succeeds, data is the new ConversationGroup. Use its conversationGroupID, name, and conversationIDs to update the current interface immediately. See Get conversation groups for complete fields.
After the creation request completes, another signed-in client or a later synchronization may receive OnConversationGroupAdded. Event delivery is not the same as Promise completion. See Conversation group overview for the complete listener and merge flow.
Was this page helpful?