CreateGroup
client.groups.create(GroupCreateParams { description, name, organizationId } body, RequestOptionsoptions?): GroupCreateResponse { group }
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 Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const group = await client.groups.create({
description: 'Backend engineering team',
name: 'Backend Team',
organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047',
});
console.log(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"
}
}