CreateOrganization
client.organizations.create(OrganizationCreateParams { name, inviteAccountsWithMatchingDomain, joinOrganization } body, RequestOptionsoptions?): OrganizationCreateResponse { organization, member }
POST/gitpod.v1.OrganizationService/CreateOrganization
Creates a new organization with the specified name and settings.
Use this method to:
- Create a new organization for team collaboration
- Set up automatic domain-based invites for team members
- Join the organization immediately upon creation
Examples
-
Create a basic organization:
Creates an organization with just a name.
name: "Acme Corp Engineering" joinOrganization: true -
Create with domain-based invites:
Creates an organization that automatically invites users with matching email domains.
name: "Acme Corp" joinOrganization: true inviteAccountsWithMatchingDomain: true
CreateOrganization
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const organization = await client.organizations.create({
name: 'Acme Corp Engineering',
joinOrganization: true,
});
console.log(organization.organization);{
"organization": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"tier": "ORGANIZATION_TIER_UNSPECIFIED",
"updatedAt": "2019-12-27T18:11:19.117Z",
"inviteDomains": {
"domains": [
"sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"
]
}
},
"member": {
"email": "email",
"fullName": "fullName",
"loginProvider": "loginProvider",
"memberSince": "2019-12-27T18:11:19.117Z",
"role": "ORGANIZATION_ROLE_UNSPECIFIED",
"status": "USER_STATUS_UNSPECIFIED",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"avatarUrl": "avatarUrl"
}
}Returns Examples
{
"organization": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"tier": "ORGANIZATION_TIER_UNSPECIFIED",
"updatedAt": "2019-12-27T18:11:19.117Z",
"inviteDomains": {
"domains": [
"sfN2.l.iJR-BU.u9JV9.a.m.o2D-4b-Jd.0Z-kX.L.n.S.f.UKbxB"
]
}
},
"member": {
"email": "email",
"fullName": "fullName",
"loginProvider": "loginProvider",
"memberSince": "2019-12-27T18:11:19.117Z",
"role": "ORGANIZATION_ROLE_UNSPECIFIED",
"status": "USER_STATUS_UNSPECIFIED",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"avatarUrl": "avatarUrl"
}
}