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

# List audit logs

> Paginated activity log. Responses use the PostgREST-style contract from
`paginatedResponse`: `206 Partial Content` with a `Content-Range` header
when the page is a subset, `200` when it returns everything.




## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/logs.yaml get /api/logs/audits
openapi: 3.0.3
info:
  title: Insforge Logs API
  version: 1.0.0
servers: []
security: []
paths:
  /api/logs/audits:
    get:
      tags:
        - Admin
      summary: List audit logs
      description: |
        Paginated activity log. Responses use the PostgREST-style contract from
        `paginatedResponse`: `206 Partial Content` with a `Content-Range` header
        when the page is a subset, `200` when it returns everything.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            default: 100
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
        - name: actor
          in: query
          schema:
            type: string
          description: Filter by the actor that performed the action
        - name: action
          in: query
          schema:
            type: string
          description: Filter by action name
        - name: module
          in: query
          schema:
            type: string
          description: Filter by the module the action belongs to
        - name: start_date
          in: query
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: All matching audit logs were returned
          headers:
            Content-Range:
              required: true
              schema:
                type: string
              description: Range and total, e.g. `0-9/10`
            Preference-Applied:
              required: true
              schema:
                type: string
              description: Always `count=exact`
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuditLog'
        '206':
          description: A page of audit logs, with more available
          headers:
            Content-Range:
              required: true
              schema:
                type: string
              description: Range and total, e.g. `0-99/1234`
            Preference-Applied:
              required: true
              schema:
                type: string
              description: Always `count=exact`
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuditLog'
              example:
                - id: audit-123
                  actor: admin@example.com
                  action: START_DEPLOYMENT
                  module: DEPLOYMENTS
                  details:
                    id: dep-456
                  ipAddress: 192.168.1.1
                  createdAt: '2024-01-21T10:30:00Z'
                  updatedAt: '2024-01-21T10:30:00Z'
        '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

````