The cStar API is a REST API that lets you manage tickets, customers, and articles programmatically. This page gets you from zero to your first successful API call.

Grab Your API Key

API Keys and Team ID

  1. Open Settings → Team → API Keys in your cStar dashboard.
  2. Copy your Secret Key (starts with sk_live_ or sk_test_).
  3. Store it securely. Treat it like a database password.

You also get a Publishable Key (starts with pk_live_ or pk_test_). Publishable keys can't call the team API, even for reads. On the public Library API they only choose test or live data.

Make Your First Request

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

You should get back a JSON response with your tickets. If you get a 401, double-check the key.

Authentication

Every request needs a Bearer token in the Authorization header:

Authorization: Bearer sk_live_your_secret_key
Key Type Prefix Access Where to Use
Secret sk_live_ / sk_test_ Full CRUD (read, write, delete) Server-side only
Publishable pk_live_ / pk_test_ Library API only (team API returns 403) Client-side OK

Public Library API (No Key Required)

The Library API is open. No API key needed. Use it for custom help centers, knowledge base widgets, or SEO-friendly article pages.

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

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

// Get a single article by slug
const article = await fetch('https://www.cstar.help/api/library/YOUR_TEAM/articles/how-to-reset-password');

// Record a view (useful for analytics)
await fetch('https://www.cstar.help/api/library/YOUR_TEAM/articles/how-to-reset-password/view', {
  method: 'POST'
});

// Submit feedback
await fetch('https://www.cstar.help/api/library/YOUR_TEAM/articles/how-to-reset-password/feedback', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ isHelpful: true })
});

The Library API accepts both your team UUID and team slug in the URL path. Article content comes back as stored: usually Markdown (sometimes with backslash escapes), and HTML for some imported articles. Use a renderer like marked to convert to HTML.

Response Envelope

Responses to API-key requests share this structure (public Library API reads skip meta and add a mode field):

{
  "success": true,
  "data": { ... },
  "meta": {
    "requestId": "req_3f9a0c2b7d1e4a56",
    "timestamp": "2026-03-30T10:00:00Z"
  }
}

Errors follow a Stripe-style shape:

{
  "success": false,
  "error": {
    "type": "authentication_error",
    "code": "authentication_required",
    "message": "Missing or invalid Authorization header. Expected: Bearer <api_key>",
    "doc_url": "https://www.cstar.help/developers/errors#authentication_required",
    "request_id": "req_3f9a0c2b7d1e4a56"
  }
}

The meta.requestId is useful when contacting support.

Prefixed IDs

cStar uses Stripe-style prefixed IDs for tickets, customers, articles, messages, and webhooks. Some resources, like article categories and community posts, use plain UUIDs:

Resource Prefix Example
Ticket tkt_ tkt_a1B2c3D4e5F6
Customer cus_ cus_x9Y8z7W6v5U4
Article art_ art_m3N4o5P6q7R8
Message msg_ msg_j2K3l4M5n6O7
Webhook whk_ whk_d8E9f0G1h2I3

Single-resource endpoints (/tickets/{ticketId}, /customers/{customerId}, /articles/{articleId}) accept both prefixed IDs and UUIDs. In list filters, tag is an exact text match, customerId takes a cus_ ID or a UUID, and assignedTo needs a UUID.

API Versioning

The API uses date-based versioning via the CStar-Version header. When omitted, you get the latest version. The current version is 2026-03-01.

curl https://www.cstar.help/api/v1/teams/{teamId}/tickets \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "CStar-Version: 2026-03-01"

Rate Limits at a Glance

Key Type Limit
Secret Key 1,000 requests/hour
Publishable Key 100 requests/hour

The public Library API dedupes a visitor's views of an article for an hour, takes one feedback vote per visitor per article (3 per network per article a day), and logs up to 30 searches a minute per visitor. Reads have no app-level limit.

See API Rate Limits for details on handling 429 responses.

CStarChat JavaScript SDK

For chat widget functionality, load the SDK:

<script src="https://www.cstar.help/cstar.js?team=YOUR_TEAM_SLUG"></script>

Chat methods (like open and send) work everywhere. Knowledge base search, signup and login need Custom Mode (your page has data-cstar-launcher or data-cstar-panel, and identity verification is off):

const results = await CStarChat.searchArticles('webhook', 5);
const stats = await CStarChat.getLibraryStats();

What to Read Next