Skip to content
Ona Docs

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.

    organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
ParametersExpand Collapse
body OrganizationInviteNewParams
OrganizationID param.Field[string]
formatuuid
ReturnsExpand Collapse
type OrganizationInviteNewResponse 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.

formatuuid

CreateOrganizationInvite

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)
}
{
  "invite": {
    "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}
Returns Examples
{
  "invite": {
    "inviteId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}