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

# List audit records

> Page through the audit trail with filters. Newest first unless sort=asc.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml get /audit/records
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /audit/records:
    get:
      tags:
        - Audit
      summary: List audit records
      description: Page through the audit trail with filters. Newest first unless sort=asc.
      parameters:
        - name: start_date
          in: query
          description: Start (YYYY-MM-DD or RFC3339)
          schema:
            type: string
        - name: end_date
          in: query
          description: End (YYYY-MM-DD or RFC3339)
          schema:
            type: string
        - name: user
          in: query
          description: User email substring
          schema:
            type: string
        - name: user_id
          in: query
          description: User ID
          schema:
            type: integer
        - name: action
          in: query
          description: Exact action name, e.g. Update LLM
          schema:
            type: string
        - name: resource_type
          in: query
          description: Resource type, e.g. llm
          schema:
            type: string
        - name: resource_id
          in: query
          description: Resource ID
          schema:
            type: string
        - name: method
          in: query
          description: HTTP method
          schema:
            type: string
        - name: status
          in: query
          description: Exact HTTP status
          schema:
            type: integer
        - name: status_class
          in: query
          description: 2xx, 3xx, 4xx or 5xx
          schema:
            type: string
        - name: ip
          in: query
          description: Client IP
          schema:
            type: string
        - name: req_id
          in: query
          description: Request ID
          schema:
            type: string
        - name: search
          in: query
          description: Free text over action, URL, user, resource name, IP, request ID
          schema:
            type: string
        - name: page
          in: query
          description: Page (1-based)
          schema:
            type: integer
        - name: page_size
          in: query
          description: Page size (max 500)
          schema:
            type: integer
        - name: sort
          in: query
          description: asc or desc
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/audit.Page'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
components:
  schemas:
    audit.Page:
      type: object
      properties:
        page:
          type: integer
        page_size:
          type: integer
        records:
          type: array
          items:
            $ref: '#/components/schemas/models.AuditRecord'
        total:
          type: integer
    models.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
    models.AuditRecord:
      type: object
      properties:
        action:
          type: string
          description: What happened
        auth_method:
          type: string
          description: |-
            AuthMethod is how the actor authenticated: "session" (browser
            cookie) or "api_key" (user API key); empty for unauthenticated
            requests such as failed logins.
        diff:
          type: string
          description: |-
            Diff of changed fields for updates, and the final state for deletes.
            Shape: {"field": {"old": <v>, "new": <v>}}. Sensitive columns are
            redacted before storage.
        duration_ms:
          type: integer
        error:
          type: string
        id:
          type: integer
        ip:
          type: string
          description: Actor
        method:
          type: string
        req_id:
          type: string
        request_dump:
          type: string
          description: Populated only when detailed recording is enabled.
        resource_id:
          type: string
        resource_name:
          type: string
        resource_type:
          type: string
          description: What it touched
        response_dump:
          type: string
        route:
          type: string
        status:
          type: integer
        timestamp:
          type: string
        url:
          type: string
        user:
          type: string
        user_agent:
          type: string
        user_id:
          type: integer
        user_name:
          type: string

````