Retrieve an organization
Load a known organization before displaying its details or using its organization methods.
Clerk · Interface
OrganizationResource is Clerk’s client-side object type for an organization. It is returned by organization retrieval and creation methods and can be used as the active-organization value.
OrganizationResource is the client-side Organization object returned by Clerk when an organization is fetched or created. It represents an organization resource that can also be supplied when setting the active organization.
function getOrganization(organizationId: string): Promise<OrganizationResource>
function createOrganization(params: CreateOrganizationParams): Promise<OrganizationResource>| Name | Type | Description |
|---|---|---|
organizationId | string | Identifier of the organization to retrieve. |
params | CreateOrganizationParams | Creation options for the organization. |
OrganizationResource for organization retrieval or creation.
import { clerk } from '@clerk/...?'
const organization = clerk.organization
if (organization) {
console.log(organization.id)
}Reads the currently active organization resource when one is available.
Load a known organization before displaying its details or using its organization methods.
Create a tenant for a newly onboarded customer and retain the returned organization resource.
Select the current tenant using an already loaded resource rather than another lookup.
OrganizationResource is the object type returned for a Clerk organization resource. Clerk exposes it through organization-related APIs such as getOrganization and createOrganization.
Follow-up: How can an active organization be cleared? Pass null as the organization value when calling the client’s active-session setter.
getOrganization accepts an organization identifier and resolves to a Promise of OrganizationResource. The result is the organization object that the client can use for organization operations.
Follow-up: What input forms can be used when setting an active organization? The documented value may be null, an organization ID or slug string, or an OrganizationResource object.
The Clerk organization shortcut is tied to the last active organization membership on the session user. It can therefore be undefined or null when no usable session organization exists.
Follow-up: What is the difference between clearing and selecting? Clearing uses null; selecting can use an ID, slug, or resource object.
OrganizationCreateOrganizationParamsgetOrganizationcreateOrganizationsetActiveorganizationMemberships