Optionaloptions: GetProjectsOptionsOptional filtering and pagination parameters
Request parameters for getting projects
Optionalpage?: numberPage number (1-indexed, default: 1)
Optionallimit?: numberProjects per page (1-500, default: 100)
OptionaluserIds?: string[]Filter by user IDs
OptionalisManager?: booleanManager view (shows shared projects)
Optionalsearch?: stringSearch projects by name
OptionalsortBy?: "name" | "date" | "fileCount"Sort by field (name, date, or fileCount)
OptionalsortOrder?: "asc" | "desc"Sort order
OptionalincludeFiles?: booleanInclude file details in response
Promise resolving to ProjectsResponse
import { getDocumentProjects } from "@cpod/sdk";
// Get first page of projects
const { projects, total, totalPages } = await getDocumentProjects();
// Search with pagination
const results = await getDocumentProjects({
search: "quarterly",
page: 2,
limit: 10,
sortBy: "date",
sortOrder: "desc",
});
for (const project of results.projects) {
console.log(`${project.name}: ${project.fileCount} files`);
}
Get projects with file counts and optional file details
Retrieves projects accessible to the user with pagination, search, and sorting.