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

# List instance-wide audit events



## OpenAPI

````yaml /api-reference/earnie/audit-openapi.json get /v1/audit-log
openapi: 3.0.3
info:
  title: Earnie Audit Log API
  description: >-
    The organization's immutable compliance history. Requires the `audit:read`
    scope.
  version: 1.0.0
servers:
  - url: https://{tenant}.earnie.dev
    description: Your Earnie deployment
    variables:
      tenant:
        default: your-company
        description: >-
          Your organization's Earnie address, as shown in your browser when you
          sign in.
security:
  - bearerAuth: []
paths:
  /v1/audit-log:
    get:
      summary: List instance-wide audit events
      operationId: getV1AuditLog
      parameters:
        - name: project_id
          in: query
          schema:
            type: string
            format: uuid
        - name: actor_kind
          in: query
          schema:
            type: string
            enum:
              - user
              - api_key
              - integration
              - worker
              - agent
              - unauthenticated
        - name: actor_id
          in: query
          schema:
            type: string
            format: uuid
        - name: event_type
          in: query
          schema:
            type: string
        - name: q
          in: query
          description: >-
            Free-text search. Matches case-insensitively as a literal substring
            against the actor display name or the event type; LIKE
            metacharacters are matched literally. Trimmed, and blank means no
            search. The event payload is deliberately out of scope.
          schema:
            type: string
            maxLength: 200
        - name: from
          in: query
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          schema:
            type: string
            format: date-time
        - name: include_system
          in: query
          schema:
            type: boolean
            default: false
        - name: collapse
          in: query
          description: >-
            Fold like events into one row per occurrence group, keyed on (local
            day, event type, actor, project, subject). The row then reports the
            group's most recent member and carries `occurrence_count`,
            `occurrences`, `occurrences_truncated` and `payloads_vary`, and
            `limit` counts groups rather than events. Opt-in and default off:
            every other consumer keeps one row per event. A cursor minted in one
            mode cannot be replayed in the other.
          schema:
            type: boolean
            default: false
        - name: tz
          in: query
          description: >-
            IANA time zone the collapsed local day is computed in, e.g.
            `Europe/Madrid`. Defaults to UTC. An unrecognized zone is rejected
            rather than silently treated as UTC, because a group collapsed on a
            day the caller did not ask for would straddle two of their day
            headings.
          schema:
            type: string
            maxLength: 64
        - name: cursor
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        '200':
          description: Audit events ordered newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogResponse'
        '400':
          description: Invalid filter or cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Missing audit:read.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AuditLogResponse:
      type: object
      required:
        - events
        - actors
        - event_types
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/AuditLogEvent'
        actors:
          type: array
          items:
            $ref: '#/components/schemas/AuditActorFacet'
        event_types:
          type: array
          items:
            type: string
        next_cursor:
          type: string
          nullable: true
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    AuditLogEvent:
      type: object
      required:
        - id
        - actor
        - event_type
        - payload
        - occurred_at
      properties:
        id:
          type: string
          format: uuid
        actor:
          $ref: '#/components/schemas/AuditActor'
        event_type:
          type: string
        payload:
          type: object
          additionalProperties: true
        occurred_at:
          type: string
          format: date-time
        project_id:
          type: string
          format: uuid
          nullable: true
        subject_kind:
          type: string
          nullable: true
        subject_id:
          type: string
          format: uuid
          nullable: true
        occurrence_count:
          type: integer
          description: >-
            Size of the occurrence group this row collapses, counting every
            member and not just the ones this page loaded. Present only when
            `collapse=true`; absent otherwise, so a default read is unchanged.
        occurrences:
          type: array
          description: >-
            Occurrence timestamps of the group, newest first, capped at 50.
            Present only when `collapse=true`.
          items:
            type: string
            format: date-time
        occurrences_truncated:
          type: boolean
          description: >-
            The group holds more members than `occurrences` lists. Present only
            when `collapse=true`.
        payloads_vary:
          type: boolean
          description: >-
            Two members of the group disagreed on their payload. Members are
            identical on the grouping key but NOT on their payloads — an
            `authentication.failed` run carries a different reason and remote_ip
            per occurrence — so the single payload on this row does not speak
            for all of them. Present only when `collapse=true`.
    AuditActorFacet:
      type: object
      required:
        - kind
        - id
      properties:
        kind:
          type: string
          enum:
            - user
            - api_key
            - integration
            - worker
            - agent
            - unauthenticated
        id:
          type: string
          format: uuid
        display:
          type: string
          nullable: true
    AuditActor:
      type: object
      required:
        - kind
        - id
      properties:
        kind:
          type: string
          enum:
            - user
            - api_key
            - integration
            - worker
            - agent
            - unauthenticated
        id:
          type: string
          format: uuid
        display:
          type: string
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An Earnie API key, sent as `Authorization: Bearer sk_earnie_...`. Create
        one under Settings > API keys. The key's scopes decide which operations
        it may call.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.