Skip to main content
Docs

getOrganization()

Retrieves a single Organization.

function getOrganization(params: GetOrganizationParams): Promise<Organization>
  • Name
    organizationId | slug
    Type
    string
    Description

    The ID of the organization to retrieve, or the slug of the organization to retrieve.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const organizationId = 'org_123'

const response = await clerkClient.organizations.getOrganization({ organizationId })

Retrieve by slug

Retrieve an organization by its slug instead of its ID.

const slug = 'my-organization-slug'

const response = await clerkClient.organizations.getOrganization({ slug })

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on