TicketWave Logo
Webhooks

इवेंट संदर्भ

हर वेबहुक इवेंट प्रकार और TicketWave द्वारा भेजा गया सटीक payload।

इवेंट संदर्भ

प्रति endpoint छह इवेंट प्रकारों की सदस्यता ली जा सकती है। हर request एक ही envelope का उपयोग करती है — event, timestamp, guild_id और data — और केवल data object अलग होता है।

EventFires when
ticket.createdएक टिकट खोला जाता है
ticket.closedएक टिकट बंद किया जाता है
ticket.updatedखुले टिकट पर कुछ और बदलता है
message.sentकोई सदस्य या स्टाफ टिकट में लिखता है
blacklist.addedकिसी सदस्य को blacklist किया जाता है
blacklist.removedblacklist entry हटाई जाती है

जो फ़ील्ड resolve नहीं हो सकते, उन्हें हटाने के बजाय null के रूप में भेजा जाता है — इसलिए आप keys के मौजूद रहने पर भरोसा कर सकते हैं। जब Discord user वापस नहीं करता, तब username null होता है।

Shared fields

हर ticket event में ये शामिल होते हैं:

FieldTypeDescription
ticket_idstringआपके pattern से readable ticket id, जैसे ticket-1042
ticket_num_idnumberचलती हुई ticket number, जैसे 1042
channel_idstringटिकट का Discord channel
categorystring | nullcategory name, अगर टिकट की कोई category नहीं है तो null
userobject | nullटिकट owner { id, username } के रूप में

ticket.created

टिकट channel बनते ही भेजा जाता है।

{
  "event": "ticket.created",
  "timestamp": "2026-08-26T08:23:11.000Z",
  "guild_id": "123456789012345678",
  "data": {
    "ticket_id": "ticket-1042",
    "ticket_num_id": 1042,
    "channel_id": "998877665544332211",
    "category": "🤖 Support",
    "user": { "id": "987654321098765432", "username": "Luna" },
    "created_at": "2026-08-26T08:23:11.000Z"
  }
}

यह तब ट्रिगर होता है जब टिकट खोला जाता है, यानी सदस्य के कुछ लिखने से पहले। अगर आपको पहला संदेश चाहिए, तो message.sent भी सुनें।


ticket.closed

{
  "event": "ticket.closed",
  "timestamp": "2026-08-26T07:45:02.000Z",
  "guild_id": "123456789012345678",
  "data": {
    "ticket_id": "ticket-1041",
    "ticket_num_id": 1041,
    "channel_id": "998877665544332211",
    "category": "💸 Payment",
    "user": { "id": "987654321098765432", "username": "Luna" },
    "closed_by": { "id": "112233445566778899", "username": "Staff_01" },
    "reason": "Issue resolved",
    "closed_at": "2026-08-26T07:45:02.000Z"
  }
}
FieldTypeDescription
closed_byobjectकिसने इसे बंद किया। automatic closes में bot रिपोर्ट होता है
reasonstring | nullबंद करने का कारण, अगर कुछ नहीं दिया गया तो null

ticket.updated

खुले टिकट में बदलावों के लिए catch-all। action बताता है कि क्या बदला, changes उस खास action का विवरण रखता है।

{
  "event": "ticket.updated",
  "timestamp": "2026-08-26T14:02:19.000Z",
  "guild_id": "123456789012345678",
  "data": {
    "ticket_id": "ticket-1038",
    "ticket_num_id": 1038,
    "channel_id": "998877665544332211",
    "category": "🤖 Support",
    "user": { "id": "987654321098765432", "username": "Luna" },
    "action": "ticket_priority:add",
    "changes": { "priority": "high" },
    "reason": null,
    "updated_by": { "id": "112233445566778899", "username": "Staff_01" }
  }
}

संभावित action values

actionMeaningchanges contains
ticket_claim:addकिसी स्टाफ सदस्य ने टिकट claim किया(empty)
ticket_unclaim:addclaim छोड़ दिया गया(empty)
ticket_priority:addpriority बदली गईpriority
ticket_rename:addchannel का नाम बदला गयाnew_name
ticket_remind:addreminder भेजा गया(empty)
ticket_feedback:addसदस्य ने टिकट को rate कियाstar_count, feedback
ticket_schedule_close:addclose शेड्यूल किया गयाduration, schedule_time
ticket_request_close:addस्टाफ ने सदस्य से close करने को कहाduration, request_duration_time
ticket_request_close_accept:addसदस्य ने स्वीकार किया(empty)
ticket_request_close_deny:addसदस्य ने मना किया(empty)
ticket_close_cancel:addचल रहा close रद्द किया गया(empty)
ticket_additional_access:addकिसी user या role को टिकट में जोड़ा गयाentity_type, entity_id, reason
ticket_additional_access:removeकिसी user या role को हटाया गयाentity_type, entity_id, reason

इस सूची को open-ended मानें। TicketWave के बढ़ने के साथ नए actions जोड़े जाते हैं, और वे ticket.updated के रूप में आते हैं। जिन actions की आपको ज़रूरत है, सिर्फ़ उन्हीं पर switch करें और unknown values पर throw करने के बजाय बाकी को ignore करें।

किसी ticket step का जवाब देने से कोई event नहीं बनता। वरना कई steps वाला टिकट तब तक आपके endpoint को flood कर देगा जब तक सदस्य form भर रहा है।


message.sent

खुले टिकट के अंदर हर human message के लिए भेजा जाता है। bots — TicketWave खुद सहित — के messages skip किए जाते हैं।

{
  "event": "message.sent",
  "timestamp": "2026-08-26T22:10:55.000Z",
  "guild_id": "123456789012345678",
  "data": {
    "ticket_id": "ticket-1040",
    "ticket_num_id": 1040,
    "channel_id": "998877665544332211",
    "message_id": "1234567890123456789",
    "content": "Hello, how can I help you?",
    "author": { "id": "112233445566778899", "username": "Staff_01" },
    "is_staff": true,
    "sent_at": "2026-08-26T22:10:55.000Z"
  }
}
FieldTypeDescription
contentstringraw message text। attachment-only messages के लिए खाली
authorobjectsender का { id, username }
is_staffbooleansender के पास configured support role हो तो true

यह बहुत बड़े अंतर से सबसे अधिक volume वाला event है — busy server पर हर message के लिए एक request बनती है। इसे तभी subscribe करें जब आपको सच में message-level data चाहिए, और सुनिश्चित करें कि आपका receiver जल्दी जवाब दे।


blacklist.added

किसी ticket से जुड़ा नहीं है, इसलिए इस payload में ticket_id नहीं होता।

{
  "event": "blacklist.added",
  "timestamp": "2026-08-26T18:33:47.000Z",
  "guild_id": "123456789012345678",
  "data": {
    "user": { "id": "111223344556677889", "username": "BadActor" },
    "reason": "Spam",
    "added_by": { "id": "112233445566778899", "username": "Staff_01" }
  }
}

blacklist.removed

{
  "event": "blacklist.removed",
  "timestamp": "2026-08-26T18:40:12.000Z",
  "guild_id": "123456789012345678",
  "data": {
    "user": { "id": "111223344556677889", "username": "BadActor" },
    "removed_by": { "id": "112233445566778899", "username": "Staff_01" }
  }
}

Test events

Send test event button एक real, signed request भेजता है जिसका data बस यह होता है:

{
  "event": "ticket.created",
  "timestamp": "2026-08-26T12:00:00.000Z",
  "guild_id": "123456789012345678",
  "data": { "test": true }
}

event वही पहला type है जिसकी सदस्यता endpoint ने ली होती है। production logic में test deliveries को छोड़ना हो तो data.test देखें।

Next Steps

  • Example Server (इन payloads को Express में handle करें)
  • Webhooks (Signing, retries और delivery history)

How is this guide?