groups.addMembers()

Add members to a group.

Definition

client.groups.addMembers(
groupId: string|Group,
memberIds: Array<string|User>,
):Promise<void,Error>

Parameters

ParameterTypeDescription
groupIdstring|GroupThe group ID or group model
memberIdsArray<string|User>The user IDs or user models

Returns

An error will be thrown if the operation failed, otherwise the Promise will resolve.

Example

await client.groups.addMember(
'some-group-id',
['some-user-id-1', 'some-user-id-2']
);
console.log('added members');