Skip to main content

Articles

Knowledge-base CRUD. Articles can be drafts or published, internal or public, and grouped under categories. Markdown content, full-text search, view + use counters baked in.

List

list.js
const { data } = await cstar.articles.list({
  status: 'published',
  isPublic: true,
  category: 'cat_billing',
  search: 'reset password',
  tag: 'auth',
  page: 1,
  pageSize: 20
});

isPublic filters between articles your customers can see and internal-only ones visible to agents. status separates drafts from published.

Get

get.js
const article = await cstar.articles.get('art_abc123');
console.log(article.content);   // Markdown body
console.log(article.viewCount); // Counter incremented by the public widget

Create

create.js
const article = await cstar.articles.create({
  title: 'How to reset your password',
  slug: 'reset-password',                  // Optional — auto-generated if omitted
  excerpt: 'A quick walk-through of the reset flow.',
  content: '## Step 1\n\nClick "Forgot password"...',  // Markdown
  categoryId: 'cat_account',
  status: 'published',                     // 'draft' | 'published' (default 'draft')
  isPublic: true,                          // Visible in the public KB
  tags: ['auth', 'self-serve'],
  metaDescription: 'Walk through resetting your password in three steps.'
});

Update + publish

update.js
// Promote a draft to published
await cstar.articles.update('art_abc123', { status: 'published' });

// Update content + meta in one call
await cstar.articles.update('art_abc123', {
  content: updatedMarkdown,
  metaDescription: refreshedDescription
});

Delete

delete.js
await cstar.articles.delete('art_abc123');

Public reads without an API key

For end-customer surfaces — your help center, an embedded search widget — use LibraryClient instead. No API key, scoped to one team's published public articles.

Article type

Next up