groups.destroy()

This method allows you to delete a group.

Definition

client.groups.destroy(
id: string|Group
):Promise<void,Error>

Parameters

ParameterTypeDescription
idstring|GroupThe group ID or group model

Returns

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

Example

try {
await client.groups.destroy('some-group-id');
console.log('group deleted');
} catch (err) {
if (err.code === client.errors.NotFoundError.code) {
console.log('group not found');
} else {
console.log('error:', err);
}
}