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('cat_billing');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('cat_billing', { sortOrder: 1 });
// Make a category internal-only
await cstar.categories.update('cat_drafts', { isPublic: false });Delete
Deleting a category leaves its articles intact — they just lose their category assignment.
delete.js
await cstar.categories.delete('cat_archived');