Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

Organization Methods

These are all methods on the Clerk class that allow you to create, modify, or read information about Organizations.

getOrganization()

function getOrganization(organizationId: string): Promise<Organization | undefined>;

The getOrganization method is used to get the information of an organization programatically.

Properties

NameTypeDescription
organizationIdstringThe ID of the organization to be found.

Returns

TypeDescription
Promise<Organization | undefined>This method returns a Promise which resolves to the requested Organization.

createOrganization()

function createOrganization({name, slug}: CreateOrganizationParams): Promise<Organization>;

The createOrganization method is used to create an organization programatically.

Properties

NameTypeDescription
namestringThe name of the organization to be created.
slug?stringThe optional slug of the organization to be created.

Returns

TypeDescription
Promise<[Organization][org-ref>This method returns a Promise which resolves to the newly created Organization.

getOrganizationMemberships()

function getOrganizationMemberships(): Promise<OrganizationMembership[]>;

Get a list of all organizations your current user is a part of in the form of an array of OrganizationMemberships.

Returns

TypeDescription
Promise<OrganizationMembership[]>This method returns a Promise which resolves to the list of OrganizationMemberships for the current user.

Last updated on October 10, 2023

What did you think of this content?

Clerk © 2023