> ## Documentation Index
> Fetch the complete documentation index at: https://sourcebot-brendan-scim-user-provisioning.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List audit records

> Returns a paginated list of audit log entries. Only organization owners can access this endpoint.

<Note>
  This API is only available with an active Sourcebot license. [More information](/docs/activating-a-subscription).
</Note>


## OpenAPI

````yaml /api-reference/sourcebot-public.openapi.json get /api/ee/audit
openapi: 3.0.3
info:
  title: Sourcebot Public API
  version: v5.0.4
  description: >-
    OpenAPI description for the public Sourcebot REST endpoints used for search,
    repository listing, and file browsing. Authentication is instance-dependent:
    API keys are the standard integration mechanism, OAuth bearer tokens are
    EE-only, and some instances may allow anonymous access.
servers: []
security:
  - bearerToken: []
  - apiKeyHeader: []
  - {}
tags:
  - name: Search & Navigation
    description: Code search and symbol navigation endpoints.
  - name: Repositories
    description: Repository listing and metadata endpoints.
  - name: Git
    description: Git history, diff, and file content endpoints.
  - name: System
    description: System health and version endpoints.
  - name: Enterprise (EE)
    description: Enterprise endpoints for user management and audit logging.
paths:
  /api/ee/audit:
    get:
      tags:
        - Enterprise (EE)
      summary: List audit records
      description: >-
        Returns a paginated list of audit log entries. Only organization owners
        can access this endpoint.
      operationId: listAuditRecords
      parameters:
        - schema:
            type: string
            format: date-time
            description: Return records at or after this timestamp (ISO 8601).
          required: false
          description: Return records at or after this timestamp (ISO 8601).
          name: since
          in: query
        - schema:
            type: string
            format: date-time
            description: Return records at or before this timestamp (ISO 8601).
          required: false
          description: Return records at or before this timestamp (ISO 8601).
          name: until
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 100
            default: 50
          required: false
          name: perPage
          in: query
      responses:
        '200':
          description: Paginated audit log.
          headers:
            X-Total-Count:
              description: >-
                Total number of audit records matching the query across all
                pages.
              schema:
                type: integer
            Link:
              description: Pagination links formatted per RFC 8288.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEeAuditResponse'
        '400':
          description: Invalid query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '403':
          description: Insufficient permissions or entitlement not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
        '500':
          description: Unexpected failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiServiceError'
components:
  schemas:
    PublicEeAuditResponse:
      type: array
      items:
        $ref: '#/components/schemas/PublicEeAuditRecord'
    PublicApiServiceError:
      type: object
      properties:
        statusCode:
          type: number
        errorCode:
          type: string
        message:
          type: string
      required:
        - statusCode
        - errorCode
        - message
      description: Structured error response returned by Sourcebot public API endpoints.
    PublicEeAuditRecord:
      type: object
      properties:
        id:
          type: string
        timestamp:
          type: string
          format: date-time
        action:
          type: string
          description: The audited action (e.g. `user.read`, `user.delete`, `audit.fetch`).
        actorId:
          type: string
        actorType:
          type: string
        targetId:
          type: string
        targetType:
          type: string
        sourcebotVersion:
          type: string
        metadata:
          type: object
          nullable: true
          additionalProperties:
            nullable: true
        orgId:
          type: number
      required:
        - id
        - timestamp
        - action
        - actorId
        - actorType
        - targetId
        - targetType
        - sourcebotVersion
        - metadata
        - orgId
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your API key.
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-Sourcebot-Api-Key
      description: >-
        Header of the form `X-Sourcebot-Api-Key: <token>`, where `<token>` is
        your API key.

````