Skip to content
13 interfaces · 34 routes · 25 events · REST + SSE

Build Bots for
Argon

Send messages, manage roles, stream voice, handle slash commands, and react to events in real-time. A developer-first API with typed contracts, per-interface versioning, and hash-verified stability.

Send a message with a button
POST /IMessages/v1/Send

{ "channelId": "d3f1a2b4-...",
  "text": "Hello from my bot!",
  "randomId": 1,
  "controls": [[{"type": "Button", "label": "Click me", "id": "btn_hello"}]]
}
13
API Interfaces
34
Endpoints
25
Event Types
14
Intent Flags

Everything you need to build

From simple message bots to full-featured applications with voice, interactive controls, and role management.

Messages

Send messages with rich formatting — bold, italic, spoilers, mentions, links, and file attachments. Query history with pagination.

IMessages →

Real-time Events

Server-Sent Events stream with intent filtering, automatic reconnection, and event replay. Never miss a message or interaction.

Events Guide →

Slash Commands

Register commands with typed options (string, integer, user, channel, role). Receive interactions with full context.

ICommands →

Interactive Controls

Buttons, select menus, and modal dialogs. Build interactive UIs directly in chat messages with callback handling.

Controls Guide →

Voice Streaming

Stream Opus audio over WebSocket ingress. Build music bots, TTS, live audio processing — no WebRTC needed.

Voice Guide →

Archetypes & Roles

Query archetypes, inspect role assignments, list members by role. Permission-aware — detailed access only for authorized bots.

IArchetypes →

Typing Indicators

Show typing, thinking, uploading, or searching status in channels. Auto-expires after 8 seconds — refresh to keep active.

ITyping →

Stable Contracts

Each interface versioned independently with SHA-256 hash verification. Breaking changes are impossible without a version bump.

Glossary →

Rate Limiting

Sliding window rate limits per interface. 11 policies, 10 concurrent requests per bot. Retry-After headers included.

Rate Limits →

All Interfaces at a Glance

11 stable, 2 draft — each versioned and documented independently.

Interface Routes Status
IArchetypes 3 stable
IBotSelf 2 stable
ICalls 4 draft
IChannels 3 stable
ICommands 5 stable
IEvents 1 stable
IInteractions 5 stable
IMembers 1 stable
IMessages 2 stable
ISpaces 3 stable
ITyping 2 stable
IVoice 1 stable
IVoiceEgress 2 draft

Live Event Stream

Open a single SSE connection with an intent bitmask and receive events as they happen. Messages, member joins, typing indicators, voice activity, role changes — all in one stream.

25 event types across 14 intent categories
Automatic replay on reconnection — no events lost
30-second heartbeats with cursor for reliable resume
Standard SSE — works with EventSource, curl, any HTTP client
Events Guide
SSE stream — live events
event: ready
data: {"intents":12269,"spaceIds":["a1b2...","c3d4..."]}

event: messageCreate
data: {"spaceId":"a1b2...","channelId":"e5f6...",
       "message":{"text":"Hey bot!","sender":{ ... }}}

event: typingStart
data: {"spaceId":"a1b2...","channelId":"e5f6...",
       "userId":"u7v8...","kind":"typing"}

event: commandInteraction
data: {"interactionId":"i9j0...",
       "commandName":"play","user":{ ... },
       "options":[{"name":"url","value":"..."}]}

event: controlInteraction
data: {"interactionId":"k1l2...",
       "controlId":"btn_hello","user":{ ... }}

event: heartbeat
data: {"timestamp":40953660000}

Three steps to your first bot

1

Create a Bot Application

Go to console.argon.gl → Apps → Create Application → choose Bot App → pick a username ending in _bot.

2

Authenticate

Copy your bot token and include it in every request:

Authorization: Bot <your-token>
3

Send your first message

POST to the Messages interface:

$ curl -X POST \
  -H "Authorization: Bot YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channelId":"...","text":"Hello!","randomId":1}' \
  https://gateway.argon.zone/IMessages/v1/Send

→ {"messageId": 42}

No SDK required

Plain HTTP — use whatever language and runtime you prefer.

TypeScript / Bun
const res = await fetch(
  "https://gateway.argon.zone/IMessages/v1/Send",
  {
    method: "POST",
    headers: {
      "Authorization": `Bot ${TOKEN}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      channelId: "d3f1a2b4-...",
      text: "Hello!",
      randomId: Date.now(),
    }),
  }
);

const { messageId } = await res.json();
C# / .NET
var client = new HttpClient();
client.DefaultRequestHeaders.Add(
    "Authorization", $"Bot {token}");

var resp = await client.PostAsJsonAsync(
    "https://gateway.argon.zone/IMessages/v1/Send",
    new {
        channelId = "d3f1a2b4-...",
        text = "Hello!",
        randomId = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
    });

var result = await resp.Content
    .ReadFromJsonAsync<SendResult>();
SSE Events (TypeScript)
import EventSource from "eventsource";

const es = new EventSource(
  "https://gateway.argon.zone/IEvents/v1/Stream"
  + "?intents=12269",
  { headers: { Authorization: `Bot ${TOKEN}` } }
);

es.addEventListener("messageCreate", (e) => {
  const msg = JSON.parse(e.data);
  console.log(`${msg.message.sender.username}: ${msg.message.text}`);
});

es.addEventListener("commandInteraction", (e) => {
  const cmd = JSON.parse(e.data);
  console.log(`/${cmd.commandName} by ${cmd.user.username}`);
});

Guides

Step-by-step guides for every aspect of the Bot API.