## LeaveOrganization `client.organizations.leave(OrganizationLeaveParamsbody, RequestOptionsoptions?): OrganizationLeaveResponse` **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. ```yaml userId: "f53d2330-3795-4c5d-a1f3-453121af9c60" ``` Note: Ensure all projects and resources are transferred before leaving. ### Parameters - `body: OrganizationLeaveParams` - `userId: string` ### Returns - `OrganizationLeaveResponse = unknown` ### 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.leave({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60', }); console.log(response); ``` #### Response ```json {} ```