# Invites ## CreateOrganizationInvite `client.Organizations.Invites.New(ctx, body) (*OrganizationInviteNewResponse, error)` **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 OrganizationInviteNewParams` - `OrganizationID param.Field[string]` ### Returns - `type OrganizationInviteNewResponse struct{…}` - `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 ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) invite, err := client.Organizations.Invites.New(context.TODO(), gitpod.OrganizationInviteNewParams{ OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", invite.Invite) } ``` #### Response ```json { "invite": { "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## GetOrganizationInviteSummary `client.Organizations.Invites.GetSummary(ctx, body) (*OrganizationInviteGetSummaryResponse, error)` **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 OrganizationInviteGetSummaryParams` - `InviteID param.Field[string]` ### Returns - `type OrganizationInviteGetSummaryResponse struct{…}` - `OrganizationID string` - `OrganizationMemberCount int64` - `OrganizationName string` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Organizations.Invites.GetSummary(context.TODO(), gitpod.OrganizationInviteGetSummaryParams{ InviteID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.OrganizationID) } ``` #### Response ```json { "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "organizationMemberCount": 0, "organizationName": "organizationName" } ``` ## GetOrganizationInvite `client.Organizations.Invites.Get(ctx, body) (*OrganizationInviteGetResponse, error)` **post** `/gitpod.v1.OrganizationService/GetOrganizationInvite` GetOrganizationInvite ### Parameters - `body OrganizationInviteGetParams` - `OrganizationID param.Field[string]` ### Returns - `type OrganizationInviteGetResponse struct{…}` - `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 ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) invite, err := client.Organizations.Invites.Get(context.TODO(), gitpod.OrganizationInviteGetParams{ OrganizationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", invite.Invite) } ``` #### Response ```json { "invite": { "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } } ``` ## Domain Types ### Organization Invite - `type OrganizationInvite struct{…}` - `InviteID string` invite_id is the unique identifier of the invite to join the organization. Use JoinOrganization with this ID to join the organization.