CreateGroup
groups.create(GroupCreateParams**kwargs) -> GroupCreateResponse
POST/gitpod.v1.GroupService/CreateGroup
Creates a new group within an organization.
Use this method to:
- Create teams for access control
- Organize users by department or function
- Set up role-based access groups
Examples
-
Create a basic group:
Creates a group with name and description.
organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" name: "Backend Team" description: "Backend engineering team"
Authorization
Requires org:admin role on the organization.
CreateGroup
import os
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
group = client.groups.create(
description="Backend engineering team",
name="Backend Team",
organization_id="b0e12f6c-4c67-429d-a4a6-d9838b5da047",
)
print(group.group){
"group": {
"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"
}
}Returns Examples
{
"group": {
"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"
}
}