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
Name | Type | Required | Description |
---|---|---|---|
id | string | Yes | The 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
Name | Type | Required | Description |
---|---|---|---|
accountId | string | Yes | The ID of the account to add to the group |
groupId | string | Yes | The ID of the group to add the account to |
role | GroupRole | Yes | The 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
Name | Type | Required | Description |
---|---|---|---|
accountId | string | Yes | The ID of the account to remove from the group |
groupId | string | Yes | The ID of the group to remove the account from |
role | GroupRole | Yes | The 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' });