Live updates
Instead of asking again and again whether something changed, open one connection and Technified tells you as it happens.
The event stream
GET /guilds/:guildId/events is a stream of server sent events. Every event is a line of JSON. You only receive events your key may see: a key that may read tickets gets ticket events, and so on.
- Ask only for what you need with
?kinds=, for example?kinds=punishment.ban,ticket.opened. - Event kinds use the same names as the audit log, like
punishment.revokedorstaff.leave_requested, plus live ones likeserver.onlineandserver.offline. - Every event has an id. If the connection drops, reconnect with the last id in the
Last-Event-IDheader and you get exactly what you missed. - A quiet connection may be closed by the network. That is normal: reconnect.
Good to know
Browsers’ built in
EventSource cannot send an Authorization header, and your key must stay secret anyway. Read the stream from your own server, as below.What an event looks like
id: 4182
event: punishment.ban
data: {"kind":"punishment.ban","guildId":"gld_01J9...","summary":"kai_2010 was banned for 7 days: Exploiting","data":{...},"at":"2026-10-10T14:02:11.000Z"}Reading it
// Node 18 or newer
const url = "https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/events?kinds=punishment.ban,ticket.opened";
let lastId = null;
async function listen() {
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${process.env.TECHNIFIED_KEY}`,
...(lastId ? { "Last-Event-ID": lastId } : {}),
},
});
const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
let buffer = "";
for (;;) {
const { value, done } = await reader.read();
if (done) break;
buffer += value;
let end;
while ((end = buffer.indexOf("\n\n")) !== -1) {
const block = buffer.slice(0, end);
buffer = buffer.slice(end + 2);
const id = block.match(/^id: (.*)$/m)?.[1];
const data = block.match(/^data: (.*)$/m)?.[1];
if (id) lastId = id;
if (data) console.log("Event:", JSON.parse(data));
}
}
}
// Reconnect whenever the stream ends.
for (;;) {
await listen().catch((error) => console.error(error));
await new Promise((resolve) => setTimeout(resolve, 2000));
}When you first connect, the stream starts from now. Load what you need with ordinary requests first, then use the stream for what happens next.
Still stuck? Get help from the Technified team.