HTTP Events
Receive real-time webhook events for tickets, applications, and more.
Overview
Tickety can send HTTP webhook events to your custom endpoint whenever certain actions occur in your server. This allows you to integrate Tickety with your own systems, automate workflows, or build custom integrations.
HTTP Events are available to all servers with a daily limit of 100 requests for free servers. Premium servers have unlimited requests.
Getting Started
- Navigate to your server's dashboard
- Go to Advanced Logging settings
- Enable HTTP Events
- Enter your http events endpoint URL (NOT a discord webhook)
- Copy your authentication token (automatically generated)
How It Works
When an event occurs in your server (e.g., a ticket is created), Tickety sends a POST request to your configured webhook URL through a secure Cloudflare Worker. The worker forwards the event to your endpoint with the following structure:
{
"type": "ticket.create",
"payload": {
// Event-specific data
}
}Authentication
All requests include an Authorization header with your unique token:
const authToken = request.headers.get("Authorization");
// Verify this matches your token from the dashboardKeep your authentication token secret! Anyone with this token can send fake events to your endpoint.
Rate Limits
| Tier | Daily Limit | Reset Time |
|---|---|---|
| Free | 100 requests | 00:00 UTC |
| Premium | Unlimited | N/A |
The rate limit counter resets daily at midnight UTC. Once you reach your limit, no more events will be sent until the next day.
Event Types
Tickety supports the following event types:
Ticket Events
ticket.create- A ticket was createdticket.close- A ticket was closedticket.rename- A ticket was renamedticket.priority- A ticket's priority was changedticket.move- A ticket was moved to a different categoryticket.transfer- A ticket was transferred to a different panelticket.claim- A ticket was claimed by a staff memberticket.unclaim- A ticket was unclaimedticket.add- A user was added to a ticketticket.remove- A user was removed from a ticket
Application Events
application.submit- An application was submittedapplication.accept- An application was acceptedapplication.deny- An application was denied
Verification Events
verification.pass- A user passed verificationverification.fail- A user failed verification
Example Implementation
Here's a simple Express.js server that receives Tickety events:
import express from 'express';
const app = express();
app.use(express.json());
const TICKETY_AUTH_TOKEN = 'your-token-from-dashboard';
app.post('/tickety-webhook', (req, res) => {
// Verify authentication
const authToken = req.headers.authorization;
if (authToken !== TICKETY_AUTH_TOKEN) {
return res.status(401).json({ error: 'Unauthorized' });
}
const { type, payload } = req.body;
// Handle different event types
switch (type) {
case 'ticket.create':
console.log(`New ticket created: ${payload.ticketId}`);
console.log(`Channel: ${payload.channel.name}`);
break;
case 'ticket.close':
console.log(`Ticket closed: ${payload.ticketId}`);
console.log(`Reason: ${payload.closeReason}`);
break;
// Handle other event types...
default:
console.log(`Unknown event type: ${type}`);
}
res.status(200).json({ success: true });
});
app.listen(3000, () => {
console.log('Webhook server running on port 3000');
});Security Considerations
- Always verify the authentication token - Check the
Authorizationheader matches your token - Use HTTPS when possible - HTTPS is recommended for production to ensure encryption, but HTTP is also supported
- Validate the payload - Check that the event data matches your expected structure
- Don't expose your token - Never commit your token to version control or share it publicly
- Implement rate limiting - Protect your endpoint from potential abuse