getOrganizationList()
Gets the list of Organizations for the instance. By default, the list is returned in descending order by creation date (newest first).
Returns a PaginatedResourceResponse object with a data property containing an array of Organization objects and a totalCount property containing the total number of Organizations for the instance.
function getOrganizationList(params?: GetOrganizationListParams): Promise<PaginatedResourceResponse<Organization[]>>- Name
includeMembersCount?- Type
boolean- Description
Whether to include the number of members in the Organization.
- Name
orderBy?- Type
WithSign<"name" | "created_at" | "members_count">- Description
Filters Organizations in a particular order. Prefix a value with
+to sort in ascending order, or-to sort in descending order. Defaults to-created_at.
- Name
organizationId?- Type
string[]- Description
Filters Organizations by ID. Accepts up to 100 Organization IDs.
- Name
query?- Type
string- Description
Filters Organizations by ID, name, or slug. Uses exact match for ID and partial match for name and slug.
const response = await clerkClient.organizations.getOrganizationList()Limit the number of results
Gets a list of Organizations, limited to the specified number of results.
const { data, totalCount } = await clerkClient.organizations.getOrganizationList({
// returns the first 10 results
limit: 10,
})Skip results
Gets a list of Organizations, skipping the specified number of results.
const { data, totalCount } = await clerkClient.organizations.getOrganizationList({
// skips the first 10 results
offset: 10,
})Filter by query
Gets a list of Organizations that match the query.
// returns organizations that have 'test' in their name
const { data, totalCount } = await clerkClient.organizations.getOrganizationList({ query: 'test' })Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint GET/organizations. See the BAPI reference for more information.
Feedback
Last updated on