Skip to main content
Docs

deleteOrganizationMembership()

Removes a user from the specified organization. Returns a OrganizationMembership object.

function deleteOrganizationMembership(
  params: DeleteOrganizationMembershipParams,
): Promise<OrganizationMembership>
  • Name
    organizationId
    Type
    string
    Description

    The ID of the organization the user will be removed from.

  • Name
    userId
    Type
    string
    Description

    The ID of the user to be removed from the organization.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const organizationId = 'org_123'

const userId = 'user_123'

const response = await clerkClient.organizations.deleteOrganizationMembership({
  organizationId,
  userId,
})

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint DELETE/organizations/{organization_id}/memberships/{user_id}. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on