forums.create()

This method allows you to create a new public forum with the specified members and the current user.

If you are creating a private group, please use client.groups.create() instead.

Definition

client.forums.create(
options: ?Object
):Promise<Group,Error>

Parameters

ParameterTypeDescription
options?ObjectOptions (described below)

Options

ParameterTypeDescription
avatarFileFileAn avatar file object
description?stringThe forum description
memberIdsArray<string|User>A list of user models or user IDs to add to the forum once it is created
metadata?ObjectOptional metadata for the forum
namestringThe forum name
organizationIdstringThe organization in which the forum should be created
replayHistory?boolIndicates whether replay history is desired (default: true for forums)
senderId?stringID of the role or user who is creating the forum (default: current user)

Returns

An error will be thrown if any of the arguments are invalid.

Otherwise, once the returned Promise is resolved, you will have access to the newly created forum, which is a Group object.

Example

const forum = await client.forums.create({
organizationId: 'some-org-id',
name: 'New forum name',
memberIds: [
'some-user-id-1',
'some-user-id-2',
'some-user-id-3'
]
});
console.log(
'created new forum:',
forum.displayName,
'with members',
forum.members
.map(function(user) {
return user.displayName;
})
.join(', ')
);