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

# Aggregate PII scrub stats



## OpenAPI

````yaml /api-reference/openapi.json get /v1/privacy/audit-stats
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.21.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/privacy/audit-stats:
    get:
      tags:
        - privacy
      summary: Aggregate PII scrub stats
      operationId: getPrivacyAuditStats
      parameters:
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
        - name: bucket
          in: query
          required: false
          schema:
            enum:
              - day
              - hour
            type: string
            default: day
            title: Bucket
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditStatsResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AuditStatsResponse:
      properties:
        period_start:
          type: string
          format: date-time
          title: Period Start
        period_end:
          type: string
          format: date-time
          title: Period End
        total_events:
          type: integer
          title: Total Events
        total_detections:
          type: integer
          title: Total Detections
        by_source:
          additionalProperties:
            type: integer
          type: object
          title: By Source
        by_entity_type:
          items:
            $ref: '#/components/schemas/AuditEntityStat'
          type: array
          title: By Entity Type
        trend:
          items:
            $ref: '#/components/schemas/AuditTrendBucket'
          type: array
          title: Trend
      type: object
      required:
        - period_start
        - period_end
        - total_events
        - total_detections
        - by_source
        - by_entity_type
        - trend
      title: AuditStatsResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AuditEntityStat:
      properties:
        entity_type:
          type: string
          title: Entity Type
        event_count:
          type: integer
          title: Event Count
      type: object
      required:
        - entity_type
        - event_count
      title: AuditEntityStat
    AuditTrendBucket:
      properties:
        bucket_start:
          type: string
          format: date-time
          title: Bucket Start
        event_count:
          type: integer
          title: Event Count
        detection_count:
          type: integer
          title: Detection Count
      type: object
      required:
        - bucket_start
        - event_count
        - detection_count
      title: AuditTrendBucket
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````