Categories
Categories group articles for nav and filtering. Each one carries a name, slug, optional icon and color, a sort order, and a public/internal flag.
List
list.js
const { data } = await cstar.categories.list({
isPublic: true, // Only categories that show up in the public KB
page: 1,
pageSize: 50
}); Get
get.js
const category = await cstar.categories.get('550e8400-e29b-41d4-a716-446655440040'); Create
create.js
const category = await cstar.categories.create({
name: 'Billing',
description: 'Invoices, refunds, plans, payment methods.',
icon: 'credit-card',
color: '#7c3aed',
sortOrder: 2,
isPublic: true
}); Update + reorder
update.js
// Reorder by setting sortOrder; lower numbers come first
await cstar.categories.update('550e8400-e29b-41d4-a716-446655440040', { sortOrder: 1 });
// Make a category internal-only
await cstar.categories.update('550e8400-e29b-41d4-a716-446655440041', { isPublic: false }); Delete
Deleting a category leaves its articles intact. They just lose their category assignment.
delete.js
await cstar.categories.delete('550e8400-e29b-41d4-a716-446655440042');