ListGroups
groups.list(GroupListParams**kwargs) -> SyncGroupsPage[Group]
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 os
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
page = client.groups.list(
pagination={
"page_size": 20
},
)
page = page.groups[0]
print(page.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"
}
}