> ## 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 per-source log statistics

> One entry per system log source. This is not the audit-log summary;
that lives at `/api/logs/audits/stats`.




## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/logs.yaml get /api/logs/stats
openapi: 3.0.3
info:
  title: Insforge Logs API
  version: 1.0.0
servers: []
security: []
paths:
  /api/logs/stats:
    get:
      tags:
        - Admin
      summary: Get per-source log statistics
      description: |
        One entry per system log source. This is not the audit-log summary;
        that lives at `/api/logs/audits/stats`.
      responses:
        '200':
          description: Statistics for each log source
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - source
                    - count
                    - lastActivity
                  properties:
                    source:
                      type: string
                    count:
                      type: integer
                    lastActivity:
                      type: string
                      description: |
                        ISO 8601 timestamp of the most recent entry, or an
                        empty string when the source has no activity to
                        report. Not marked format: date-time for that reason.
              example:
                - source: postgres
                  count: 1035
                  lastActivity: '2024-01-21T10:31:00Z'
                - source: deno-relay
                  count: 47
                  lastActivity: '2024-01-21T09:58:00Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - bearerAuth: []
        - apiKey: []
components:
  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
  schemas:
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````