Getting Started with the cStar API

Make your first API call in under 5 minutes. Get your key, hit an endpoint, see results.

Get Your API Key

  1. Go to SettingsAPI Keys in your cStar dashboard
  2. Copy your Secret Key (starts with sk_)
  3. Keep it safe — treat it like a password

You also have a Publishable Key (starts with pk_) for client-side use. It has read-only access.

Your First API Call

curl https://cstar.help/api/v1/teams/YOUR_TEAM_ID/tickets \
  -H "Authorization: Bearer sk_your_secret_key"

That's it. You'll get a JSON response with your tickets.

Authentication

Every API request requires a Bearer token in the Authorization header:

Authorization: Bearer sk_your_secret_key
Key Type Prefix Access Use From
Secret sk_ Full CRUD Server only
Publishable pk_ Read only Client OK

Public Library API (No Auth Required)

The Library API is public — no API key needed. Perfect for building custom support pages, knowledge bases, or help widgets.

// Search articles
const res = await fetch('https://cstar.help/api/library/YOUR_TEAM/search?q=billing&limit=5');
const { data } = await res.json();

// Get all categories
const cats = await fetch('https://cstar.help/api/library/YOUR_TEAM/categories');

// Get a single article
const article = await fetch('https://cstar.help/api/library/YOUR_TEAM/articles/api-authentication');

Note: The Library API accepts both your team UUID and team slug in the URL path.

Note: Article content is returned as markdown. Convert to HTML using a library like marked before rendering.

CStarChat JavaScript SDK

For chat widget functionality, load the SDK:

<script src="https://cstar.help/widget/chat.js?team=YOUR_TEAM"></script>

The SDK provides methods for everything — auth, conversations, messages, and even knowledge base search:

// Search articles from the SDK (no separate API call needed)
const results = await CStarChat.searchArticles('webhook', 5);

// Get library stats
const stats = await CStarChat.getLibraryStats();
console.log(stats.articles + ' articles, ' + stats.views + ' total reads');

Server-Side Rendering (SSR)

The Library API works from any server — SvelteKit, Next.js, Nuxt, Express. Fetch articles at build time or request time for full SEO:

// In your server-side loader (SvelteKit, Next.js, etc.)
const res = await fetch('https://cstar.help/api/library/YOUR_TEAM/articles/getting-started');
const { data: article } = await res.json();
// Render the article HTML in your template — Google sees the full content

Rate Limits

Key Type Limit
Secret Key 1,000 requests/hour
Publishable Key 100 requests/hour
Library API (public) 200 requests/hour per IP

Response Format

All responses follow a consistent envelope:

{
  "success": true,
  "data": { ... }
}

Errors return:

{
  "success": false,
  "error": "Description of what went wrong"
}

Next Steps