Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

Organization

This is a class that represents an organization. It's returned from the createOrganization and getOrganization methods on the Clerk class instance.

Properties

NameTypeDescription
idstringThe unique identifier of the related organization.
namestringThe name of the related organization.
slugstring | nullThe organization slug. If supplied, it must be unique for the instance.
logoUrlstring | nullThe full URL for the organization logo. (deprecated in favor of imageUrl)
imageUrlstringHolds the organization logo or default logo
membersCountnumberThe number of members the associated organization contains
pendingInvitationsCountnumberThe number of pending invitations to users to join the organization.
publicMetadataobjectAdditional information about the organization that can be read through the Frontend API, but written only from the Backend API.
createdAtDateDate of the time the organization was created.
updatedAtDateDate of the last time the user was updated.

Methods

update()

function update(params: UpdateOrganizationParams): Promise<Organization>;

Updates an organization's attributes.

UpdateOrganizationParams

NameTypeDescription
namestringThe organization name.
slugstring | undefinedThe organization slug.

Returns

TypeDescription
Promise<Organization>This method returns a Promise which resolves to an Organization.

destroy()

function destroy(): Promise<void>;

Deletes the organization. Only administrators can delete an organization.

Please note that deleting an organization will also delete all memberships and invitations. This is not reversible.

Returns

TypeDescription
Promise<void>This method returns a Promise which doesn't resolve to any value.
function setLogo(params: SetOrganizationLogoParams): Promise<Organization>;

Sets or replaces an organization's logo. Accept the logo as a file or blob. The logo must be an image and its size cannot exceed 10MB.

SetOrganizationLogoParams

NameTypeDescription
fileFile | Blob | nullAn image file which cannot exceed 10MB. Passing null will delete the organization's current logo.

Returns

TypeDescription
Promise<Organization>This method returns a Promise which resolves to an Organization.

Additional methods

In addition to the methods listed above, the Organization class also has the following methods:

Members

Invitations

What did you think of this content?

Clerk © 2023