Documentation Index
Fetch the complete documentation index at: https://docs.7331.org/llms.txt
Use this file to discover all available pages before exploring further.
Permission Levels
Every user has a permission level that determines what admin actions they can perform. The hierarchy is strict — you can only act on users below your level (except Owners, who can act on each other).
| Level | Value | Description |
|---|
| User | 0 | Default. Self-service only — manage own profile and sessions. Premium users can create chats. |
| Admin | 2 | Full admin panel. Can ban, delete, manage subscriptions, and assign permissions up to User. |
| Owner | 3 | Unrestricted. Can act on everyone including other Owners. Can assign permissions up to Admin. |
What each level can access
User (level 0)
Public endpoints (no login required, just X-API-Key):
GET /statistics/users — View user count statistics
GET /statistics/bots — View bot count statistics by verification status
GET /statistics/chats — View active browser statistics
GET /statistics/app — View application-level statistics
GET /bots — List public bots
GET /bots/{id} — View a bot’s public profile
GET /users/{id} — View a user’s public profile
Authenticated endpoints (session cookie required):
GET /users/me — View own profile
GET /users/me/subscription — View own subscription status
GET /users/me/punishments — Own moderation action history
GET /users/me/sessions — List own sessions
POST /users/me/sessions/{token_suffix}/destroy — Revoke a session by its 6-character token suffix
GET /users/search — Search users (returns public profiles)
GET /bots/search — Search bots (returns public profiles)
Note: Session TTL varies by permission level — admin and above get 1-day sessions, while regular users get 30-day sessions.
Admin (level 2)
Everything a User can access, plus:
GET /bots/search — Search bots (full details)
GET /users/search — Search users (full details, only sees users below their level)
GET /users/{id} — Full user detail (no redaction, includes subscription history)
GET /bots/{id} — Full bot detail (owner, rate limits, type)
Admin CLI (admin_tools.py) — all admin operations are CLI-only, not REST endpoints:
user moderation (ban, unban, warn, timeout), permission management (promote, demote), bot management (create, set type), subscription management (grant, revoke), notifications (targeted/broadcast), and announcements (create, delete).
Owner (level 3)
Same as Admin, but:
- Can act on all users including other Owners and Admins
- Can assign permissions up to Admin (Admins can only assign up to User)
Subscription Tiers
Subscription tiers control feature access, not admin permissions. They apply to users and influence chat creation limits alongside permission level.
| Tier | Value | Duration | Description |
|---|
| Basic | 0 | — | Default. Standard features only. |
| Trial | 1 | 7 days (forced) | One-time trial. Same access as Premium. Cannot be granted twice. |
| Premium | 2 | Set by admin | Paid subscription with expiration date. |
| Lifetime | 3 | Permanent | Never expires. subscription_expires_at is null. |
has_premium is true for any active non-Basic tier (Trial, Premium, or Lifetime with valid expiry).
- Expired Trial/Premium subscriptions are automatically downgraded to Basic by a background task.
- Trial eligibility is checked via audit log history — once granted, it cannot be granted again.
Chat Creation Slots
Chat slots are determined by both permission level and subscription tier. Admins and Owners receive slots regardless of subscription status:
| Role / Tier | Chat Slots |
|---|
| Basic (User) | 0 — cannot create chats |
| Trial / Premium (User) | 1 chat |
| Admin | 5 chats (regardless of subscription) |
| Owner | Unlimited chats |
User States
| State | Value | Description |
|---|
| Active | 0 | Normal — can log in and use all features. |
| Timeout | 1 | Temporarily restricted — cannot execute commands. |
| Banned | 2 | Permanently blocked — cannot log in or interact. |
Bot Types
| Type | Value | Description |
|---|
| Official | 1 | First-party bots managed by the platform. |
| Verified | 2 | Third-party bots that passed review. |
| Community | 3 | Default — unverified community bots. |
Bot API Access
Registered bots authenticate with X-API-Key and have their own set of endpoints:
GET /bot/me — View own bot profile
POST /bot/me/update — Update own info (name, avatar) and/or stats (users, latency) in a single call
POST /bot/batch — Batch report command executions
GET /bot/users/{user_id} — Look up a user
POST /bot/users/{user_id}/update — Update a user’s info (username, avatar)
Bots are rate-limited per their rate_limit_per_hour setting (configured by admins).