# Invites ## CreateOrganizationInvite `client.organizations.invites.create(InviteCreateParamsbody, RequestOptionsoptions?): InviteCreateResponse` **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. ```yaml organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" ``` ### Parameters - `body: InviteCreateParams` - `organizationId: string` ### Returns - `InviteCreateResponse` - `invite: OrganizationInvite` - `inviteId: string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. ### Example ```typescript 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); ``` #### Response ```json { "invite": { "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## GetOrganizationInviteSummary `client.organizations.invites.getSummary(InviteGetSummaryParamsbody, RequestOptionsoptions?): InviteGetSummaryResponse` **post** `/gitpod.v1.OrganizationService/GetOrganizationInviteSummary` Retrieves organization details and membership info based on an invite link. Use this method to: - Preview organization details before joining - Validate invite link authenticity - Check organization size and activity - View team information before accepting ### Examples - Get invite summary: Retrieves organization information from an invite. ```yaml inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body: InviteGetSummaryParams` - `inviteId: string` ### Returns - `InviteGetSummaryResponse` - `organizationId: string` - `organizationMemberCount?: number` - `organizationName?: string` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const response = await client.organizations.invites.getSummary({ inviteId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68', }); console.log(response.organizationId); ``` #### Response ```json { "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "organizationMemberCount": 0, "organizationName": "organizationName" } ``` ## GetOrganizationInvite `client.organizations.invites.retrieve(InviteRetrieveParamsbody, RequestOptionsoptions?): InviteRetrieveResponse` **post** `/gitpod.v1.OrganizationService/GetOrganizationInvite` GetOrganizationInvite ### Parameters - `body: InviteRetrieveParams` - `organizationId: string` ### Returns - `InviteRetrieveResponse` - `invite: OrganizationInvite` - `inviteId: string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. ### Example ```typescript 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.retrieve({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(invite.invite); ``` #### Response ```json { "invite": { "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## Domain Types ### Organization Invite - `OrganizationInvite` - `inviteId: string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. ### Invite Create Response - `InviteCreateResponse` - `invite: OrganizationInvite` - `inviteId: string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization. ### Invite Get Summary Response - `InviteGetSummaryResponse` - `organizationId: string` - `organizationMemberCount?: number` - `organizationName?: string` ### Invite Retrieve Response - `InviteRetrieveResponse` - `invite: OrganizationInvite` - `inviteId: string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization.