Skip to main content

updateOrganizationMembership()

Updates a user's OrganizationMembership.

Returns the updated OrganizationMembership object.

function updateOrganizationMembership(params: CreateOrganizationMembershipParams): Promise<OrganizationMembership>
  • Name
    organizationId
    Type
    string
    Description

    The ID of the Organization the user is being added to.

  • Name
    role
    Type
    OrganizationCustomRoleKey
    Description

    The Role to assign to the user.

  • Name
    userId
    Type
    string
    Description

    The ID of the user to be added to the Organization.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const organizationId = 'org_123'
const userId = 'user_123'
const role = 'org:admin'

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

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on