Skip to content
Ona Docs

CreateOrganizationInvite

client.organizations.invites.create(InviteCreateParams { organizationId } body, RequestOptionsoptions?): InviteCreateResponse { invite }
POST/gitpod.v1.OrganizationService/CreateOrganizationInvite

Creates an invite link for joining an organization. Any existing OrganizationInvites are invalidated and can no longer be used.

Use this method to:

  • Generate shareable invite links
  • Manage team growth
  • Control organization access

Examples

  • Create organization invite:

    Generates a new invite link for the organization.

    organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
ParametersExpand Collapse
body: InviteCreateParams { organizationId }
organizationId: string
formatuuid
ReturnsExpand Collapse
InviteCreateResponse { invite }
invite: OrganizationInvite { inviteId }
inviteId: string

invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization.

formatuuid

CreateOrganizationInvite

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const invite = await client.organizations.invites.create({
  organizationId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047',
});

console.log(invite.invite);
{
  "invite": {
    "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}
Returns Examples
{
  "invite": {
    "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}