Community server API
Every Tusile community server, hosted or self-hosted, exposes the same HTTP API. The apps are built on it. This page is a map of it; for full request and response payloads, open the interactive test page every community server serves at GET /test, for example https://your-community-host/test.
Bots use their own token and the /bot/* routes, which are documented in Write a bot.
Authentication
Section titled “Authentication”Protected routes take Authorization: Bearer <token>.
- Cloud server: the token is the access token your Tusile account gets when you sign in. The server checks it against Tusile’s public key.
- Offgrid server: the token is the
access_tokenthat server’s ownPOST /auth/loginreturns. Those accounts exist on that server only.
Permissions are checked per channel, exactly as in the app: a route answers 403 when your roles do not allow the action.
Endpoint groups
Section titled “Endpoint groups”| Routes | What they do |
|---|---|
GET /health |
Service and database health: {"status":"ok"}, or 503 with {"status":"unhealthy"} when the database is unreachable. No auth. |
GET /info |
What the app reads before you join: server_id, offgrid, livekit_url, name, icon_url, registration_mode, allow_guest_join, and member_count on openly joinable servers. Offgrid servers add owner_id and claim_available. No auth. |
/auth/register, /auth/login, /auth/refresh, /auth/logout, /auth/change-password |
Local accounts. Offgrid servers only; these routes do not exist on Cloud. |
/categories, /channels, /channels/{id}/messages, /messages/{id}, /threads, /polls |
Channels, categories, message history, sending and editing, threads and polls. |
/channels/{id}/messages/search, /channels/{id}/pinned, /channels/unread |
Search, pins and unread state. |
/roles, /members, /invites, /bans, /settings |
Access control, moderation and server settings. |
/members/{userId}/timeout, /timeouts/everyone, /timeouts/roles/{roleId} |
Timeouts for one member, everyone, or a role. |
POST /livekit/token |
A room token for voice and video, plus the LiveKit URL to connect to. Needs the Connect permission on the channel. |
/voice/presence, /voice/move, /voice/disconnect, /voice/server-mute, /voice/server-deafen |
Who is in voice, and voice moderation. |
/uploads, /emojis, /stickers, /soundboard |
Files, custom emoji, stickers and soundboard sounds. |
GET /ws |
The real-time WebSocket the apps use for new messages, presence and updates. |
/bot/*, GET /bot/gateway |
The bot API. See Write a bot. |
Example requests
Section titled “Example requests”Get a voice token for a channel. The room name is always channel_ followed by the channel ID:
POST /livekit/tokenAuthorization: Bearer <token>Content-Type: application/json
{"room": "channel_<channelId>"}{"token": "...", "url": "wss://your-community-host:7880"}Send a message:
POST /channels/<channelId>/messagesAuthorization: Bearer <token>Content-Type: application/json
{"content": "Hello from Tusile"}Check a server before connecting:
curl https://your-community-host/healthcurl https://your-community-host/info