Skip to content
Ona Docs

LeaveOrganization

client.Organizations.Leave(ctx, body) (*OrganizationLeaveResponse, error)
POST/gitpod.v1.OrganizationService/LeaveOrganization

Removes a user from an organization while preserving organization data.

Use this method to:

  • Remove yourself from an organization
  • Clean up inactive memberships
  • Transfer project ownership before leaving
  • Manage team transitions

Examples

  • Leave organization:

    Removes user from organization membership.

    userId: "f53d2330-3795-4c5d-a1f3-453121af9c60"

Note: Ensure all projects and resources are transferred before leaving.

ParametersExpand Collapse
body OrganizationLeaveParams
UserID param.Field[string]
formatuuid
ReturnsExpand Collapse
type OrganizationLeaveResponse interface{…}

LeaveOrganization

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.Leave(context.TODO(), gitpod.OrganizationLeaveParams{
    UserID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{}
Returns Examples
{}