ListGroups
client.groups.list(GroupListParams { token, pageSize, filter, pagination } params, RequestOptionsoptions?): GroupsPage<Group { id, createdAt, description, 6 more } >
POST/gitpod.v1.GroupService/ListGroups
Lists groups with optional pagination.
Use this method to:
- View all groups in an organization
- Check group memberships
- Monitor group configurations
- Audit group access
Examples
-
List all groups:
Shows all groups with pagination.
pagination: pageSize: 20 -
List with custom page size:
Shows groups with specified page size.
pagination: pageSize: 50 token: "next-page-token-from-previous-response"
Authorization
All organization members can list groups (transparency model).
ListGroups
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const group of client.groups.list({ pagination: { pageSize: 20 } })) {
console.log(group.id);
}{
"groups": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"directShare": true,
"memberCount": 0,
"name": "xxx",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"systemManaged": true,
"updatedAt": "2019-12-27T18:11:19.117Z"
}
],
"pagination": {
"nextToken": "nextToken"
}
}Returns Examples
{
"groups": [
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"description": "description",
"directShare": true,
"memberCount": 0,
"name": "xxx",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"systemManaged": true,
"updatedAt": "2019-12-27T18:11:19.117Z"
}
],
"pagination": {
"nextToken": "nextToken"
}
}