Ellchat Bot API
Create a bot in Settings → Developer, copy its token once, and build permission-aware server integrations over HTTPS.
Effective and last updated: 23 August 2026Authentication
Send Authorization: Bot YOUR_TOKEN with every request. Requests use JSON unless an endpoint says otherwise. A bot can access only servers it has joined and every operation is checked against its server roles and channel overrides.
Built-in automation
Bot owners can configure a log channel, member-event logs, moderation logs, deleted-message logs, and an autorole directly in Settings → Developer. The bot needs Send Messages in its log channel; autoroles also require Manage Roles and correct role hierarchy.
Base URL and versioning
Use your Ellchat deployment origin, for example https://ellchat-beta.wispbyte.org. The current API is beta and uses the /api/bot namespace. Ellchat IDs are opaque strings, timestamps use ISO 8601, list endpoints are bounded or cursor-paginated, and breaking changes will be announced before a stable version is introduced.
Realtime gateway
Hosted bots connect to the Socket.IO /bot namespace with auth: { token: "YOUR_BOT_TOKEN" }. A successful connection immediately marks the bot Online and dispatches READY, message, reaction, poll, presence, channel-activity and server-update events. Send a heartbeat every 25 seconds and call gateway:sync after your bot joins a server or creates channels.
import { io } from "socket.io-client";
const gateway = io("https://your-ellchat.example/bot", {
transports: ["websocket"],
auth: { token: process.env.ELLCHAT_BOT_TOKEN }
});
gateway.on("dispatch", event => {
console.log(event.s, event.t, event.d);
});
setInterval(() => gateway.emit("heartbeat", null, console.log), 25_000);Endpoints
/api/bot/meRead the authenticated bot identity and server memberships.
/api/bot/gatewayDiscover the authenticated Socket.IO gateway, heartbeat interval and supported events.
/api/bot/servers/{serverId}Read server identity, badges and resource counts.
/api/bot/channels/{channelId}/messagesRead history or send text, replies and up to five buttons.
/api/bot/messages/{messageId}Read, edit or delete messages. Managing another author's message requires Manage Messages.
/api/bot/messages/{messageId}/reactionsAdd, replace or remove the bot's reaction.
/api/bot/servers/{serverId}/channelsList visible channels or create one with Manage Channels.
/api/bot/channels/{channelId}Read, edit or delete one channel with channel permission checks.
/api/bot/servers/{serverId}/categoriesList or create channel categories.
/api/bot/categories/{categoryId}Rename or delete a category with Manage Channels.
/api/bot/interactionsPoll pending button interactions with cursor pagination.
/api/bot/interactions/{interactionId}/callbackReply privately (ephemeral) or post a channel response.
/api/bot/servers/{serverId}/configurationConfigure event logs and an automatic member role.
/api/bot/servers/{serverId}/membersList server members visible to the bot.
/api/bot/servers/{serverId}/members/{userId}Read a member or update their server nickname.
/api/bot/servers/{serverId}/rolesList or create server roles and permissions.
/api/bot/roles/{roleId}Read, edit or delete a role within the bot's hierarchy.
/api/bot/servers/{serverId}/invitesList active invites or create a limited, expiring invite.
/api/bot/invites/{code}Revoke an invite.
/api/bot/servers/{serverId}/audit-logsRead recent moderation and administration events.
/api/bot/servers/{serverId}/members/{userId}/rolesAdd roles (POST) or replace the role set (PUT) within the bot's hierarchy.
/api/bot/servers/{serverId}/members/{userId}/moderationTime out or untime a member (POST), or kick them (DELETE).
/api/bot/servers/{serverId}/bansList bans, ban a member, or unban with the userId query parameter.
Send buttons
curl -X POST "https://your-ellchat.example/api/bot/channels/CHANNEL_ID/messages" -H "Authorization: Bot YOUR_TOKEN" -H "Content-Type: application/json" -d '{"content":"Choose an action","components":[{"type":"button","label":"Open ticket","style":"PRIMARY","customId":"ticket.open"},{"type":"button","label":"Help page","style":"LINK","url":"https://example.com/help"}]}'Handle interactions
Poll GET /api/bot/interactions. A pending interaction expires after 15 minutes. Acknowledge it by posting {"content":"Ticket opened","ephemeral":true} to its callback endpoint. Ephemeral responses are delivered over Ellchat's authenticated user WebSocket and are visible only to the person who pressed the button.
Permissions and live members
Every mutation checks the bot's actual server roles, channel overrides and role hierarchy. The same realtime server-update stream refreshes member lists for connected people and notifies bot gateways when members, roles, channels or moderation state change.
Errors and limits
Successful responses use 2xx status codes. Errors return JSON with an error.code and human-readable error.message. Handle 401, 403, 404, 409 and 429 explicitly. Bots are subject to rate limits and must back off when a response is 429.
Safety rules
Do not use bots for unsolicited messages, scraping, account automation, surveillance, permission bypasses, or destructive moderation. Bot accounts carry a visible BOT tag, cannot be friended, and cannot receive direct messages.