Platform Features

Audit Logs

Audit logs provide a historical record of administrative actions taken in a server, such as member kicks, role updates, and channel deletions.

Querying Logs

A bot can retrieve logs only after it has joined the server and has the VIEW_AUDIT_LOG permission. The server owner must assign that permission to the bot's role. The bot token is available in Developer Portal → Applications → Bot Settings. Keep it secret and store it on your server, never in browser code.

GET /api/audit?serverId=SERVER_ID&limit=50 Authorization: Bot YOUR_BOT_TOKEN

Human users authenticate with their signed-in ModVC session instead. The web and mobile clients obtain a short-lived Firebase ID token automatically and send it as Authorization: Bearer USER_ID_TOKEN; users must also be server members withVIEW_AUDIT_LOG, administrator, or owner access.

Access checks: 401 means the token is missing or invalid;403 means the identity is not a server member or lacks the required permission; 404 means the server does not exist.

Creating Log Entries

When your bot performs an action via the Bot API (like kicking a user), ModVC automatically generates an audit log entry on your behalf.

However, if your bot performs a custom action (like a custom moderation command internal to your bot's database), you can manually insert a log entry so server admins can see it in their dashboard.

POST /api/audit Authorization: Bot YOUR_BOT_TOKEN Content-Type: application/json { "server_id": "server_123", "action": "custom_bot_action", "target_id": "user_456", "details": "User flagged for spam" }

For bot requests, the API records the authenticated bot identity itself. Client-provideduser_id, user_name, and avatar values are ignored, so a bot cannot impersonate another user in the audit history.