Browse SDKs · WASM
SDKsWASMEnterprise

Create a conversation group

Create a conversation group and optionally add one conversation at the same time.

Copy

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

ParameterTypeRequiredDescription
namestringYesGroup name.
ordernumberNoGroup ordering value. Define the sort direction consistently in the product.
exstringNoApplication-defined group extension string.
conversationIDstringNoConversation ID to add immediately after creating the group.
conversationGroupTypeConversationGroupTypeNoGroup 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.