Audit Logs
Overview
Fetch a paginated audit trail of tenant moderation and governance actions - bans, mutes, report resolutions, settings changes, and related events - for the Platform Moderation → Audit view.
Each log entry records who acted (actorType / actorName), what happened (action), and an optional target plus structured details.
When to use this endpoint?
Use Audit Logs when:
- Opening Platform → Moderation → Audit to review recent actions.
- Confirming a ban, mute, unban, or report resolution was recorded.
- Building a timeline table with actor, action slug, target, and timestamp.
- Reading
paginationto page through a long history.
Part of the client Platform Moderation module. This endpoint is read-only - actions themselves are performed via List/Resolve Reports, Mute, Ban, and Settings endpoints.
Response Data
data.list is an array of audit entries. data.pagination describes the current page.
Log entry fields
pagination
{baseUrl}/api/{apiVersion}/client/audit-logs- Authentication
- Required (Bearer token)
- Tenant-scoped
- Yes (tenant DB - requires x-client-id)
Request Headers
This endpoint has no request body. Call it with tenant headers only; pagination metadata is returned using server defaults.
Success Response (HTTP 200 OK)
On success, the API returns a paginated list of audit log entries.
{ "success": true, "message": "Audit logs fetched successfully", "data": { "list": [ { "_id": "6a589c09c43829ebc51a80ed", "actorType": "client", "actorId": "6a589b96cfa34ab66e35b2a9", "actorName": "Mod Test", "action": "moderation.user-banned", "targetType": "user", "targetId": "6a589b96cfa34ab66e35b2ab", "details": { "userName": "Bad Actor" }, "createdAt": "2026-07-16T08:53:29.542Z", "updatedAt": "2026-07-16T08:53:29.542Z", "__v": 0 } ], "pagination": { "currentPage": 1, "totalCount": 4, "hasNextPage": false, "hasPreviousPage": false, "pageSize": 20 } }, "error": null}Common Errors
Fetch fails when the token is missing/invalid or the caller is not a tenant admin.
HTTP 401 Unauthorized - No token
{ "success": false, "message": "No token, authorization denied", "data": null, "error": "Unauthorized"}HTTP 403 Forbidden - Tenant admin required
{ "success": false, "message": "Access denied: tenant admin privileges required", "data": null, "error": null}Best Practices
- Humanize
actionslugs in the UI (for examplemoderation.user-banned→ "User banned"). - Expand
detailson demand - shapes differ by action. - Badge
actorTypeso workspace admin, super admin, and end-user actions are easy to scan. - Refetch after Mute, Ban, or Resolve so new entries appear promptly.
- Restrict audit content to trusted Platform admins - it can include user names and moderation decisions.
Audit trail ready
Use the list to verify moderation actions. To change state, go back to List Reports, Mute / Unmute User, or Ban / Unban User.