🎉 Tickety V3 has now been released! Read more →
API

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

  1. Navigate to your server's dashboard
  2. Go to Advanced Logging settings
  3. Enable HTTP Events
  4. Enter your http events endpoint URL (NOT a discord webhook)
  5. 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 dashboard

Keep your authentication token secret! Anyone with this token can send fake events to your endpoint.

Rate Limits

TierDaily LimitReset Time
Free100 requests00:00 UTC
PremiumUnlimitedN/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 created
  • ticket.close - A ticket was closed
  • ticket.rename - A ticket was renamed
  • ticket.priority - A ticket's priority was changed
  • ticket.move - A ticket was moved to a different category
  • ticket.transfer - A ticket was transferred to a different panel
  • ticket.claim - A ticket was claimed by a staff member
  • ticket.unclaim - A ticket was unclaimed
  • ticket.add - A user was added to a ticket
  • ticket.remove - A user was removed from a ticket

Application Events

  • application.submit - An application was submitted
  • application.accept - An application was accepted
  • application.deny - An application was denied

Verification Events

  • verification.pass - A user passed verification
  • verification.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

  1. Always verify the authentication token - Check the Authorization header matches your token
  2. Use HTTPS when possible - HTTPS is recommended for production to ensure encryption, but HTTP is also supported
  3. Validate the payload - Check that the event data matches your expected structure
  4. Don't expose your token - Never commit your token to version control or share it publicly
  5. Implement rate limiting - Protect your endpoint from potential abuse

On this page