Error Reference

Same shape every time: machine-readable code, human-readable message, and a doc_url that lands you back on this page. Below: every error you can hit, why it fires, and the fix.

Error response shape
{
  "success": false,
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_missing",
    "message": "The 'title' field is required.",
    "param": "title",
    "doc_url": "https://www.cstar.help/developers/errors#parameter_missing",
    "request_id": "req_abc123"
  }
}

Error Types

Every error falls into one of five top-level types. The type field tells you the category, while code gives you the specific error.

authentication_error

API key is missing, invalid, expired, or doesn't have the right permissions.

invalid_request_error

The request has invalid parameters, missing fields, bad JSON, or conflicts.

not_found_error

The resource you're trying to access doesn't exist.

rate_limit_error

You've exceeded the rate limit for your API key type.

api_error

Something went wrong on our end. These are rare and usually transient.

Authentication Errors

authentication_required 401

Missing or invalid Authorization header.

Why this happens

  • You didn't include an Authorization header in your request
  • The header format is wrong (should be Bearer sk_live_xxx)
  • You accidentally included extra whitespace or newlines in the header
  • The route is session-only (the OpenAPI spec marks it so): it serves the signed-in dashboard and answers any API key with this code

How to fix it

bash
# Correct format
curl -H "Authorization: Bearer sk_live_your_key_here" \
  https://www.cstar.help/api/v1/teams/{teamId}/tickets

With the SDK (handles auth automatically)
import { CStarClient } from '@cstar.help/js';

const cstar = new CStarClient({ apiKey: 'sk_live_your_key_here', teamId: 'your-team-id' });
// Auth header is set automatically on every request

invalid_api_key 401

The API key provided is invalid or has been revoked.

Why this happens

  • The key was revoked from the dashboard or via cstar keys revoke
  • You're using a key from a different team or environment
  • The key was copied incorrectly (truncated or extra characters)

How to fix it

bash
# Check your current key status
cstar status

# List all valid keys
cstar keys list

# Create a new key if needed
cstar keys create --name "My App"

invalid_key_format 401

Invalid API key format.

Why this happens

  • The key doesn't start with a recognized prefix (sk_live_, sk_test_, pk_live_, pk_test_)
  • You might be passing an OAuth token or JWT instead of an API key

Valid key formats

sk_live_*Secret key, production and permitted staff operations
sk_test_*Secret key, test mode and permitted staff operations
pk_live_*Publishable key, live public customer SDKs
pk_test_*Publishable key, test public customer SDKs
insufficient_permissions 403

Your API key does not have permission for this operation.

Why this happens

  • The key was created with restricted scopes that don't include this resource
  • Your team role doesn't grant access to this operation
  • The teammate who created the key left the team, or their role can't do this (managing members, for example)
  • In the chat widget: the customer tried to change someone else's community post or comment

How to fix it

Check your key's permissions in the dashboard, or create a new key with the required scopes.

publishable_key_write 403

Publishable keys cannot change staff resources.

Why this happens

  • You're using a pk_live_ or pk_test_ key to create, update, or delete a resource
  • Publishable keys belong in public customer SDKs. Staff reads also require secret keys.

How to fix it

Use a secret key (sk_live_*) for staff operations. Keep secret keys on your server. Never expose them in frontend code.

Server-side: use secret key for writes
// Server-side only. Never expose sk_ keys in the browser
const cstar = new CStarClient({ apiKey: 'sk_live_your_secret_key', teamId: 'your-team-id' });

// This works with a secret key
await cstar.tickets.create({ title: 'New ticket' });

publishable_key_forbidden 403

This endpoint requires a secret key, even for reads.

Why this happens

  • You're using a pk_live_ or pk_test_ key to read a staff resource, such as tickets, customers or draft articles
  • The management API requires secret keys for reads. Public customer SDKs use separate endpoints that exclude staff data

How to fix it

Use a secret key (sk_live_* / sk_test_*) from a server-side context. Never expose secret keys in frontend code.

team_access_denied 403

Your API key does not have access to this team.

Why this happens

  • The teamId in the URL doesn't match the team the API key belongs to
  • You may have multiple teams and are using a key from the wrong one

How to fix it

bash
# Check which team your key belongs to
cstar status

# The teamId in your URL must match
# https://www.cstar.help/api/v1/teams/{THIS_TEAM_ID}/tickets

Chat Widget Identity Errors

These come from POST /api/widget/verify-identity and the widget routes that take its sessionToken. In test mode (testMode: true) the message names the exact cause. In live mode signature problems all read Verification failed, so use the code. The host page's CStarChat.on('error') handler gets the same { code, message }.

invalid_signature 401

The identity signature does not match.

Why this happens

  • The signature was made with a different key (live key with testMode: true, or the reverse)
  • The signed string differs from the one cStar builds: other fields, other key order, or spaces
  • Non-ASCII characters were escaped. Python's json.dumps escapes them unless you pass ensure_ascii=False
  • The digest is in uppercase hex (.NET's Convert.ToHexString gives that). Send it as 64 lowercase hex characters

How to fix it

Sign the UTF-8 bytes of compact JSON with the fields email, externalId, name (if set) and timestamp, in that order. In test mode the message shows the exact string to sign. Test Your Integration (Settings → Chat Widget) runs the same check as the widget and says what failed.

Python
payload = json.dumps(fields, separators=(',', ':'), sort_keys=True, ensure_ascii=False)
signature = hmac.new(secret.encode(), payload.encode('utf-8'), hashlib.sha256).hexdigest()

signature_expired 401

The identity timestamp is too old or too far in the future.

Why this happens

  • The signature is older than 5 minutes in live mode, or 1 hour in test mode
  • The timestamp is more than 60 seconds ahead of cStar's clock
  • The timestamp is in milliseconds instead of seconds

How to fix it

Sign on each page load, with Math.floor(Date.now() / 1000) or your language's Unix time in seconds. Don't cache signed identities. The widget checks the signature as soon as your page gives it, even while chat is closed, so the visitor can open chat any time during the 4-hour session that follows.

identity_not_enabled 400

Identity verification is off for this team, or has no key for this mode.

How to fix it

Turn on Customer Identity Verification under Settings → Chat Widget. That creates a live key and a test key.

invalid_session_token 401

The widget session token is not valid.

Why this happens

  • The token was changed or cut short
  • It belongs to a customer who was deleted, or to the other mode (test or live)

How to fix it

Verify the customer again with a fresh signature. The widget does this for you when your page listens for session:expired and passes a fresh signature to CStarChat.verifyIdentity(customer, signature, testMode).

session_expired 401

The widget session has expired.

How to fix it

Sessions last 4 hours. Verify the customer again with a fresh signature to get a new sessionToken: listen for session:expired and pass a new signature from your server to CStarChat.verifyIdentity(customer, signature, testMode). If you don't, the widget links to your Login Redirect URL, or without one shows a Refresh Page button that reloads your page so it signs again.

customer_not_found 401

No customer account for this sign-in.

Why this happens

  • The sign-in is valid, but the customer was deleted from the team
  • The customer signed in to another team's widget, not this one

How to fix it

Sign in again. The widget does this for you: it signs the customer out and shows the sign-in screen, so they can start fresh.

invalid_grant 400

This sign-in is no longer valid.

Why this happens

  • The refresh token sent to /api/widget/auth/token was already replaced, has expired or was signed out
  • The customer was removed from the team

How to fix it

Sign the customer in again. Every refused sign-in gets this same answer, so it never says which of these it was.

reauthentication_required 403

A password change needs fresher proof.

Why this happens

  • /api/widget/auth/password was asked to set a first password, and the customer's emailed sign-in link was used more than an hour ago
  • It was asked to change a password without currentPassword, and the link was used more than 15 minutes ago
  • currentPassword was sent and is wrong

How to fix it

Ask for the current password and send it as currentPassword. If the customer forgot it, send them a new sign-in link and set the password right after they use it.

Chat Widget Load Errors

When the chat cannot load, the floating widget says so in its panel, and your CStarChat.on('error') handler gets { code, message }. A page with its own data-cstar-* layout, or one where the chat script never ran, shows no panel but gets the code the same way, plus one console line saying why. Each failure fires the event once, so register your handler right after the snippet. These codes come from the widget script, not from an API response, so they have no HTTP status.

config_failed

The chat settings could not load.

Why this happens

  • The visitor is offline, or the network dropped the request to cStar
  • cStar answered with a server error

How to fix it

Nothing for your visitor beyond Try again on the panel, which asks for the settings again. If it keeps happening, check the request to /api/widget/config in your browser's network tab.

csp_blocked

Your site's Content-Security-Policy blocked the chat.

Why this happens

  • Your policy's connect-src (or default-src, when there is no connect-src) leaves out the cStar host, so the widget cannot reach its settings
  • Your policy's script-src admits the cstar.js tag but not the scripts it adds (a source pinned to one file)
  • Your policy's frame-src (or default-src) leaves out the cStar host, so the chat frame cannot open
  • Only an enforced policy counts. A Content-Security-Policy-Report-Only policy does not block, so a failure under it gets the code it would get with no policy: config_failed, script_failed or load_timeout

How to fix it

Add the cStar host to connect-src, script-src and frame-src. See Running a Content Security Policy. The browser console names the host and the directives to add. Older widget versions reported a connect-src block as config_failed, and a frame-src block as load_timeout.

load_timeout

The chat frame or script did not load within 15 seconds.

Why this happens

  • A slow or dropped connection

For a script your handler heard, it is final: one that arrives later does not start the chat, so your own fallback stays. With no handler, a slow script still starts the chat when it arrives. A chat frame that loads late still replaces the panel.

How to fix it

When the panel shows, its Try again loads the frame again. If it keeps happening, check the requests to cStar in your browser's network tab.

script_failed

A chat script did not load, and no Content-Security-Policy blocked it.

Why this happens

  • An ad blocker or privacy extension stopped chat.js or the widget module
  • The visitor is offline, or the network dropped the request

How to fix it

Nothing on your side when it is the visitor's blocker. Your handler can point them to another way to reach you. The console line names the script that did not load.

styles_blocked

The widget could not apply its styles, so it hides itself.

Why this happens

  • Your style-src blocks inline styles, and the browser cannot apply a constructed stylesheet either (older browsers)

How to fix it

Add 'unsafe-inline' to style-src.

team_not_found

No cStar team matches the team in your snippet.

Why this happens

  • The team value in the script src has a typo, or names a deleted team

How to fix it

Copy the snippet again from Settings > Install. Until then nothing loads, and CStarChat.open() logs a console line saying why it did nothing.

Invalid Request Errors

parameter_missing 400

A required parameter is missing.

Why this happens

  • A required field was not included in the request body
  • The field name is misspelled (e.g., tittle instead of title)
  • You sent the parameter as a query param instead of in the JSON body (or vice versa)

How to fix it

Check the param field in the error response. It tells you exactly which parameter is missing.

Error response tells you the missing field
{
  "error": {
    "code": "parameter_missing",
    "message": "The 'title' field is required.",
    "param": "title"
  }
}

Fix: include the required field
// Before (missing title)
await cstar.tickets.create({ priority: 'high' });

// After (title included)
await cstar.tickets.create({ title: 'Help needed', priority: 'high' });

parameter_invalid 400

A parameter has an invalid value.

Why this happens

  • A field value doesn't match the expected type (e.g., string where number expected)
  • An enum field has an invalid value (e.g., status: "done" when valid values are new, open, pending, resolved, closed)
  • The ID in the path of an update or delete is not a valid ID for that resource, such as PATCH /tickets/not-an-id (a read of the same path returns resource_not_found)

How to fix it

Check the param field and refer to the API reference for valid values.

Common fix: use valid enum values
// Before (invalid priority value)
await cstar.tickets.create({ title: 'Help', priority: 'super-urgent' });

// After (one of your team's priority keys, listed in the error's allowed field)
await cstar.tickets.create({ title: 'Help', priority: 'critical' });

message_too_long 400

Messages can be up to 10,000 characters.

Why this happens

  • A customer message sent through the chat widget API is longer than 10,000 characters (counted the way JavaScript's string.length counts them)

What to do

Shorten the message, or split it into more than one. Sending the same text again is refused the same way, so don't retry it unchanged.

invalid_json 400

The request body contains invalid JSON.

Why this happens

  • The JSON has a syntax error (missing comma, bracket, or quote)
  • You sent form-encoded data instead of JSON
  • The Content-Type header is missing or wrong

How to fix it

Make sure Content-Type is set and JSON is valid
curl -X POST \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"title": "Help needed"}' \
  https://www.cstar.help/api/v1/teams/{teamId}/tickets

Using the SDK? You never need to worry about this. The SDK handles JSON serialization and Content-Type headers automatically.

resource_conflict 409

A resource with this identifier already exists.

Why this happens

  • You're trying to create a resource with a unique field that already exists (e.g., duplicate email for a customer)
  • A webhook with the same URL and event combination already exists

How to fix it

Use a unique value, or update the existing resource with a PATCH request instead of creating a new one.

Update existing instead of creating duplicate
// Instead of creating a duplicate customer:
// await cstar.customers.create({ email: 'jane@example.com' });

// Find and update the existing one:
const { data } = await cstar.customers.list({ search: 'jane@example.com' });
if (data.length > 0) {
  await cstar.customers.update(data[0].id, { name: 'Jane Doe' });
}

idempotency_key_in_use 409

The Idempotency-Key has already been used for a different endpoint or method.

Why this happens

Idempotency keys are scoped to the exact request (method + endpoint). Reusing the same key across different endpoints (e.g. POST /customers and POST /tickets) is treated as a conflict so the original cached response cannot leak to the second call.

The same answer, with a Retry-After header, comes back while the first request with this key is still running, so two copies of one request never both write.

Adding a ticket message keeps the key as that message's receipt, so there a different message with the same key is this 409 (not idempotency_key_reused).

How to fix it

Generate a fresh idempotency key for each distinct request. Keys are safe to reuse only when replaying the exact same request to the exact same endpoint. If the response has Retry-After, wait that many seconds and send the same request again.

idempotency_key_reused 422

The Idempotency-Key was already used for a request with a different body.

Why this happens

A key stands for one request: same method, endpoint and body. Within 24 hours, sending it again with a different body is refused instead of replaying the first response for a request you didn't make.

How to fix it

Use a new key for each new request, and the same key only to retry the exact same one.

feature_disabled 403

This feature is turned off for the team.

Why this happens

  • The team turned off the feature this endpoint belongs to (Community, Tickets, Customers, Library or Gamification, for example)
  • Your key and team are fine: the message names the feature and its setting

How to fix it

An owner or admin turns the feature back on in the settings section the message names, such as Settings → Team Settings → Community. Retry once it is on.

comments_closed 403

Comments are closed on this post.

Why this happens

  • The post is locked
  • Comments are turned off on this post, or for the whole community

What to do

Nothing to retry. The team controls comments under Settings → Community, and per post in the dashboard.

webhook_limit_reached 409

The team has reached its webhook limit.

Why this happens

  • The team already has 50 webhooks in this key's mode (test or live)

What to do

Waiting won't help. Delete webhooks you no longer use, then create the new one.

storage_limit_reached 409

The team's storage is full.

Why this happens

  • Every file a team stores counts toward one budget: 5 GB plus 1 GB a seat, or 250 MB on a trial with no card
  • This upload would not fit in what is left

What to do

Waiting won't help. Delete files you no longer need, add a seat, or (on a trial) add a card in Billing.

method_not_allowed 405

The HTTP method is not allowed on this endpoint.

Why this happens

  • You sent a POST to a read-only endpoint, or a GET to a write-only one
  • The endpoint exists but doesn't support the verb you used

How to fix it

Check the allowed verbs in the Allow response header (the API sets it on every 405) or in the API Reference. Most collection endpoints accept GET and POST; most item endpoints accept GET, PATCH, and DELETE.

team_paused 402

This team is paused until it has an active subscription. Reads still work. Writes are refused.

Why this happens

  • The team's free trial ended, a payment failed, or the subscription was canceled
  • The team was created after its owner's one free trial, so it starts paused
  • A paused team keeps its data until its deletion date (90 days after billing paused it, or 7 days after the owner asks to delete it). Meanwhile it takes no new tickets, messages, customers or community posts through the API

What to do

  • GET requests and the export endpoints keep working, so you can pull every ticket, customer and article
  • DELETE /keys/{keyId} keeps working too, so a key that leaked can be revoked while the team is paused
  • With a secret key, GET /billing/subscription and GET /auth/whoami say paused: true and why in pausedReason (trial_ended, no_trial, payment_failed, canceled or payment_required). A publishable key's whoami leaves billing state out
  • The team owner can subscribe from the dashboard, and writes work again right away

Not Found Errors

resource_not_found 404

The requested resource was not found.

Why this happens

  • The resource ID doesn't exist (it may have been deleted)
  • The ID is not a valid ID for this resource (a typo, a cut-off ID, or another resource's prefix such as cus_ on a ticket path)
  • The ID is correct but belongs to a different team
  • You're using a test-mode key but the resource was created in live mode (or vice versa)

How to fix it

Verify the resource exists before operating on it
try {
  const { data } = await cstar.tickets.get('tkt_abc123');
  console.log(data);
} catch (err) {
  if (err.code === 'resource_not_found') {
    console.log('Ticket not found (it may have been deleted)');
  }
}

Make sure you're using the right environment. Resources created with sk_test_ keys are only visible with test keys, and vice versa.

route_not_found 404

No API endpoint exists at this URL.

Why this happens

  • The URL path is misspelled or uses the wrong resource name
  • You're missing a path segment (e.g. the team ID) or have an extra one
  • You're calling an endpoint that doesn't exist in the API

This differs from resource_not_found: that means the endpoint is valid but the specific record was not found; route_not_found means the endpoint itself does not exist.

How to fix it

Check the path against the API Reference. All V1 endpoints live under /api/v1/teams/{teamId}/….

Rate Limit Errors

rate_limit_exceeded 429

Too many requests.

Current limits

sk_live_* / sk_test_*1,000 requests per hour
pk_live_* / pk_test_*100 requests per hour

Rate limit headers

Every response includes these headers so you can track your usage:

X-RateLimit-LimitMax requests per window
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when window resets
Retry-AfterSeconds to wait (only on 429)

How to fix it

Implement exponential backoff
async function withRetry(fn, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await fn();
    } catch (err) {
      if (err.code === 'rate_limit_exceeded' && i < maxRetries - 1) {
        const delay = Math.pow(2, i) * 1000; // 1s, 2s, 4s
        console.log(`Rate limited. Retrying in ${delay}ms...`);
        await new Promise(r => setTimeout(r, delay));
      } else {
        throw err;
      }
    }
  }
}

Webhook deliveries do NOT count against your rate limit. You can receive unlimited webhooks without impacting your API quota.

Server Errors

internal_error 500

An unexpected error occurred on our end.

Why this happens

  • This is a bug on our side, not something you did wrong
  • These are rare and usually transient

What to do

  • Retry the request (most server errors are transient)
  • Include the request_id from the error response when contacting support
  • If it persists, email support@cstar.help with the request ID
database_error 500

A database error occurred while processing your request.

What to do

  • Wait a few seconds and retry (this is usually a transient issue)
  • If it keeps happening, the request_id will help us debug it
upstream_error 502

A service cStar depends on failed.

Why this happens

  • The AI model provider behind Quick Help didn't return an answer

What to do

  • Wait a moment and retry
  • If it keeps happening, send support the request_id
service_unavailable 503

This service is temporarily unavailable or not configured for your team.

Why this happens

  • An optional capability the endpoint depends on isn't set up yet (for example, the AI endpoints require an OpenRouter key under Settings → Team → AI Keys)
  • A dependency is briefly degraded

What to do

  • Check the error message: it names what's missing or unavailable
  • Quick Help errors also carry a reason, such as quickhelp_unavailable or quickhelp_no_team_key
  • If it's a configuration gap, finish the setup in your dashboard, then retry
  • If it's transient, wait a few seconds and retry

Handling Errors in Code

The cStar SDKs throw typed errors that you can catch and handle by code.

SDK error handling
import { CStarClient, CStarError } from '@cstar.help/js';

const cstar = new CStarClient({ apiKey: 'sk_live_xxx', teamId: 'your-team-id' });

try {
  await cstar.tickets.create({ priority: 'high' }); // missing title
} catch (err) {
  if (err instanceof CStarError) {
    switch (err.code) {
      case 'parameter_missing':
        console.log(`Missing field: ${err.param}`);
        break;
      case 'rate_limit_exceeded':
        console.log(`Retry after ${err.retryAfter} seconds`);
        break;
      case 'authentication_required':
        console.log('Check your API key');
        break;
      default:
        console.log(`API error: ${err.message}`);
    }
  }
}

network_error

The request got no answer from cStar.

Why this happens

  • The network dropped, DNS failed, or the request timed out (30 seconds by default)
  • The SDK sets this code itself, with statusCode 0 and no request_id, because no response came back

What to do

  • The SDK retries reads and deletes up to 3 times. It retries POST and PATCH only when you pass an idempotencyKey, since the first try may already have gone through
  • Check your connection or timeout option, then try again