API key
Pass your API secret in thex-api-secret request header. The secret is configured on the server via the BOT_API_SECRET environment variable.
JWT Bearer token
The web dashboard uses Discord OAuth2 to obtain a signed JWT. You can use the same flow for programmatic access.Initiate the OAuth2 flow
Redirect the user to the Discord authorization page:The server redirects to Discord’s OAuth2 authorization page with
identify guilds scopes.Handle the callback
After the user authorizes, Discord redirects to
GET /api/v1/auth/discord/callback with an authorization code and state parameter. The server:- Validates the CSRF
state - Exchanges the
codefor a Discord access token - Fetches the user’s Discord profile
- Creates a signed JWT (HS256, 1-hour expiry)
- Sets the token in an
httpOnlycookie and redirects to the dashboard
Get the current user
Verify a token and retrieve the authenticated user’s profile:Log out
Invalidate the server-side session:Token expiry
JWT tokens expire after 1 hour. After expiry, re-initiate the OAuth2 flow to obtain a new token. The server-side session is stored in Redis; logging out invalidates it immediately even if the JWT has not expired.Public endpoints
The following endpoints require no authentication:| Endpoint | Description |
|---|---|
GET /health | Basic health check |
GET /stats | Public bot statistics |
GET /community/{guildId}/leaderboard | XP leaderboard |
GET /community/{guildId}/showcases | Project showcase gallery |
GET /community/{guildId}/stats | Community statistics |
GET /community/{guildId}/profile/{userId} | Public user profile |