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.
{
"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 401Why this happens
- You didn't include an
Authorizationheader 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
# Correct format
curl -H "Authorization: Bearer sk_live_your_key_here" \
https://www.cstar.help/api/v1/teams/{teamId}/tickets 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 401Why 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
# 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 401Why 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 operationssk_test_*Secret key, test mode and permitted staff operationspk_live_*Publishable key, live public customer SDKspk_test_*Publishable key, test public customer SDKsinsufficient_permissions 403Why 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 403Why this happens
- You're using a
pk_live_orpk_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 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 403Why this happens
- You're using a
pk_live_orpk_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 403Why this happens
- The
teamIdin 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
# 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 401Why 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.dumpsescapes them unless you passensure_ascii=False - The digest is in uppercase hex (.NET's
Convert.ToHexStringgives 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.
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 401Why 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 400How to fix it
Turn on Customer Identity Verification under Settings → Chat Widget. That creates a live key and a test key.
invalid_session_token 401Why 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 401How 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 401Why 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 400Why this happens
- The refresh token sent to
/api/widget/auth/tokenwas 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 403Why this happens
/api/widget/auth/passwordwas 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 currentPasswordwas 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_failedWhy 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_blockedWhy this happens
- Your policy's
connect-src(ordefault-src, when there is noconnect-src) leaves out the cStar host, so the widget cannot reach its settings - Your policy's
script-srcadmits thecstar.jstag but not the scripts it adds (a source pinned to one file) - Your policy's
frame-src(ordefault-src) leaves out the cStar host, so the chat frame cannot open - Only an enforced policy counts. A
Content-Security-Policy-Report-Onlypolicy does not block, so a failure under it gets the code it would get with no policy:config_failed,script_failedorload_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_timeoutWhy 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_failedWhy this happens
- An ad blocker or privacy extension stopped
chat.jsor 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_blockedWhy this happens
- Your
style-srcblocks 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_foundWhy this happens
- The
teamvalue 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 400Why this happens
- A required field was not included in the request body
- The field name is misspelled (e.g.,
tittleinstead oftitle) - 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": {
"code": "parameter_missing",
"message": "The 'title' field is required.",
"param": "title"
}
} // Before (missing title)
await cstar.tickets.create({ priority: 'high' });
// After (title included)
await cstar.tickets.create({ title: 'Help needed', priority: 'high' }); parameter_invalid 400Why 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 arenew,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 returnsresource_not_found)
How to fix it
Check the param field and refer to the API reference for valid 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 400Why this happens
- A customer message sent through the chat widget API is longer than 10,000 characters
(counted the way JavaScript's
string.lengthcounts 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 400Why this happens
- The JSON has a syntax error (missing comma, bracket, or quote)
- You sent form-encoded data instead of JSON
- The
Content-Typeheader is missing or wrong
How to fix it
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 409Why 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.
// 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 409Why 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 422Why 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 403Why 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 403Why 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 409Why 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 409Why 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 405Why this happens
- You sent a
POSTto a read-only endpoint, or aGETto 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 402Why 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
GETrequests and the export endpoints keep working, so you can pull every ticket, customer and articleDELETE /keys/{keyId}keeps working too, so a key that leaked can be revoked while the team is paused- With a secret key,
GET /billing/subscriptionandGET /auth/whoamisaypaused: trueand why inpausedReason(trial_ended,no_trial,payment_failed,canceledorpayment_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 404Why 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
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 404Why 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 429Current limits
sk_live_* / sk_test_*1,000 requests per hourpk_live_* / pk_test_*100 requests per hourRate limit headers
Every response includes these headers so you can track your usage:
X-RateLimit-LimitMax requests per windowX-RateLimit-RemainingRequests remainingX-RateLimit-ResetUnix timestamp when window resetsRetry-AfterSeconds to wait (only on 429)How to fix it
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 500Why 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_idfrom the error response when contacting support - If it persists, email support@cstar.help with the request ID
database_error 500What 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 502Why 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
Handling Errors in Code
The cStar SDKs throw typed errors that you can catch and handle by code.
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_errorWhy this happens
- The network dropped, DNS failed, or the request timed out (30 seconds by default)
- The SDK sets this code itself, with
statusCode0 and norequest_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
timeoutoption, then try again