Add User
Triggered when a user is added to a ticket
Event Type
"ticket.add"Description
This event is triggered when a user is added to a ticket channel, granting them access to view and participate in the ticket.
Payload Structure
Prop
Type
Example Payload
{
"type": "ticket.add",
"payload": {
"ticketId": "TKT-1234",
"panelId": "support-panel",
"channel": {
"id": "1140972530400776294",
"name": "ticket-0001"
},
"creatorId": "713115896805064856",
"openDate": "2024-01-18T15:30:00.000Z",
"addedUser": "123456789012345678"
}
}Example Usage
app.post('/webhook', (req, res) => {
const { type, payload } = req.body;
if (type === 'ticket.add') {
console.log(`User added to ticket ${payload.ticketId}`);
console.log(`Added user: ${payload.addedUser}`);
// Track ticket participants
await addTicketParticipant({
ticketId: payload.ticketId,
userId: payload.addedUser,
addedAt: new Date(),
});
// Log the addition for audit trail
await logTicketAccess(payload.ticketId, payload.addedUser, 'added');
}
res.status(200).send('OK');
});Use Cases
- Track who has access to tickets
- Monitor ticket collaborators
- Audit ticket access for compliance
- Update participant lists in external systems
- Notify relevant parties of new participants