> ## Documentation Index
> Fetch the complete documentation index at: https://docs.insforge.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get audit log summary

> Aggregates the audit log over the last `days` days. `totalLogs`,
`uniqueActors` and `uniqueModules` are counts across that window,
`actionsByModule` is the per-module action count keyed by module
name, and `recentActivity` carries the most recent entries in full.




## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/logs.yaml get /api/logs/audits/stats
openapi: 3.0.3
info:
  title: Insforge Logs API
  version: 1.0.0
servers: []
security: []
paths:
  /api/logs/audits/stats:
    get:
      tags:
        - Admin
      summary: Get audit log summary
      description: |
        Aggregates the audit log over the last `days` days. `totalLogs`,
        `uniqueActors` and `uniqueModules` are counts across that window,
        `actionsByModule` is the per-module action count keyed by module
        name, and `recentActivity` carries the most recent entries in full.
      parameters:
        - name: days
          in: query
          schema:
            type: integer
            default: 7
          description: Size of the window the summary covers
      responses:
        '200':
          description: Audit activity over the window
          content:
            application/json:
              schema:
                type: object
                required:
                  - totalLogs
                  - uniqueActors
                  - uniqueModules
                  - actionsByModule
                  - recentActivity
                properties:
                  totalLogs:
                    type: integer
                  uniqueActors:
                    type: integer
                  uniqueModules:
                    type: integer
                  actionsByModule:
                    type: object
                    additionalProperties:
                      type: integer
                    description: Action count keyed by module
                  recentActivity:
                    type: array
                    items:
                      $ref: '#/components/schemas/AuditLog'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    AuditLog:
      type: object
      required:
        - id
        - actor
        - action
        - module
        - details
        - ipAddress
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        actor:
          type: string
        action:
          type: string
        module:
          type: string
        details:
          type: object
          nullable: true
          additionalProperties: true
        ipAddress:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          description: Error code for programmatic handling
        message:
          type: string
          description: Human-readable error message
        statusCode:
          type: integer
          description: HTTP status code
        nextActions:
          type: string
          description: Suggested action to resolve the error
  responses:
    Unauthorized:
      description: Missing or invalid admin credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: AUTH_INVALID_CREDENTIALS
            message: Unauthorized
            statusCode: 401
    Forbidden:
      description: Authenticated, but the token is not a project_admin
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: AUTH_UNAUTHORIZED
            message: Admin access required
            statusCode: 403
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````