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
Expressions 14 16384 ExpressionsUpdate

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 = 28637

// Everything (requires verification)
intents = 32767

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" | "createExpressions" | "connect" | "speak" | "video" | "stream" | "canDrawOnStream" | "broadcast" | "useASIO" | "additionalStreams" | "disconnectMember" | "moveMember" | "banMember" | "muteMember" | "kickMember" | "deafenMember" | "manageChannels" | "manageArchetype" | "manageBots" | "manageEvents" | "manageBehaviour" | "manageServer" | "manageMessages" | "manageExpressions"
requiredEntitlements "none" | "viewChannel" | "readHistory" | "joinToVoice" | "sendMessages" | "sendVoice" | "attachFiles" | "addReactions" | "anyMentions" | "mentionEveryone" | "externalEmoji" | "externalStickers" | "useCommands" | "postEmbeddedLinks" | "createExpressions" | "connect" | "speak" | "video" | "stream" | "canDrawOnStream" | "broadcast" | "useASIO" | "additionalStreams" | "disconnectMember" | "moveMember" | "banMember" | "muteMember" | "kickMember" | "deafenMember" | "manageChannels" | "manageArchetype" | "manageBots" | "manageEvents" | "manageBehaviour" | "manageServer" | "manageMessages" | "manageExpressions"
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 | null
fromUserId string

Channels

channelCreate Channels ChannelCreateEvent

A new channel was created in a space.

Payload

Field Type
channel BotChannelFullV1
↳ channelId string
↳ description string | null
↳ 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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string
voiceState BotVoiceStateV1 | null
↳ 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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string
voiceState BotVoiceStateV1 | null
↳ 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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string
values ModalSubmitValueV1[]
↳ customId string
↳ values string[]
voiceState BotVoiceStateV1 | null
↳ 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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string
values string[]
voiceState BotVoiceStateV1 | null
↳ channelId string
↳ joinedAt string
↳ state "none" | "muted" | "mutedByServer" | "mutedHeadphones" | "mutedHeadphonesByServer" | "streaming"

Expressions

expressionsUpdate needs the Expressions intent (bit 14, 16384) and fires for every change to a space's sticker or custom emoji packs, the bot's own included. baseVersion and delta may be null. delta.type is one of packUpserted (pack, sent without its items), packDeleted (packId), itemUpserted (item), itemDeleted (packId, itemId), packsReordered (kind, ordered) and itemsReordered (packId, ordered). Apply the delta only when baseVersion is the version you hold; otherwise re-read IExpressions/List. See Stickers & Custom Emoji for the full sync loop.

expressionsUpdate Expressions ExpressionsUpdateEvent

A space's sticker or custom emoji packs changed. Apply the delta when baseVersion is the version you hold; otherwise, or when delta is null, re-read IExpressions/List.

Payload

Field Type
baseVersion string | null
delta BotExpressionsDeltaV1 | null
↳ item BotExpressionItemV1 | null
↳ createdByBot boolean
↳ creatorId string | null
↳ emoji string[]
↳ fileSize int32
↳ format "static" | "lottie" | "video"
↳ height int32
↳ itemId string
↳ keywords string[]
↳ kind "sticker" | "emoji"
↳ name string
↳ packId string
↳ sortOrder int32
↳ spaceId string
↳ textColor boolean
↳ url string | null
↳ width int32
↳ itemId string | null
↳ kind "sticker" | "emoji" | null
↳ ordered string[] | null
↳ pack BotExpressionPackV1 | null
↳ coverItemId string | null
↳ createdByBot boolean
↳ creatorId string | null
↳ items BotExpressionItemV1[]
↳ createdByBot boolean
↳ creatorId string | null
↳ emoji string[]
↳ fileSize int32
↳ format "static" | "lottie" | "video"
↳ height int32
↳ itemId string
↳ keywords string[]
↳ kind "sticker" | "emoji"
↳ name string
↳ packId string
↳ sortOrder int32
↳ spaceId string
↳ textColor boolean
↳ url string | null
↳ width int32
↳ kind "sticker" | "emoji"
↳ packId string
↳ slug string
↳ sortOrder int32
↳ spaceId string
↳ title string
↳ version int64
↳ packId string | null
↳ type string
spaceId string
version string

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" | "createExpressions" | "connect" | "speak" | "video" | "stream" | "canDrawOnStream" | "broadcast" | "useASIO" | "additionalStreams" | "disconnectMember" | "moveMember" | "banMember" | "muteMember" | "kickMember" | "deafenMember" | "manageChannels" | "manageArchetype" | "manageBots" | "manageEvents" | "manageBehaviour" | "manageServer" | "manageMessages" | "manageExpressions"
↳ 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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ 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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string

Messages

A message with files carries them as message.attachments — fileId, url, fileName, size, contentType, and width / height for an image — and null there without files. Its attachment entities carry the same url. See Files & Attachments.

messageCreate Messages MessageCreateEvent

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

Payload

Field Type
channelId string
message BotMessageV1
↳ attachments BotAttachmentV1[] | null
↳ contentType string
↳ fileId string
↳ fileName string
↳ height int32 | null
↳ size int64
↳ url string
↳ width int32 | null
↳ channelId string
↳ controls ControlRowV1[] | null
↳ controls BotControlV1[]
↳ colour OklchColor | null
↳ c float
↳ h float
↳ l float
↳ customId string | null
↳ disabled boolean | null
↳ id string | null
↳ label string | null
↳ labelLocalizations Dictionary`2 | null
↳ maxValues int32 | null
↳ minValues int32 | null
↳ options SelectOptionV1[] | null
↳ default boolean | null
↳ description string | null
↳ label string
↳ value string
↳ placeholder string | null
↳ requiredArchetypeId string | null
↳ type "button" | "stringSelect" | "userSelect" | "archetypeSelect" | "channelSelect"
↳ url string | null
↳ variant "callback" | "link" | null
↳ crosspost BotCrosspostV1 | null
↳ sourceChannelId string
↳ sourceChannelName string
↳ sourceMessageId int64
↳ sourceSpaceId string
↳ sourceSpaceName string
↳ entities BotMessageEntityV1[]
↳ archetypeId string | null
↳ callId string | null
↳ callerId string | null
↳ canonicalUrl string | null
↳ colour int32 | null
↳ contentType string | null
↳ denominator int32 | null
↳ description string | null
↳ domain string | null
↳ durationSeconds int32 | null
↳ email string | null
↳ fileName string | null
↳ fileSize int64 | null
↳ hashtag string | null
↳ height int32 | null
↳ imageUrl string | null
↳ inviterId string | null
↳ length int32
↳ numerator int32 | null
↳ offset int32
↳ path string | null
↳ quotedUserId string | null
↳ siteName string | null
↳ thumbHash string | null
↳ title string | null
↳ type "hashtag" | "mention" | "mentionEveryone" | "mentionRole" | "email" | "url" | "monospace" | "quote" | "spoiler" | "strikethrough" | "bold" | "italic" | "underline" | "fraction" | "ordinal" | "capitalized" | "systemCallStarted" | "systemCallEnded" | "systemCallTimeout" | "systemUserJoined" | "attachment" | "gif" | "linkPreview"
↳ url string | null
↳ userId string | null
↳ width int32 | null
↳ messageId int64
↳ reactions BotReactionV1[] | null
↳ count int32
↳ customEmojiId string | null
↳ emoji string
↳ userIds string[]
↳ replyId int64 | null
↳ sender BotUserV1 | null
↳ avatarUrl string | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string
↳ spaceId string
↳ text string
↳ timeSent string
↳ webhook BotWebhookV1 | null
↳ avatarFileId string | null
↳ name string
↳ webhookId 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 | null
updatedAt string

Presence

presenceUpdate Presence PresenceUpdateEvent

A user's online status or activity changed.

Payload

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

Reactions

For a custom emoji, emoji reads :name:, customEmojiId is its item ID, emojiName its name and emojiUrl its file — null once the emoji is deleted. For a Unicode emoji all three are null. See Reactions.

reactionAdd Reactions ReactionAddEvent

A user added a reaction to a message. For a custom emoji, customEmojiId is its item id, emoji reads :name:, and emojiName and emojiUrl describe it (emojiUrl is null once the emoji is deleted).

Payload

Field Type
channelId string
customEmojiId string | null
emoji string
emojiName string | null
emojiUrl string | null
messageId int64
spaceId string
userId string
reactionRemove Reactions ReactionRemoveEvent

A user removed a reaction from a message. Custom emoji are described as in reactionAdd.

Payload

Field Type
channelId string
customEmojiId string | null
emoji string
emojiName string | null
emojiUrl string | null
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 | null
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 | null
↳ displayName string
↳ flags "none" | "bot" | "system" | "verified" | "premium" | "banned" | "deleted"
↳ locale string | null
↳ userId string
↳ username string
voiceLeave Voice VoiceLeaveEvent

A user left a voice channel.

Payload

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

Next Steps