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

# Get Audit Log

> Get a single audit log entry by ID.

Includes full details and integrity chain information.
Only superadmins can access audit logs.
PII is masked unless the user belongs to the 'pii_access' group.



## OpenAPI

````yaml get /api/v1/audit-logs/{log_id}
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/audit-logs/{log_id}:
    get:
      tags:
        - audit-logs
      summary: Get Audit Log
      description: |-
        Get a single audit log entry by ID.

        Includes full details and integrity chain information.
        Only superadmins can access audit logs.
        PII is masked unless the user belongs to the 'pii_access' group.
      operationId: get_audit_log_api_v1_audit_logs__log_id__get
      parameters:
        - name: log_id
          in: path
          required: true
          schema:
            type: integer
            title: Log Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogResponse'
        '403':
          description: Superadmin access required
        '404':
          description: Audit log entry not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AuditLogResponse:
      properties:
        id:
          type: integer
          title: Id
          description: Unique identifier (sequence number)
        account_id:
          type: string
          title: Account Id
          description: Account context (UUID)
        operation:
          type: string
          title: Operation
          description: 'Operation type: CREATE, UPDATE, DELETE'
        table_name:
          type: string
          title: Table Name
          description: Table/collection name
        record_id:
          type: string
          title: Record Id
          description: ID of the affected record
        column_name:
          type: string
          title: Column Name
          description: Name of the changed column
        old_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Old Value
          description: Previous value
        new_value:
          anyOf:
            - type: string
            - type: 'null'
          title: New Value
          description: New value
        user_id:
          type: string
          title: User Id
          description: ID of user who made the change
        user_email:
          type: string
          title: User Email
          description: Email of user who made the change
        user_name:
          type: string
          title: User Name
          description: Name of user who made the change
        es_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Es Username
          description: Electronic signature username
        es_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Es Reason
          description: Electronic signature reason
        es_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Es Timestamp
          description: Electronic signature timestamp
        ip_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Ip Address
          description: Client IP address
        user_agent:
          anyOf:
            - type: string
            - type: 'null'
          title: User Agent
          description: User agent string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Correlation ID
        occurred_at:
          type: string
          format: date-time
          title: Occurred At
          description: Timestamp of the change (UTC)
        checksum:
          anyOf:
            - type: string
            - type: 'null'
          title: Checksum
          description: SHA-256 hash of this entry
        previous_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Hash
          description: Checksum of the previous entry
        extra_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Extra Metadata
          description: Additional metadata
      type: object
      required:
        - id
        - account_id
        - operation
        - table_name
        - record_id
        - column_name
        - user_id
        - user_email
        - user_name
        - occurred_at
      title: AuditLogResponse
      description: Response for a single audit log entry.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````