Webhooks
Webhooks notify your application in real-time when events happen in cStar. Instead of polling the API, you receive HTTP POST requests whenever a ticket is created, a customer is updated, or a boss is defeated.
How It Works
- Register a webhook URL via the API or team settings
- Choose which events to subscribe to
- cStar sends a signed HTTP POST to your URL when events fire
- Your server verifies the signature and processes the event
Event Types
Events follow the pattern resource.action. Subscribe to specific events or use
wildcards when creating webhooks.
Tickets
ticket.created Fired when a new ticket is created via app, widget, API, or emailticket.updated Fired when a ticket status, priority, or assignment changesticket.closed Fired when a ticket is resolved or closedticket.message_added Fired when a new message is added to a ticketCustomers
customer.created Fired when a new customer is createdcustomer.updated Fired when customer details are modifiedArticles
article.created Fired when a new Library article is createdarticle.published Fired when an article is published to the Public Libraryarticle.updated Fired when an article content or metadata is modifiedGamification
boss.spawned Fired when a boss appears for the teamboss.defeated Fired when a boss is defeated by the teamplayer.level_up Fired when a player reaches a new levelachievement.unlocked Fired when a player unlocks an achievementSurveys
survey.submitted Fired when a customer submits a CSAT survey responsePayload Format
All webhook payloads share the same envelope structure.
{
"id": "evt_abc123",
"type": "ticket.created",
"team_id": "your-team-uuid",
"created_at": "2025-12-10T14:30:00Z",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Cannot log in to my account",
"status": "new",
"priority": "high"
}
}
Signature Verification
Every webhook request includes a x-cstar-signature header containing an HMAC-SHA256 signature.
Always verify this before processing events.
import crypto from 'crypto';
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
// Express example
app.post('/webhook', (req, res) => {
const signature = req.headers['x-cstar-signature'];
const isValid = verifyWebhook(
JSON.stringify(req.body),
signature,
process.env.WEBHOOK_SECRET
);
if (!isValid) {
return res.status(401).json({ error: 'Invalid signature' });
}
const event = req.body;
console.log('Event:', event.type, event.data);
res.status(200).json({ received: true });
});
Request Headers
x-cstar-signature HMAC-SHA256 signature of the request bodyx-cstar-event Event type (e.g., ticket.created)x-cstar-delivery Unique delivery ID for idempotencyContent-Type application/jsonRetries
If your endpoint returns a non-2xx status or doesn't respond within 10 seconds, cStar retries with exponential backoff: 1 minute, 5 minutes, 30 minutes. After 3 failed attempts, the delivery is marked as failed and visible in webhook logs.
Local Testing with the CLI
Use the cStar CLI to forward webhook events to your local development server.
# Forward events to your local server
cstar listen --forward-to http://localhost:3000/webhook
# In another terminal, trigger a test event
cstar trigger ticket.created