Skip to content
Ona Docs

LeaveOrganization

organizations.leave(OrganizationLeaveParams**kwargs) -> object
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
user_id: str
formatuuid
ReturnsExpand Collapse
object

LeaveOrganization

import os
from gitpod import Gitpod

client = Gitpod(
    bearer_token=os.environ.get("GITPOD_API_KEY"),  # This is the default and can be omitted
)
response = client.organizations.leave(
    user_id="f53d2330-3795-4c5d-a1f3-453121af9c60",
)
print(response)
{}
Returns Examples
{}