Skip to main content

Groups

Description

Groups allow you to organize and manage collections of accounts with different roles and permissions.

Methods

create

Creates a new group

Props

No required properties.

Returns

Group - The created group object

Example

const group = await client.groups.create();

delete

Deletes an existing group

Props

NameTypeRequiredDescription
idstringYesThe ID of group to delete

Returns

void

Example

await client.groups.delete({ id: '123' });

accounts.add

Adds an account to a group with a specified role

Props

NameTypeRequiredDescription
accountIdstringYesThe ID of the account to add to the group
groupIdstringYesThe ID of the group to add the account to
roleGroupRoleYesThe role to assign to the account in the group

Note: GroupRole can be one of: 'owner', 'maintainer', or 'member'

Returns

void

Example

await client.groups.accounts.add({ accountId: '123', groupId: '456', role: 'owner' });

accounts.remove

Removes an account from a group

Props

NameTypeRequiredDescription
accountIdstringYesThe ID of the account to remove from the group
groupIdstringYesThe ID of the group to remove the account from
roleGroupRoleYesThe role of the account to remove from the group

Note: GroupRole can be one of: 'owner', 'maintainer', or 'member'

Returns

void

Example

await client.groups.accounts.remove({ accountId: '123', groupId: '456', role: 'owner' });