Skip to content

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.

Common combinations
// 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:

1

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"]}
2

Live Events

Events matching your intents are pushed as they occur.

3

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

Field Type
archetype BotArchetypeV1
archetypeId string
colour int32
isDefault boolean
isMentionable boolean
name string
permissions int64 | null
spaceId string
spaceId string
archetypeUpdate Archetypes ArchetypeUpdateEvent

An archetype (role) was updated in a space.

Payload

Field Type
archetype BotArchetypeV1
archetypeId string
colour int32
isDefault boolean
isMentionable boolean
name string
permissions int64 | null
spaceId string
spaceId string

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

Field Type
grantedEntitlements "none" | "viewChannel" | "readHistory" | "joinToVoice" | "sendMessages" | "sendVoice" | "attachFiles" | "addReactions" | "anyMentions" | "mentionEveryone" | "externalEmoji" | "externalStickers" | "useCommands" | "postEmbeddedLinks" | "connect" | "speak" | "video" | "stream" | "useASIO" | "additionalStreams" | "disconnectMember" | "moveMember" | "banMember" | "muteMember" | "kickMember" | "manageChannels" | "manageArchetype" | "manageBots" | "manageEvents" | "manageBehaviour" | "manageServer"
requiredEntitlements "none" | "viewChannel" | "readHistory" | "joinToVoice" | "sendMessages" | "sendVoice" | "attachFiles" | "addReactions" | "anyMentions" | "mentionEveryone" | "externalEmoji" | "externalStickers" | "useCommands" | "postEmbeddedLinks" | "connect" | "speak" | "video" | "stream" | "useASIO" | "additionalStreams" | "disconnectMember" | "moveMember" | "banMember" | "muteMember" | "kickMember" | "manageChannels" | "manageArchetype" | "manageBots" | "manageEvents" | "manageBehaviour" | "manageServer"
spaceId string
botInstallingToSpace BotInstallingToSpaceEvent

Sent directly to the bot when a server administrator installs it into a space. Always delivered regardless of intents.

Payload

Field Type
spaceId string
botUninstallingFromSpace BotUninstallingFromSpaceEvent

Sent directly to the bot when a server administrator uninstalls it from a space. Always delivered regardless of intents.

Payload

Field Type
spaceId string

Calls

callEnded Calls CallEndedEvent

A call the bot was involved in has ended.

Payload

Field Type
callId string
callIncoming Calls CallIncomingEvent

An incoming call is ringing for the bot.

Payload

Field Type
callId string
fromLocale string
fromUserId string

Channels

channelCreate Channels ChannelCreateEvent

A new channel was created in a space.

Payload

Field Type
channel BotChannelFullV1
channelId string
description string
name string
spaceId string
type "text" | "voice" | "announcement"
spaceId string
channelDelete Channels ChannelDeleteEvent

A channel was deleted from a space.

Payload

Field Type
channelId string
spaceId string

Commands

commandInteraction Commands CommandInteractionEvent

A user invoked a slash command registered by the bot.

Payload

Field Type
channelId string
commandId string
commandName string
interactionId string
options BotCommandOptionValueV1[]
name string
type "string" | "integer" | "boolean" | "user" | "channel" | "role" | "number"
value any
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
voiceState BotVoiceStateV1
channelId string
joinedAt string
state "none" | "muted" | "mutedByServer" | "mutedHeadphones" | "mutedHeadphonesByServer" | "streaming"

ControlInteractions

controlInteraction ControlInteractions ControlInteractionEvent

A user clicked an interactive button on a message.

Payload

Field Type
channelId string
controlId string
controlType "button" | "stringSelect" | "userSelect" | "archetypeSelect" | "channelSelect"
interactionId string
messageId int64
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
voiceState BotVoiceStateV1
channelId string
joinedAt string
state "none" | "muted" | "mutedByServer" | "mutedHeadphones" | "mutedHeadphonesByServer" | "streaming"
modalSubmit ControlInteractions ModalSubmitEvent

A user submitted a modal popup form.

Payload

Field Type
channelId string
customId string
interactionId string
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
values ModalSubmitValueV1[]
customId string
values string[]
voiceState BotVoiceStateV1
channelId string
joinedAt string
state "none" | "muted" | "mutedByServer" | "mutedHeadphones" | "mutedHeadphonesByServer" | "streaming"
selectInteraction ControlInteractions SelectInteractionEvent

A user submitted a selection from a select menu on a message.

Payload

Field Type
channelId string
controlType "button" | "stringSelect" | "userSelect" | "archetypeSelect" | "channelSelect"
customId string
interactionId string
messageId int64
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
values string[]
voiceState BotVoiceStateV1
channelId string
joinedAt string
state "none" | "muted" | "mutedByServer" | "mutedHeadphones" | "mutedHeadphonesByServer" | "streaming"

Connection

heartbeat STABLE HeartbeatEventPayload

Keep-alive ping sent every 30 seconds. Contains cursor for reconnection.

Payload

Field Type
timestamp int64
ready STABLE ReadyEventPayload

Sent immediately on SSE connection. Contains active intents and per-space entitlement info.

Payload

Field Type
intents int64
spaces BotSpaceInfo[]
grantedEntitlements "none" | "viewChannel" | "readHistory" | "joinToVoice" | "sendMessages" | "sendVoice" | "attachFiles" | "addReactions" | "anyMentions" | "mentionEveryone" | "externalEmoji" | "externalStickers" | "useCommands" | "postEmbeddedLinks" | "connect" | "speak" | "video" | "stream" | "useASIO" | "additionalStreams" | "disconnectMember" | "moveMember" | "banMember" | "muteMember" | "kickMember" | "manageChannels" | "manageArchetype" | "manageBots" | "manageEvents" | "manageBehaviour" | "manageServer"
pendingApproval boolean
spaceId string
resumed STABLE ResumedEventPayload

Sent after replaying missed events on reconnection via Last-Event-ID.

Payload

Field Type
replayedCount int32

Members

memberJoin Members MemberJoinEvent

A user joined a space the bot is in.

Payload

Field Type
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
memberLeave Members MemberLeaveEvent

A user left or was removed from a space the bot is in.

Payload

Field Type
spaceId string
userId string
memberUpdate Members MemberUpdateEvent

A member's profile or roles were updated in a space.

Payload

Field Type
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string

Messages

messageCreate Messages MessageCreateEvent

A new message was sent in a channel the bot has access to.

Payload

Field Type
channelId string
message BotMessageV1
channelId string
controls ControlRowV1[]
controls BotControlV1[]
colour OklchColor
c float
h float
l float
customId string
disabled boolean | null
id string
label string
labelLocalizations Dictionary`2
maxValues int32 | null
minValues int32 | null
options SelectOptionV1[]
default boolean | null
description string
label string
value string
placeholder string
requiredArchetypeId string | null
type "button" | "stringSelect" | "userSelect" | "archetypeSelect" | "channelSelect"
url string
variant "callback" | "link" | null
entities BotMessageEntityV1[]
archetypeId string | null
callId string | null
callerId string | null
colour int32 | null
contentType string
denominator int32 | null
domain string
durationSeconds int32 | null
email string
fileName string
fileSize int64 | null
hashtag string
height int32 | null
inviterId string | null
length int32
numerator int32 | null
offset int32
path string
quotedUserId string | null
thumbHash string
type "hashtag" | "mention" | "mentionEveryone" | "mentionRole" | "email" | "url" | "monospace" | "quote" | "spoiler" | "strikethrough" | "bold" | "italic" | "underline" | "fraction" | "ordinal" | "capitalized" | "systemCallStarted" | "systemCallEnded" | "systemCallTimeout" | "systemUserJoined" | "attachment" | "gif"
userId string | null
width int32 | null
messageId int64
reactions BotReactionV1[]
count int32
emoji string
userIds string[]
replyId int64 | null
sender BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
spaceId string
text string
timeSent string
spaceId string
messageEdit Messages MessageEditEvent

A message was edited in a channel the bot has access to.

Payload

Field Type
channelId string
messageId int64
spaceId string
text string
updatedAt string

Presence

presenceUpdate Presence PresenceUpdateEvent

A user's online status or activity changed.

Payload

Field Type
presence BotPresenceV1
activity BotActivityV1
kind "game" | "software" | "streaming" | "listen"
startTimestampSeconds uint32
titleName string
status "offline" | "online" | "away" | "inGame" | "listen" | "touchGrass" | "doNotDisturb"
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string

Reactions

reactionAdd Reactions ReactionAddEvent

A user added a reaction to a message.

Payload

Field Type
channelId string
emoji string
messageId int64
spaceId string
userId string
reactionRemove Reactions ReactionRemoveEvent

A user removed a reaction from a message.

Payload

Field Type
channelId string
emoji string
messageId int64
spaceId string
userId string

Typing

typingStart Typing TypingStartEvent

A user or bot started typing in a channel.

Payload

Field Type
channelId string
kind string
spaceId string
userId string
typingStop Typing TypingStopEvent

A user or bot stopped typing in a channel.

Payload

Field Type
channelId string
spaceId string
userId string

Voice

voiceJoin Voice VoiceJoinEvent

A user joined a voice channel.

Payload

Field Type
channelId string
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string
voiceLeave Voice VoiceLeaveEvent

A user left a voice channel.

Payload

Field Type
channelId string
spaceId string
user BotUserV1
avatarUrl string
displayName string
flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
locale string
userId string
username string

Next Steps