Real-time Events
Subscribe to live events via Server-Sent Events (SSE) — messages, member activity, voice state, and more.
Connecting to the Event Stream #
Open a persistent HTTP connection to the SSE endpoint. Events will be pushed to you in real time:
GET /IEvents/v1/Stream?intents={bitmask} Headers: Authorization: Bot YOUR_TOKEN Accept: text/event-stream
| Parameter | Type | Description |
|---|---|---|
| intents | number | Bitmask of event categories to receive. Defaults to all non-privileged intents if omitted. |
| lastEventId | string | Resume from a previous event ID. Can also be sent as the Last-Event-ID header. |
Intents #
Intents are a bitmask that controls which events you receive. Combine flags with bitwise OR.
For example, intents=5 subscribes to Messages (1) + Channels (4).
| Intent | Bit | Value | Events |
|---|---|---|---|
| Messages | 0 | 1 | MessageCreate, MessageEdit |
| Members (privileged) | 1 | 2 | MemberJoin, MemberLeave, MemberUpdate |
| Channels | 2 | 4 | ChannelCreate, ChannelDelete |
| Reactions | 3 | 8 | ReactionAdd, ReactionRemove |
| Typing | 4 | 16 | TypingStart, TypingStop |
| Presence (privileged) | 5 | 32 | PresenceUpdate |
| Commands | 6 | 64 | CommandInteraction |
| DirectMessages | 7 | 128 | — |
| Moderation | 8 | 256 | — |
| Archetypes | 9 | 512 | ArchetypeCreate, ArchetypeUpdate |
| SpaceUpdates | 10 | 1024 | — |
| Voice | 11 | 2048 | VoiceJoin, VoiceLeave |
| Calls (privileged) | 12 | 4096 | CallEnded, CallIncoming |
| ControlInteractions | 13 | 8192 | ControlInteraction, ModalSubmit, SelectInteraction |
Privileged intents (Members, Presence) require your bot to be verified. Requesting privileged intents without verification will result in an error.
// Messages + Commands + Voice intents = 1 | 64 | 2048 = 2113 // All non-privileged (default) intents = 12253 // Everything (requires verification) intents = 16383
Event Format #
Events follow the standard SSE specification.
Each event has id, event, and data fields:
id: 42
event: messageCreate
data: {"messageId":12345,"text":"Hello!","creatorId":"...","channelId":"...","spaceId":"..."} The data field is the event payload — serialized directly as JSON (no wrapper object). The SSE event field is the event type in camelCase:
id: abc123def456_42
event: messageCreate
data: {"messageId":12345,"text":"Hello!","spaceId":"...","channelId":"...","creatorId":"..."} Connection Lifecycle #
When you connect, the server sends events in this order:
Ready + Bot goes Online
Sent immediately. Contains your active intents and the list of space IDs the bot belongs to. The bot's status is set to Online in all its spaces upon connection.
id: ready
event: ready
data: {"intents":4045,"spaceIds":["uuid-1","uuid-2"]} Live Events
Events matching your intents are pushed as they occur.
Heartbeat
A heartbeat event is sent every 30 seconds of inactivity to keep the connection alive.
The heartbeat resets after each batch of events, so you'll only see it during idle periods.
The heartbeat id is a cursor encoding the bot's position in each space's event stream.
The timestamp is milliseconds since the Argon Epoch (January 1, 2025 00:00:00 UTC).
id: a1b2c3d4....:42,e5f6a7b8....:17
event: heartbeat
data: {"timestamp":40953660000} Disconnect → Bot goes Offline
When the SSE connection closes (client disconnect, network drop, etc.), the bot's status is set to Offline in all its spaces. Reconnecting will automatically resume from where you left off.
Reconnection & Replay #
If your connection drops, you can resume without missing events. The server tracks your position in each space's event stream automatically.
Simply reconnect to the same endpoint. Events will be delivered from where you left off. Your stream position is kept for 10 minutes after disconnect — if you reconnect within that window, no events are lost.
Option 1: Query parameter GET /IEvents/v1/Stream?intents=4045&lastEventId=42 Option 2: Standard SSE header Last-Event-ID: 42
The server will replay missed events, then send a Resumed event with the count of replayed events before switching to live:
// Replayed events arrive first... { "id": "43", "type": "...", "data": { ... } } { "id": "44", "type": "...", "data": { ... } } // Then the Resumed marker { "id": "resumed", "type": "Resumed", "data": { "replayedCount": 2 } } // Then live events continue
Code Examples #
TypeScript (Bun / Node.js)
import EventSource from "eventsource"; const es = new EventSource( "https://gateway.argon.zone/IEvents/v1/Stream?intents=2113", { headers: { "Authorization": "Bot YOUR_TOKEN" } } ); es.addEventListener("ready", (e) => { const data = JSON.parse(e.data); console.log("Connected, spaces:", data.spaceIds); }); es.addEventListener("messageCreate", (e) => { const data = JSON.parse(e.data); console.log(`[${data.channelId}] ${data.text}`); }); es.addEventListener("heartbeat", () => { // Connection is alive }); es.onerror = () => { // EventSource auto-reconnects with Last-Event-ID };
C# (.NET)
using var client = new HttpClient(); client.DefaultRequestHeaders.Add("Authorization", "Bot YOUR_TOKEN"); using var stream = await client.GetStreamAsync( "https://gateway.argon.zone/IEvents/v1/Stream?intents=2113"); using var reader = new StreamReader(stream); string? eventType = null; while (await reader.ReadLineAsync() is { } line) { if (line.StartsWith("event: ")) eventType = line[7..]; // e.g. "messageCreate", "heartbeat" else if (line.StartsWith("data: ")) { var payload = JsonDocument.Parse(line[6..]); Console.WriteLine($"[{eventType}] {payload.RootElement}"); } }
All Event Types #
Each event is delivered as an SSE event: with the type name in camelCase.
The data: field contains the JSON payload described below.
Wherever a payload includes a user object, it carries an optional
locale field — the user's current app language as a
BCP-47 tag (e.g. "en", "ru", "ja").
Use it to reply in the user's language or pick a voice in calls. It reflects the user's live session choice (it is not persisted),
so it can change between events and may be null when unknown.
Archetypes
archetypeCreate Archetypes ArchetypeCreateEvent A new archetype (role) was created in a space.
Payload
archetypeUpdate Archetypes ArchetypeUpdateEvent An archetype (role) was updated in a space.
Payload
BotLifecycle
botEntitlementsUpdated BotEntitlementsUpdatedEvent Sent directly to the bot when its required entitlements are out of sync with a space's granted entitlements. Always delivered regardless of intents.
Payload
botInstallingToSpace BotInstallingToSpaceEvent Sent directly to the bot when a server administrator installs it into a space. Always delivered regardless of intents.
Payload
botUninstallingFromSpace BotUninstallingFromSpaceEvent Sent directly to the bot when a server administrator uninstalls it from a space. Always delivered regardless of intents.
Payload
Calls
callEnded Calls CallEndedEvent A call the bot was involved in has ended.
Payload
callIncoming Calls CallIncomingEvent An incoming call is ringing for the bot.
Payload
Channels
channelCreate Channels ChannelCreateEvent A new channel was created in a space.
Payload
channelDelete Channels ChannelDeleteEvent A channel was deleted from a space.
Payload
Commands
commandInteraction Commands CommandInteractionEvent A user invoked a slash command registered by the bot.
Payload
ControlInteractions
controlInteraction ControlInteractions ControlInteractionEvent A user clicked an interactive button on a message.
Payload
modalSubmit ControlInteractions ModalSubmitEvent A user submitted a modal popup form.
Payload
selectInteraction ControlInteractions SelectInteractionEvent A user submitted a selection from a select menu on a message.
Payload
Connection
heartbeat
STABLE
HeartbeatEventPayload Keep-alive ping sent every 30 seconds. Contains cursor for reconnection.
Payload
ready
STABLE
ReadyEventPayload Sent immediately on SSE connection. Contains active intents and per-space entitlement info.
Payload
resumed
STABLE
ResumedEventPayload Sent after replaying missed events on reconnection via Last-Event-ID.
Payload
Members
memberJoin Members MemberJoinEvent A user joined a space the bot is in.
Payload
memberLeave Members MemberLeaveEvent A user left or was removed from a space the bot is in.
Payload
memberUpdate Members MemberUpdateEvent A member's profile or roles were updated in a space.
Payload
Messages
messageCreate Messages MessageCreateEvent A new message was sent in a channel the bot has access to.
Payload
messageEdit Messages MessageEditEvent A message was edited in a channel the bot has access to.
Payload
Presence
presenceUpdate Presence PresenceUpdateEvent A user's online status or activity changed.
Payload
Reactions
reactionAdd Reactions ReactionAddEvent A user added a reaction to a message.
Payload
reactionRemove Reactions ReactionRemoveEvent A user removed a reaction from a message.
Payload
Typing
typingStart Typing TypingStartEvent A user or bot started typing in a channel.
Payload
typingStop Typing TypingStopEvent A user or bot stopped typing in a channel.
Payload
Voice
voiceJoin Voice VoiceJoinEvent A user joined a voice channel.
Payload
voiceLeave Voice VoiceLeaveEvent A user left a voice channel.