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.
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.
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.
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.