Skip to main content

getUserCategories()

getUserCategories(userId: string, options?: ListCategoriesOptions): Promise<ListCategoriesResponse>

Defined in: packages/core/src/index.ts:1204

Get categories assigned to a specific user

Parameters

ParameterTypeDescription
userIdstringThe unique identifier of the user
options?ListCategoriesOptions-

Returns

Promise<ListCategoriesResponse>

Array of category objects assigned to the user

Throws

401 - Not authenticated

Throws

404 - User not found

Example

import { getUserCategories } from "@cpod/sdk";

const userCategories = await getUserCategories("user-123");
console.log(`User belongs to ${userCategories.length} categories`);
userCategories.forEach(cat => console.log(cat.name));