Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.dev

OrganizationMembership

The relationship between users and organizations.

Overview

The OrganizationMembership object is the model around an organization membership entity.

Attributes

NameTypeDescription
idstring

A unique identifier for this organization membership.

publicMetadataobject

Custom metadata that are visible to the frontend.

roleMembershipRole

The role of the current user in the organization.

publicUserDataPublicUserData

Public information about the user that this membership belongs to.

organizationOrganizationResource

The organization object the membership belongs to.

createdAtDate

Date of the time the membership was created.

updatedAtDate

Date of the last time the membership was updated.

Methods

destroy()

destroy()=>Promise<void>Deletes the membership from the organization it belongs to.

update(params)

updateMember(params: UpdateOrganizationMembershipParams) =>Promise<OrganizationMembershipResource>

Updates the membership. For now only role can be changed.

Parameters

NameTypeDescription
roleMembershipRole

The role of the new member.

Returns

NameTypeDescription
<OrganizationInvitationResource>Promise

This method returns a Promise which resolves to the OrganizationMembershipResource for the updated membership.

Was this helpful?

Clerk © 2022