openapi: 3.1.0
info:
  title: NeutralAI Gateway
  description: Canonical NeutralAI Gateway integration contract for auth discovery,
    chat, shield, documents, billing, compliance, extension control plane, and admin
    APIs.
  version: v1.0.4
  x-neutralai-contract-version: v1.0.4
  contact:
    name: NeutralAI support
    email: support@neutralai.co.uk
paths:
  /health:
    get:
      summary: Health Check
      operationId: health_check_health_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /live:
    get:
      summary: Live Check
      operationId: live_check_live_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /ready:
    get:
      summary: Readiness Check
      operationId: readiness_check_ready_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /deployment:
    get:
      summary: Deployment Metadata
      operationId: deployment_metadata_deployment_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /metrics:
    get:
      summary: Metrics Endpoint
      operationId: metrics_endpoint_metrics_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /security.txt:
    get:
      summary: Security Txt Root
      operationId: security_txt_root_security_txt_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /.well-known/security.txt:
    get:
      summary: Security Txt Well Known
      operationId: security_txt_well_known__well_known_security_txt_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /v1/policies:
    get:
      tags:
      - policies
      summary: List Policies
      description: List all custom PII policies.
      operationId: list_policies_v1_policies_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CustomRuleResponse'
                type: array
                title: Response List Policies V1 Policies Get
      security:
      - HTTPBearer: []
    post:
      tags:
      - policies
      summary: Create Policy
      description: Create a new custom PII policy.
      operationId: create_policy_v1_policies_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRuleCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRuleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/policies/{policy_id}:
    delete:
      tags:
      - policies
      summary: Delete Policy
      description: Delete a custom PII policy.
      operationId: delete_policy_v1_policies__policy_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: policy_id
        in: path
        required: true
        schema:
          type: string
          title: Policy Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - policies
      summary: Update Policy
      description: Update an existing custom PII policy.
      operationId: update_policy_v1_policies__policy_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: policy_id
        in: path
        required: true
        schema:
          type: string
          title: Policy Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRuleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRuleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/policies/self-service:
    get:
      tags:
      - policies
      summary: List Self Service Policies
      description: List custom rules for the current authenticated user's tenant.
      operationId: list_self_service_policies_v1_policies_self_service_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CustomRuleResponse'
                type: array
                title: Response List Self Service Policies V1 Policies Self Service
                  Get
      security:
      - HTTPBearer: []
    post:
      tags:
      - policies
      summary: Create Self Service Policy
      description: Create a policy in the current user's tenant (Pro tiers only).
      operationId: create_self_service_policy_v1_policies_self_service_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRuleCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRuleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/policies/self-service/{policy_id}:
    patch:
      tags:
      - policies
      summary: Update Self Service Policy
      description: Update a policy in the current user's tenant (Pro tiers only).
      operationId: update_self_service_policy_v1_policies_self_service__policy_id__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: policy_id
        in: path
        required: true
        schema:
          type: string
          title: Policy Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomRuleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomRuleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - policies
      summary: Delete Self Service Policy
      description: Delete a policy in the current user's tenant (Pro tiers only).
      operationId: delete_self_service_policy_v1_policies_self_service__policy_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: policy_id
        in: path
        required: true
        schema:
          type: string
          title: Policy Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/policies/assistant/draft:
    post:
      tags:
      - policies
      summary: Generate Policy Assistant Draft
      description: Generate a policy draft from plain-language intent.
      operationId: generate_policy_assistant_draft_v1_policies_assistant_draft_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyAssistantDraftRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyAssistantDraftResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/policies/explain:
    post:
      tags:
      - policies
      summary: Explain Regex
      description: Use AI to explain a regex pattern in plain English.
      operationId: explain_regex_v1_policies_explain_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegexExplainRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegexExplainResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/policies/test:
    post:
      tags:
      - policies
      summary: Test Policy
      description: Test a regex pattern against sample text to see matches.
      operationId: test_policy_v1_policies_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/policies/simulate:
    post:
      tags:
      - policies
      summary: Simulate Policy Change
      description: 'Pre-enforcement simulation mode for policy change review.

        Compares current active policy outcomes with simulated policy outcomes on
        the same input.'
      operationId: simulate_policy_change_v1_policies_simulate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicySimulationRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicySimulationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/chat/sessions:
    post:
      tags:
      - chat
      summary: Create Session
      operationId: create_session_v1_chat_sessions_post
      parameters:
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatSessionCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - chat
      summary: List Sessions
      operationId: list_sessions_v1_chat_sessions_get
      parameters:
      - name: user_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: User Id
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatSessionResponse'
                title: Response List Sessions V1 Chat Sessions Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/chat/sessions/{session_id}:
    get:
      tags:
      - chat
      summary: Get Session
      operationId: get_session_v1_chat_sessions__session_id__get
      parameters:
      - name: session_id
        in: path
        required: true
        schema:
          type: string
          title: Session Id
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/chat/providers/resilience:
    get:
      tags:
      - chat
      summary: Provider Resilience Snapshot
      operationId: provider_resilience_snapshot_v1_chat_providers_resilience_get
      parameters:
      - name: provider
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider
      - name: model
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/chat/stream:
    post:
      tags:
      - chat
      summary: Stream Chat
      operationId: stream_chat_v1_chat_stream_post
      parameters:
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StreamChatRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/chat/audit/logs:
    get:
      tags:
      - chat
      summary: List Audit Logs
      description: 'Admin only: List all gateway audit logs.'
      operationId: list_audit_logs_v1_chat_audit_logs_get
      security:
      - HTTPBearer: []
      parameters:
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      - name: q
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 200
          - type: 'null'
          title: Q
      - name: action
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Action
      - name: source
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Source
      - name: event
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 120
          - type: 'null'
          title: Event
      - name: route
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 160
          - type: 'null'
          title: Route
      - name: severity
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 40
          - type: 'null'
          title: Severity
      - name: outcome
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Outcome
      - name: identity_scope
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 40
          - type: 'null'
          title: Identity Scope
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/chat/audit/export:
    get:
      tags:
      - chat
      summary: Export Audit Logs
      description: 'Admin only: Export audit logs as CSV.'
      operationId: export_audit_logs_v1_chat_audit_export_get
      security:
      - HTTPBearer: []
      parameters:
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      - name: q
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 200
          - type: 'null'
          title: Q
      - name: action
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Action
      - name: source
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Source
      - name: event
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 120
          - type: 'null'
          title: Event
      - name: route
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 160
          - type: 'null'
          title: Route
      - name: severity
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 40
          - type: 'null'
          title: Severity
      - name: outcome
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Outcome
      - name: identity_scope
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 40
          - type: 'null'
          title: Identity Scope
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/documents/ingest:
    post:
      tags:
      - documents
      summary: Ingest Document
      operationId: ingest_document_v1_documents_ingest_post
      parameters:
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_ingest_document_v1_documents_ingest_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentIngestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/documents/redact:
    post:
      tags:
      - documents
      summary: Redact Document
      operationId: redact_document_v1_documents_redact_post
      parameters:
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_redact_document_v1_documents_redact_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentRedactResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/analytics/stats:
    get:
      tags:
      - analytics
      summary: Get Analytics Stats
      description: Get aggregated PII detection statistics.
      operationId: get_analytics_stats_v1_analytics_stats_get
      security:
      - HTTPBearer: []
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 90
          minimum: 1
          default: 7
          title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Get Analytics Stats V1 Analytics Stats Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/analytics/trends:
    get:
      tags:
      - analytics
      summary: Get Analytics Trends
      description: 'Get time-series data for PII detections.

        Supports grouping by ''day'' or ''hour''.'
      operationId: get_analytics_trends_v1_analytics_trends_get
      security:
      - HTTPBearer: []
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 7
          title: Days
      - name: group_by
        in: query
        required: false
        schema:
          type: string
          pattern: ^(day|hour)$
          default: day
          title: Group By
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                title: Response Get Analytics Trends V1 Analytics Trends Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/analytics/logs:
    get:
      tags:
      - analytics
      summary: Get Recent Logs
      description: Get recent audit logs for the dashboard.
      operationId: get_recent_logs_v1_analytics_logs_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 10
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
                title: Response Get Recent Logs V1 Analytics Logs Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/operations/summary:
    get:
      tags:
      - operations
      summary: Operations Summary
      operationId: operations_summary_v1_operations_summary_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Operations Summary V1 Operations Summary Get
      security:
      - HTTPBearer: []
  /v1/operations/daily-reports:
    get:
      tags:
      - operations
      summary: Operations Daily Reports
      operationId: operations_daily_reports_v1_operations_daily_reports_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Operations Daily Reports V1 Operations Daily Reports
                  Get
      security:
      - HTTPBearer: []
  /v1/operations/daily-reports/{report_id}:
    get:
      tags:
      - operations
      summary: Operations Daily Report Detail
      operationId: operations_daily_report_detail_v1_operations_daily_reports__report_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: report_id
        in: path
        required: true
        schema:
          type: string
          title: Report Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Operations Daily Report Detail V1 Operations Daily
                  Reports  Report Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/operations/alerts/audit-log:
    get:
      tags:
      - operations
      summary: Operations Alert Audit Log
      operationId: operations_alert_audit_log_v1_operations_alerts_audit_log_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 100
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Operations Alert Audit Log V1 Operations Alerts Audit
                  Log Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/operations/alerts/{alert_id}/acknowledge:
    post:
      tags:
      - operations
      summary: Operations Acknowledge Alert
      operationId: operations_acknowledge_alert_v1_operations_alerts__alert_id__acknowledge_post
      security:
      - HTTPBearer: []
      parameters:
      - name: alert_id
        in: path
        required: true
        schema:
          type: string
          title: Alert Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertAcknowledgeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Operations Acknowledge Alert V1 Operations Alerts  Alert
                  Id  Acknowledge Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/operations/alerts/{alert_id}/handoff:
    post:
      tags:
      - operations
      summary: Operations Handoff Alert
      operationId: operations_handoff_alert_v1_operations_alerts__alert_id__handoff_post
      security:
      - HTTPBearer: []
      parameters:
      - name: alert_id
        in: path
        required: true
        schema:
          type: string
          title: Alert Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertHandoffRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Operations Handoff Alert V1 Operations Alerts  Alert
                  Id  Handoff Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/operations/digest/export:
    get:
      tags:
      - operations
      summary: Operations Digest Export
      operationId: operations_digest_export_v1_operations_digest_export_get
      security:
      - HTTPBearer: []
      parameters:
      - name: format
        in: query
        required: false
        schema:
          type: string
          default: json
          title: Format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Operations Digest Export V1 Operations Digest Export
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/whitelist/:
    get:
      tags:
      - whitelist
      summary: List Whitelisted Terms
      description: List all whitelisted terms.
      operationId: list_whitelisted_terms_v1_whitelist__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WhitelistedTermResponse'
                type: array
                title: Response List Whitelisted Terms V1 Whitelist  Get
      security:
      - HTTPBearer: []
    post:
      tags:
      - whitelist
      summary: Create Whitelisted Term
      description: Add a new term to the global whitelist.
      operationId: create_whitelisted_term_v1_whitelist__post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhitelistedTermCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhitelistedTermResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/whitelist/{term_id}:
    delete:
      tags:
      - whitelist
      summary: Delete Whitelisted Term
      description: Remove a term from the whitelist.
      operationId: delete_whitelisted_term_v1_whitelist__term_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: term_id
        in: path
        required: true
        schema:
          type: integer
          title: Term Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/settings:
    get:
      tags:
      - settings
      summary: List Settings
      description: List all system configurations.
      operationId: list_settings_v1_settings_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SystemConfigResponse'
                type: array
                title: Response List Settings V1 Settings Get
      security:
      - HTTPBearer: []
  /v1/settings/{key}:
    patch:
      tags:
      - settings
      summary: Update Setting
      description: Update a system configuration.
      operationId: update_setting_v1_settings__key__patch
      security:
      - HTTPBearer: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
          title: Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemConfigUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemConfigResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/settings/replica-sync/status:
    get:
      tags:
      - settings
      summary: Get Replica Sync Status
      operationId: get_replica_sync_status_v1_settings_replica_sync_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplicaSyncStatusResponse'
      security:
      - HTTPBearer: []
  /v1/vault/token/{token_id}:
    get:
      tags:
      - vault
      summary: Get Original Value
      description: 'Admin Only: Resolve a Vault Token to its original PII value.

        Requires a valid Bearer token.'
      operationId: get_original_value_v1_vault_token__token_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: token_id
        in: path
        required: true
        schema:
          type: string
          description: The vault token to resolve (e.g. <PERSON_...>)
          title: Token Id
        description: The vault token to resolve (e.g. <PERSON_...>)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VaultTokenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/shield/mask:
    post:
      tags:
      - shield
      summary: Mask
      operationId: mask_v1_shield_mask_post
      parameters:
      - name: x-api-key
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Api-Key
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/shield/unmask:
    post:
      tags:
      - shield
      summary: Unmask
      operationId: unmask_v1_shield_unmask_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnmaskRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/discover:
    get:
      tags:
      - auth
      - authentication
      summary: Discover Sso
      description: 'Home Realm Discovery (HRD) - Find SSO configuration based on email/domain/org


        Priority order:

        1. org_slug (most specific)

        2. email domain (extracted from email)

        3. domain parameter (direct domain lookup)


        Returns SSO configuration if found, or indicates no SSO is configured.'
      operationId: discover_sso_api_v1_auth_discover_get
      parameters:
      - name: email
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Email
      - name: domain
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Domain
      - name: org_slug
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Org Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSODiscoveryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/signup:
    post:
      tags:
      - auth
      - authentication
      summary: Signup
      operationId: signup_api_v1_auth_signup_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignupRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignupResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/login:
    post:
      tags:
      - auth
      - authentication
      summary: Login
      description: Credentials login placeholder.
      operationId: login_api_v1_auth_login_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/mfa/setup:
    post:
      tags:
      - auth
      - authentication
      summary: Setup Mfa
      operationId: setup_mfa_api_v1_auth_mfa_setup_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MfaSetupRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MfaSetupResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/auth/mfa/verify:
    post:
      tags:
      - auth
      - authentication
      summary: Verify Mfa
      operationId: verify_mfa_api_v1_auth_mfa_verify_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MfaVerifyRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MfaVerifyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/auth/mfa/policy:
    get:
      tags:
      - auth
      - authentication
      summary: Get Mfa Policy
      operationId: get_mfa_policy_api_v1_auth_mfa_policy_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MfaPolicyResponse'
      security:
      - HTTPBearer: []
    patch:
      tags:
      - auth
      - authentication
      summary: Update Mfa Policy
      operationId: update_mfa_policy_api_v1_auth_mfa_policy_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MfaPolicyUpdateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MfaPolicyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/auth/mfa/admin/users:
    get:
      tags:
      - auth
      - authentication
      summary: List Mfa Users
      operationId: list_mfa_users_api_v1_auth_mfa_admin_users_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/MfaAdminUserResponse'
                type: array
                title: Response List Mfa Users Api V1 Auth Mfa Admin Users Get
      security:
      - HTTPBearer: []
  /api/v1/auth/mfa/admin/users/{user_id}/reset:
    post:
      tags:
      - auth
      - authentication
      summary: Reset User Mfa
      operationId: reset_user_mfa_api_v1_auth_mfa_admin_users__user_id__reset_post
      security:
      - HTTPBearer: []
      parameters:
      - name: user_id
        in: path
        required: true
        schema:
          type: string
          title: User Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/password/change:
    post:
      tags:
      - auth
      - authentication
      summary: Change Password
      operationId: change_password_api_v1_auth_password_change_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordChangeRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/sso/callback:
    post:
      tags:
      - auth
      - authentication
      summary: Sso Callback
      description: 'SSO Callback - Just-in-Time (JIT) User Provisioning


        Called by NextAuth after successful SSO authentication.

        Creates or updates user in the database.'
      operationId: sso_callback_api_v1_auth_sso_callback_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSOCallbackRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/api-keys:
    get:
      tags:
      - auth
      - authentication
      summary: List Api Keys
      operationId: list_api_keys_api_v1_auth_api_keys_get
      security:
      - HTTPBearer: []
      parameters:
      - name: include_revoked
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Include Revoked
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiKeyResponse'
                title: Response List Api Keys Api V1 Auth Api Keys Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - auth
      - authentication
      summary: Create Api Key
      operationId: create_api_key_api_v1_auth_api_keys_post
      security:
      - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/api-keys/{key_id}/rotate:
    post:
      tags:
      - auth
      - authentication
      summary: Rotate Api Key
      operationId: rotate_api_key_api_v1_auth_api_keys__key_id__rotate_post
      security:
      - HTTPBearer: []
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          title: Key Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyRotateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/api-keys/{key_id}:
    delete:
      tags:
      - auth
      - authentication
      summary: Revoke Api Key
      operationId: revoke_api_key_api_v1_auth_api_keys__key_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          title: Key Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/sso/config:
    get:
      tags:
      - sso
      - sso
      summary: Get Sso Config
      description: 'Get SSO configuration for current tenant.

        Returns public fields only (no secrets).'
      operationId: get_sso_config_api_v1_sso_config_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/SSOConfigPublic'
                - type: 'null'
                title: Response Get Sso Config Api V1 Sso Config Get
      security:
      - HTTPBearer: []
    post:
      tags:
      - sso
      - sso
      summary: Create Or Update Sso Config
      description: 'Create or update SSO configuration for tenant.

        Encrypts secrets before storage.'
      operationId: create_or_update_sso_config_api_v1_sso_config_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSOConfigCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOConfigPublic'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
    delete:
      tags:
      - sso
      - sso
      summary: Delete Sso Config
      description: Delete SSO configuration for tenant.
      operationId: delete_sso_config_api_v1_sso_config_delete
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      security:
      - HTTPBearer: []
    patch:
      tags:
      - sso
      - sso
      summary: Update Sso Config
      description: Partially update SSO configuration.
      operationId: update_sso_config_api_v1_sso_config_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSOConfigUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOConfigPublic'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/sso/config/test:
    post:
      tags:
      - sso
      - sso
      summary: Test Sso Connection
      description: Test SSO connection by validating OIDC well-known endpoint or SAML
        metadata.
      operationId: test_sso_connection_api_v1_sso_config_test_post
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/SSOTestRequest'
              - type: 'null'
              title: Test Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/sso/domains:
    get:
      tags:
      - sso
      - sso
      summary: List Sso Domains
      description: List all SSO domains for current tenant.
      operationId: list_sso_domains_api_v1_sso_domains_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SSODomainPublic'
                type: array
                title: Response List Sso Domains Api V1 Sso Domains Get
      security:
      - HTTPBearer: []
    post:
      tags:
      - sso
      - sso
      summary: Add Sso Domain
      description: 'Add email domain for SSO discovery.

        Domain must be verified before it can be used.'
      operationId: add_sso_domain_api_v1_sso_domains_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSODomainCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSODomainPublic'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/sso/domains/{domain_id}/verify:
    post:
      tags:
      - sso
      - sso
      summary: Verify Sso Domain
      description: 'Verify domain ownership.

        In production, this would check DNS TXT records or email verification.'
      operationId: verify_sso_domain_api_v1_sso_domains__domain_id__verify_post
      security:
      - HTTPBearer: []
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Domain Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/sso/domains/{domain_id}:
    delete:
      tags:
      - sso
      - sso
      summary: Delete Sso Domain
      description: Remove SSO domain.
      operationId: delete_sso_domain_api_v1_sso_domains__domain_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: domain_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Domain Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/sso/stats:
    get:
      tags:
      - sso
      - sso
      summary: Get Sso Stats
      description: Get SSO statistics for current tenant.
      operationId: get_sso_stats_api_v1_sso_stats_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOStatsResponse'
      security:
      - HTTPBearer: []
  /api/v1/sso/config/secret:
    post:
      tags:
      - sso
      summary: Get Decrypted Secret
      description: 'Get decrypted SSO client secret for a tenant.


        Security: This endpoint requires a signed short-lived service token.

        Only the frontend application should have access to this endpoint.'
      operationId: get_decrypted_secret_api_v1_sso_config_secret_post
      parameters:
      - name: tenant_id
        in: query
        required: true
        schema:
          type: string
          title: Tenant Id
      - name: x-service-token
        in: header
        required: false
        schema:
          type: string
          title: X-Service-Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/sso/config/public:
    get:
      tags:
      - sso
      summary: Get Public Sso Config
      description: 'Get SSO configuration for a specific tenant (public fields only).

        Used by the frontend during Home Realm Discovery.


        Note: Renamed to /config/public to avoid collision with admin /config endpoint.'
      operationId: get_public_sso_config_api_v1_sso_config_public_get
      parameters:
      - name: tenant_id
        in: query
        required: true
        schema:
          type: string
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/compliance/security-events/export:
    get:
      tags:
      - compliance
      summary: Export Security Events
      operationId: export_security_events_api_v1_compliance_security_events_export_get
      security:
      - HTTPBearer: []
      parameters:
      - name: hours
        in: query
        required: false
        schema:
          type: integer
          maximum: 720
          minimum: 1
          default: 24
          title: Hours
      - name: output_format
        in: query
        required: false
        schema:
          enum:
          - json
          - ndjson
          type: string
          default: ndjson
          title: Output Format
      - name: provider_format
        in: query
        required: false
        schema:
          enum:
          - canonical
          - splunk
          - datadog
          - sentinel
          type: string
          default: canonical
          title: Provider Format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/compliance/audit-logs/export:
    get:
      tags:
      - compliance
      summary: Export Audit Logs
      operationId: export_audit_logs_api_v1_compliance_audit_logs_export_get
      security:
      - HTTPBearer: []
      parameters:
      - name: output_format
        in: query
        required: false
        schema:
          enum:
          - json
          - csv
          type: string
          default: json
          title: Output Format
      - name: hours
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
            maximum: 720
            minimum: 1
          - type: 'null'
          title: Hours
      - name: from_ts
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: From Ts
      - name: to_ts
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: To Ts
      - name: event_type
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Event Type
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 50000
          minimum: 1
          default: 2000
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/compliance/exports:
    get:
      tags:
      - compliance
      summary: List Compliance Exports
      operationId: list_compliance_exports_api_v1_compliance_exports_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 200
          minimum: 1
          default: 20
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/compliance/exports/verify-chain:
    get:
      tags:
      - compliance
      summary: Verify Export Chain
      operationId: verify_export_chain_api_v1_compliance_exports_verify_chain_get
      security:
      - HTTPBearer: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 5000
          minimum: 1
          default: 200
          title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/compliance/retention/status:
    get:
      tags:
      - compliance
      summary: Retention Status
      operationId: retention_status_api_v1_compliance_retention_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      security:
      - HTTPBearer: []
  /api/v1/compliance/legal-holds:
    get:
      tags:
      - compliance
      summary: List Legal Holds
      operationId: list_legal_holds_api_v1_compliance_legal_holds_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      security:
      - HTTPBearer: []
    post:
      tags:
      - compliance
      summary: Create Legal Hold
      operationId: create_legal_hold_api_v1_compliance_legal_holds_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegalHoldCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/compliance/retention/enforce:
    post:
      tags:
      - compliance
      summary: Run Retention Enforcement
      operationId: run_retention_enforcement_api_v1_compliance_retention_enforce_post
      security:
      - HTTPBearer: []
      parameters:
      - name: dry_run
        in: query
        required: false
        schema:
          type: boolean
          default: true
          title: Dry Run
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/billing/stripe/webhook:
    post:
      tags:
      - billing
      summary: Stripe Webhook
      operationId: stripe_webhook_v1_billing_stripe_webhook_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /v1/billing/public-catalog:
    get:
      tags:
      - billing
      summary: Get Public Pricing Catalog
      operationId: get_public_pricing_catalog_v1_billing_public_catalog_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /v1/billing/public-extension-install:
    get:
      tags:
      - billing
      summary: Get Public Extension Install Surface
      operationId: get_public_extension_install_surface_v1_billing_public_extension_install_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /v1/billing/self-serve/summary:
    get:
      tags:
      - billing
      summary: Get Self Serve Billing Summary
      operationId: get_self_serve_billing_summary_v1_billing_self_serve_summary_get
      security:
      - HTTPBearer: []
      parameters:
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/billing/usage/month-to-date:
    get:
      tags:
      - billing
      summary: Usage Month To Date
      operationId: usage_month_to_date_v1_billing_usage_month_to_date_get
      security:
      - HTTPBearer: []
      parameters:
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/billing/usage/daily:
    get:
      tags:
      - billing
      summary: Usage Daily
      operationId: usage_daily_v1_billing_usage_daily_get
      security:
      - HTTPBearer: []
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          default: 30
          title: Days
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/billing/stripe/portal-session:
    post:
      tags:
      - billing
      summary: Create Stripe Portal Session
      operationId: create_stripe_portal_session_v1_billing_stripe_portal_session_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripePortalSessionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/billing/stripe/checkout-session:
    post:
      tags:
      - billing
      summary: Create Stripe Checkout Session
      operationId: create_stripe_checkout_session_v1_billing_stripe_checkout_session_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StripeCheckoutSessionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/billing/byok/keys:
    post:
      tags:
      - billing
      summary: Set Byok Key
      operationId: set_byok_key_v1_billing_byok_keys_post
      security:
      - HTTPBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ByokKeySetRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - billing
      summary: List Byok Keys
      operationId: list_byok_keys_v1_billing_byok_keys_get
      security:
      - HTTPBearer: []
      parameters:
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      - name: provider
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider
      - name: include_inactive
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Include Inactive
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/billing/byok/keys/test:
    post:
      tags:
      - billing
      summary: Test Byok Key
      operationId: test_byok_key_v1_billing_byok_keys_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ByokKeyTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v1/billing/byok/keys/{key_id}/rotate:
    post:
      tags:
      - billing
      summary: Rotate Byok Key
      operationId: rotate_byok_key_v1_billing_byok_keys__key_id__rotate_post
      security:
      - HTTPBearer: []
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          title: Key Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ByokKeyRotateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/billing/byok/keys/{key_id}:
    delete:
      tags:
      - billing
      summary: Revoke Byok Key
      operationId: revoke_byok_key_v1_billing_byok_keys__key_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          title: Key Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/extension/config:
    get:
      tags:
      - extension
      summary: Get Extension Config
      operationId: get_extension_config_api_v1_extension_config_get
      parameters:
      - name: if-none-match
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: If-None-Match
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/extension/telemetry:
    post:
      tags:
      - extension
      summary: Ingest Extension Telemetry
      operationId: ingest_extension_telemetry_api_v1_extension_telemetry_post
      parameters:
      - name: x-service-token
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Service-Token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/telemetry/client:
    post:
      tags:
      - telemetry
      summary: Ingest Client Telemetry
      operationId: ingest_client_telemetry_api_v1_telemetry_client_post
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/telemetry/funnel/summary:
    get:
      tags:
      - telemetry
      summary: Funnel Summary
      operationId: funnel_summary_api_v1_telemetry_funnel_summary_get
      security:
      - HTTPBearer: []
      parameters:
      - name: days
        in: query
        required: false
        schema:
          type: integer
          maximum: 90
          minimum: 1
          default: 14
          title: Days
      - name: src
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Src
      - name: plan
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 80
          - type: 'null'
          title: Plan
      - name: campaign
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 120
          - type: 'null'
          title: Campaign
      - name: source
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            maxLength: 40
          - type: 'null'
          title: Source
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AlertAcknowledgeRequest:
      properties:
        owner:
          anyOf:
          - type: string
            maxLength: 120
          - type: 'null'
          title: Owner
        note:
          anyOf:
          - type: string
            maxLength: 400
          - type: 'null'
          title: Note
      type: object
      title: AlertAcknowledgeRequest
    AlertHandoffRequest:
      properties:
        to_owner:
          type: string
          maxLength: 120
          minLength: 2
          title: To Owner
        reason:
          anyOf:
          - type: string
            maxLength: 400
          - type: 'null'
          title: Reason
      type: object
      required:
      - to_owner
      title: AlertHandoffRequest
    ApiKeyCreateRequest:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        scope:
          type: string
          title: Scope
          default: gateway
      type: object
      title: ApiKeyCreateRequest
    ApiKeyCreateResponse:
      properties:
        api_key:
          type: string
          title: Api Key
        key:
          $ref: '#/components/schemas/ApiKeyResponse'
      type: object
      required:
      - api_key
      - key
      title: ApiKeyCreateResponse
    ApiKeyResponse:
      properties:
        id:
          type: string
          title: Id
        tenant_id:
          type: string
          title: Tenant Id
        key_prefix:
          type: string
          title: Key Prefix
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        scope:
          type: string
          title: Scope
        revoked_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Revoked At
        created_at:
          type: string
          format: date-time
          title: Created At
        last_used_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Used At
      type: object
      required:
      - id
      - tenant_id
      - key_prefix
      - name
      - scope
      - revoked_at
      - created_at
      - last_used_at
      title: ApiKeyResponse
    ApiKeyRotateRequest:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
      type: object
      title: ApiKeyRotateRequest
    AuditLogFacetOption:
      properties:
        value:
          type: string
          title: Value
        count:
          type: integer
          title: Count
      type: object
      required:
      - value
      - count
      title: AuditLogFacetOption
    AuditLogListResponse:
      properties:
        logs:
          items:
            $ref: '#/components/schemas/AuditLogStructuredResponse'
          type: array
          title: Logs
        facets:
          additionalProperties:
            items:
              $ref: '#/components/schemas/AuditLogFacetOption'
            type: array
          type: object
          title: Facets
        summary:
          $ref: '#/components/schemas/AuditLogSummaryResponse'
      type: object
      required:
      - logs
      - facets
      - summary
      title: AuditLogListResponse
    AuditLogStructuredResponse:
      properties:
        id:
          type: integer
          title: Id
        user_id:
          type: string
          title: User Id
        session_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Session Id
        action:
          type: string
          title: Action
        entity_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Entity Type
        metadata_json:
          anyOf:
          - type: string
          - type: 'null'
          title: Metadata Json
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        source:
          anyOf:
          - type: string
          - type: 'null'
          title: Source
        event:
          anyOf:
          - type: string
          - type: 'null'
          title: Event
        route:
          anyOf:
          - type: string
          - type: 'null'
          title: Route
        host:
          anyOf:
          - type: string
          - type: 'null'
          title: Host
        severity:
          anyOf:
          - type: string
          - type: 'null'
          title: Severity
        outcome:
          anyOf:
          - type: string
          - type: 'null'
          title: Outcome
        identity_scope:
          type: string
          title: Identity Scope
          default: user
        detail_summary:
          type: string
          title: Detail Summary
          default: '-'
        collapsed_occurrences:
          type: integer
          title: Collapsed Occurrences
          default: 1
      type: object
      required:
      - id
      - user_id
      - session_id
      - action
      - entity_type
      - metadata_json
      - timestamp
      title: AuditLogStructuredResponse
    AuditLogSummaryResponse:
      properties:
        total_events:
          type: integer
          title: Total Events
        visible_events:
          type: integer
          title: Visible Events
        telemetry_events:
          type: integer
          title: Telemetry Events
        security_events:
          type: integer
          title: Security Events
        masked_events:
          type: integer
          title: Masked Events
        blocked_events:
          type: integer
          title: Blocked Events
        unique_users:
          type: integer
          title: Unique Users
        human_users:
          type: integer
          title: Human Users
        service_identities:
          type: integer
          title: Service Identities
        anonymous_identities:
          type: integer
          title: Anonymous Identities
        noise_collapsed_events:
          type: integer
          title: Noise Collapsed Events
          default: 0
        noise_collapsed_groups:
          type: integer
          title: Noise Collapsed Groups
          default: 0
      type: object
      required:
      - total_events
      - visible_events
      - telemetry_events
      - security_events
      - masked_events
      - blocked_events
      - unique_users
      - human_users
      - service_identities
      - anonymous_identities
      title: AuditLogSummaryResponse
    Body_ingest_document_v1_documents_ingest_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
      type: object
      required:
      - file
      title: Body_ingest_document_v1_documents_ingest_post
    Body_redact_document_v1_documents_redact_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
      - file
      title: Body_redact_document_v1_documents_redact_post
    ByokKeyRotateRequest:
      properties:
        api_key:
          type: string
          minLength: 8
          title: Api Key
        base_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Base Url
      type: object
      required:
      - api_key
      title: ByokKeyRotateRequest
    ByokKeySetRequest:
      properties:
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        provider:
          type: string
          title: Provider
          default: openai
        api_key:
          type: string
          minLength: 8
          title: Api Key
        base_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Base Url
      type: object
      required:
      - api_key
      title: ByokKeySetRequest
    ByokKeyTestRequest:
      properties:
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        provider:
          type: string
          title: Provider
          default: openai
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
        key_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Key Id
      type: object
      title: ByokKeyTestRequest
    ChatAttachmentMetadata:
      properties:
        name:
          type: string
          title: Name
        type:
          anyOf:
          - type: string
          - type: 'null'
          title: Type
        size:
          type: integer
          title: Size
      additionalProperties: true
      type: object
      required:
      - name
      - size
      title: ChatAttachmentMetadata
    ChatSessionCreate:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          default: New Chat
        id:
          type: string
          title: Id
        user_id:
          type: string
          title: User Id
        user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Name
      type: object
      required:
      - id
      - user_id
      title: ChatSessionCreate
    ChatSessionResponse:
      properties:
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
          default: New Chat
        id:
          type: string
          title: Id
        user_id:
          anyOf:
          - type: string
          - type: 'null'
          title: User Id
        user_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Name
        created_at:
          type: string
          format: date-time
          title: Created At
        messages:
          items:
            $ref: '#/components/schemas/MessageResponse'
          type: array
          title: Messages
          default: []
      type: object
      required:
      - id
      - created_at
      title: ChatSessionResponse
    CustomRuleCreate:
      properties:
        name:
          type: string
          title: Name
        pattern:
          type: string
          title: Pattern
        entity_type:
          type: string
          title: Entity Type
        score:
          type: number
          title: Score
          default: 0.5
        is_active:
          type: boolean
          title: Is Active
          default: true
      type: object
      required:
      - name
      - pattern
      - entity_type
      title: CustomRuleCreate
    CustomRuleResponse:
      properties:
        name:
          type: string
          title: Name
        pattern:
          type: string
          title: Pattern
        entity_type:
          type: string
          title: Entity Type
        score:
          type: number
          title: Score
          default: 0.5
        is_active:
          type: boolean
          title: Is Active
          default: true
        id:
          type: string
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - name
      - pattern
      - entity_type
      - id
      - created_at
      title: CustomRuleResponse
    CustomRuleUpdate:
      properties:
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        pattern:
          anyOf:
          - type: string
          - type: 'null'
          title: Pattern
        entity_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Entity Type
        score:
          anyOf:
          - type: number
          - type: 'null'
          title: Score
        is_active:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Active
      type: object
      title: CustomRuleUpdate
    DocumentIngestResponse:
      properties:
        document_id:
          type: string
          title: Document Id
        filename:
          type: string
          title: Filename
        media_type:
          type: string
          title: Media Type
        byte_size:
          type: integer
          title: Byte Size
        chunk_count:
          type: integer
          title: Chunk Count
        expires_at:
          type: string
          format: date-time
          title: Expires At
        sanitized_reference:
          $ref: '#/components/schemas/SanitizedDocumentReference'
      type: object
      required:
      - document_id
      - filename
      - media_type
      - byte_size
      - chunk_count
      - expires_at
      - sanitized_reference
      title: DocumentIngestResponse
    DocumentRedactResponse:
      properties:
        filename:
          type: string
          title: Filename
        media_type:
          type: string
          title: Media Type
        byte_size:
          type: integer
          title: Byte Size
        sha256:
          type: string
          title: Sha256
        redacted_media_type:
          type: string
          title: Redacted Media Type
        redacted_document_base64:
          type: string
          title: Redacted Document Base64
        page_count:
          type: integer
          title: Page Count
        processing_ms:
          type: number
          title: Processing Ms
        findings:
          items:
            $ref: '#/components/schemas/DocumentRedactionFinding'
          type: array
          title: Findings
      type: object
      required:
      - filename
      - media_type
      - byte_size
      - sha256
      - redacted_media_type
      - redacted_document_base64
      - page_count
      - processing_ms
      - findings
      title: DocumentRedactResponse
    DocumentRedactionFinding:
      properties:
        page_number:
          type: integer
          title: Page Number
        entity_type:
          type: string
          title: Entity Type
        text_hash:
          type: string
          title: Text Hash
        bounding_box:
          additionalProperties:
            type: number
          type: object
          title: Bounding Box
      type: object
      required:
      - page_number
      - entity_type
      - text_hash
      - bounding_box
      title: DocumentRedactionFinding
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LegalHoldCreateRequest:
      properties:
        hold_name:
          type: string
          title: Hold Name
        reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reason
        applies_to:
          type: string
          enum:
          - all
          - audit_logs
          - sso_auth_logs
          title: Applies To
          default: all
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
      type: object
      required:
      - hold_name
      title: LegalHoldCreateRequest
    LoginRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        password:
          type: string
          title: Password
      type: object
      required:
      - email
      - password
      title: LoginRequest
    LoginResponse:
      properties:
        id:
          type: string
          title: Id
        email:
          type: string
          format: email
          title: Email
        name:
          type: string
          title: Name
        role:
          type: string
          title: Role
        tenant_id:
          type: string
          title: Tenant Id
        tenant_deployment_mode:
          type: string
          enum:
          - saas
          - onprem_connected
          - onprem_disconnected
          title: Tenant Deployment Mode
          default: saas
        mfa_required:
          type: boolean
          title: Mfa Required
          default: false
        mfa_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Mfa Token
        mfa_enabled:
          type: boolean
          title: Mfa Enabled
          default: false
        mfa_enforced:
          type: boolean
          title: Mfa Enforced
          default: false
        mfa_setup_required:
          type: boolean
          title: Mfa Setup Required
          default: false
        mfa_verified:
          type: boolean
          title: Mfa Verified
          default: false
      type: object
      required:
      - id
      - email
      - name
      - role
      - tenant_id
      title: LoginResponse
    MaskRequest:
      properties:
        prompt:
          type: string
          title: Prompt
        custom_patterns:
          anyOf:
          - items:
              additionalProperties:
                type: string
              type: object
            type: array
          - type: 'null'
          title: Custom Patterns
        masking_char:
          anyOf:
          - type: string
          - type: 'null'
          title: Masking Char
        reversible:
          type: boolean
          title: Reversible
          default: false
      type: object
      required:
      - prompt
      title: MaskRequest
    MessageResponse:
      properties:
        role:
          type: string
          title: Role
        content:
          anyOf:
          - type: string
          - type: 'null'
          title: Content
        masked_content:
          anyOf:
          - type: string
          - type: 'null'
          title: Masked Content
        pii_metadata:
          anyOf:
          - type: string
          - type: 'null'
          title: Pii Metadata
        id:
          type: integer
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - role
      - id
      - created_at
      title: MessageResponse
    MfaAdminUserResponse:
      properties:
        id:
          type: string
          title: Id
        email:
          type: string
          format: email
          title: Email
        name:
          type: string
          title: Name
        role:
          type: string
          title: Role
        is_sso_user:
          type: boolean
          title: Is Sso User
          default: false
        mfa_enabled:
          type: boolean
          title: Mfa Enabled
          default: false
        mfa_enrolled_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Mfa Enrolled At
      type: object
      required:
      - id
      - email
      - name
      - role
      title: MfaAdminUserResponse
    MfaPolicyResponse:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
        mfa_enforced:
          type: boolean
          title: Mfa Enforced
      type: object
      required:
      - tenant_id
      - mfa_enforced
      title: MfaPolicyResponse
    MfaPolicyUpdateRequest:
      properties:
        mfa_enforced:
          type: boolean
          title: Mfa Enforced
      type: object
      required:
      - mfa_enforced
      title: MfaPolicyUpdateRequest
    MfaSetupRequest:
      properties:
        mfa_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Mfa Token
      type: object
      title: MfaSetupRequest
    MfaSetupResponse:
      properties:
        otpauth_uri:
          type: string
          title: Otpauth Uri
        qr_code_svg:
          type: string
          title: Qr Code Svg
        secret:
          type: string
          title: Secret
        backup_codes:
          items:
            type: string
          type: array
          title: Backup Codes
        mfa_enabled:
          type: boolean
          title: Mfa Enabled
          default: false
      type: object
      required:
      - otpauth_uri
      - qr_code_svg
      - secret
      - backup_codes
      title: MfaSetupResponse
    MfaVerifyRequest:
      properties:
        mfa_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Mfa Token
        code:
          anyOf:
          - type: string
          - type: 'null'
          title: Code
        backup_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Backup Code
      type: object
      title: MfaVerifyRequest
    MfaVerifyResponse:
      properties:
        success:
          type: boolean
          title: Success
        id:
          type: string
          title: Id
        email:
          type: string
          format: email
          title: Email
        name:
          type: string
          title: Name
        role:
          type: string
          title: Role
        tenant_id:
          type: string
          title: Tenant Id
        tenant_deployment_mode:
          type: string
          enum:
          - saas
          - onprem_connected
          - onprem_disconnected
          title: Tenant Deployment Mode
          default: saas
        mfa_enabled:
          type: boolean
          title: Mfa Enabled
          default: true
        mfa_enforced:
          type: boolean
          title: Mfa Enforced
          default: false
        mfa_verified:
          type: boolean
          title: Mfa Verified
          default: true
      type: object
      required:
      - success
      - id
      - email
      - name
      - role
      - tenant_id
      title: MfaVerifyResponse
    PasswordChangeRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        current_password:
          type: string
          title: Current Password
        new_password:
          type: string
          title: New Password
      type: object
      required:
      - email
      - current_password
      - new_password
      title: PasswordChangeRequest
    PolicyAssistantDraftRequest:
      properties:
        intent:
          type: string
          title: Intent
        sample_inputs:
          items:
            type: string
          type: array
          title: Sample Inputs
          default: []
      type: object
      required:
      - intent
      title: PolicyAssistantDraftRequest
    PolicyAssistantDraftResponse:
      properties:
        draft:
          $ref: '#/components/schemas/PolicyAssistantRuleDraft'
        explanation:
          type: string
          title: Explanation
        why_it_works:
          items:
            type: string
          type: array
          title: Why It Works
        match_examples:
          items:
            type: string
          type: array
          title: Match Examples
        non_match_examples:
          items:
            type: string
          type: array
          title: Non Match Examples
        notes:
          items:
            type: string
          type: array
          title: Notes
        generation_source:
          type: string
          title: Generation Source
          default: ai
      type: object
      required:
      - draft
      - explanation
      - why_it_works
      - match_examples
      - non_match_examples
      - notes
      title: PolicyAssistantDraftResponse
    PolicyAssistantRuleDraft:
      properties:
        name:
          type: string
          title: Name
        entity_type:
          type: string
          title: Entity Type
        pattern:
          type: string
          title: Pattern
        score:
          type: number
          title: Score
          default: 0.6
      type: object
      required:
      - name
      - entity_type
      - pattern
      title: PolicyAssistantRuleDraft
    PolicySimulationDiff:
      properties:
        added_count:
          type: integer
          title: Added Count
        removed_count:
          type: integer
          title: Removed Count
        unchanged_count:
          type: integer
          title: Unchanged Count
        added_matches:
          items:
            $ref: '#/components/schemas/PolicySimulationMatch'
          type: array
          title: Added Matches
        removed_matches:
          items:
            $ref: '#/components/schemas/PolicySimulationMatch'
          type: array
          title: Removed Matches
      type: object
      required:
      - added_count
      - removed_count
      - unchanged_count
      - added_matches
      - removed_matches
      title: PolicySimulationDiff
    PolicySimulationMatch:
      properties:
        policy_id:
          type: string
          title: Policy Id
        policy_name:
          type: string
          title: Policy Name
        entity_type:
          type: string
          title: Entity Type
        pattern:
          type: string
          title: Pattern
        score:
          type: number
          title: Score
        match:
          type: string
          title: Match
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
      type: object
      required:
      - policy_id
      - policy_name
      - entity_type
      - pattern
      - score
      - match
      - start
      - end
      title: PolicySimulationMatch
    PolicySimulationRequest:
      properties:
        text:
          type: string
          title: Text
        operation:
          type: string
          enum:
          - add
          - replace
          - remove
          title: Operation
          default: add
        target_policy_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Target Policy Id
        candidate_rule:
          anyOf:
          - $ref: '#/components/schemas/PolicySimulationRuleInput'
          - type: 'null'
      type: object
      required:
      - text
      title: PolicySimulationRequest
    PolicySimulationResponse:
      properties:
        operation:
          type: string
          enum:
          - add
          - replace
          - remove
          title: Operation
        baseline_summary:
          $ref: '#/components/schemas/PolicySimulationSummary'
        simulated_summary:
          $ref: '#/components/schemas/PolicySimulationSummary'
        diff:
          $ref: '#/components/schemas/PolicySimulationDiff'
        baseline_masked_preview:
          type: string
          title: Baseline Masked Preview
        simulated_masked_preview:
          type: string
          title: Simulated Masked Preview
      type: object
      required:
      - operation
      - baseline_summary
      - simulated_summary
      - diff
      - baseline_masked_preview
      - simulated_masked_preview
      title: PolicySimulationResponse
    PolicySimulationRuleInput:
      properties:
        name:
          type: string
          title: Name
        pattern:
          type: string
          title: Pattern
        entity_type:
          type: string
          title: Entity Type
        score:
          type: number
          title: Score
          default: 0.5
        is_active:
          type: boolean
          title: Is Active
          default: true
      type: object
      required:
      - name
      - pattern
      - entity_type
      title: PolicySimulationRuleInput
    PolicySimulationSummary:
      properties:
        total_matches:
          type: integer
          title: Total Matches
        entity_breakdown:
          additionalProperties:
            type: integer
          type: object
          title: Entity Breakdown
      type: object
      required:
      - total_matches
      - entity_breakdown
      title: PolicySimulationSummary
    PolicyTestMatch:
      properties:
        match:
          type: string
          title: Match
        start:
          type: integer
          title: Start
        end:
          type: integer
          title: End
      type: object
      required:
      - match
      - start
      - end
      title: PolicyTestMatch
    PolicyTestRequest:
      properties:
        pattern:
          type: string
          title: Pattern
        text:
          type: string
          title: Text
      type: object
      required:
      - pattern
      - text
      title: PolicyTestRequest
    PolicyTestResponse:
      properties:
        matches:
          items:
            $ref: '#/components/schemas/PolicyTestMatch'
          type: array
          title: Matches
      type: object
      required:
      - matches
      title: PolicyTestResponse
    RegexExplainRequest:
      properties:
        pattern:
          type: string
          title: Pattern
      type: object
      required:
      - pattern
      title: RegexExplainRequest
    RegexExplainResponse:
      properties:
        explanation:
          type: string
          title: Explanation
        examples:
          items:
            type: string
          type: array
          title: Examples
      type: object
      required:
      - explanation
      - examples
      title: RegexExplainResponse
    ReplicaSyncStatusResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
        transport:
          type: string
          title: Transport
        instance_id:
          type: string
          title: Instance Id
        poll_seconds:
          type: number
          title: Poll Seconds
        max_stale_seconds:
          type: number
          title: Max Stale Seconds
        last_successful_sync_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Successful Sync At
        seconds_since_last_successful_sync:
          anyOf:
          - type: number
          - type: 'null'
          title: Seconds Since Last Successful Sync
        last_sync_reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Sync Reason
        last_changed_scopes:
          items:
            type: string
          type: array
          title: Last Changed Scopes
        last_reload_at:
          additionalProperties:
            anyOf:
            - type: string
            - type: 'null'
          type: object
          title: Last Reload At
        last_event_received_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Event Received At
        last_event_scope:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Event Scope
        stale_window_exceeded:
          type: boolean
          title: Stale Window Exceeded
        last_error:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Error
        last_error_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Error At
      type: object
      required:
      - enabled
      - transport
      - instance_id
      - poll_seconds
      - max_stale_seconds
      - last_changed_scopes
      - last_reload_at
      - stale_window_exceeded
      title: ReplicaSyncStatusResponse
    SSOAuthLog:
      properties:
        event_type:
          type: string
          title: Event Type
        provider_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Type
        provider_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Name
        email:
          anyOf:
          - type: string
          - type: 'null'
          title: Email
        domain:
          anyOf:
          - type: string
          - type: 'null'
          title: Domain
        error_message:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Message
        error_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Code
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        id:
          type: string
          format: uuid
          title: Id
        tenant_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Tenant Id
        user_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: User Id
        ip_address:
          anyOf:
          - type: string
          - type: 'null'
          title: Ip Address
        user_agent:
          anyOf:
          - type: string
          - type: 'null'
          title: User Agent
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - event_type
      - id
      - tenant_id
      - user_id
      - ip_address
      - user_agent
      - created_at
      title: SSOAuthLog
      description: SSO auth log response
    SSOCallbackRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        sso_provider_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sso Provider Id
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        roles:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Roles
        groups:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Groups
      type: object
      required:
      - email
      title: SSOCallbackRequest
    SSOConfigCreate:
      properties:
        provider_type:
          type: string
          enum:
          - oidc
          - saml
          - none
          title: Provider Type
        provider_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Name
        oidc_issuer:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Issuer
        oidc_client_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Client Id
        oidc_scopes:
          type: string
          title: Oidc Scopes
          default: openid email profile
        saml_entity_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Entity Id
        saml_sso_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Sso Url
        saml_jackson_tenant:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Jackson Tenant
        saml_jackson_product:
          type: string
          title: Saml Jackson Product
          default: neutralai
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        oidc_client_secret:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Client Secret
        saml_certificate:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Certificate
      type: object
      required:
      - provider_type
      title: SSOConfigCreate
      description: Create SSO configuration
    SSOConfigPublic:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
        provider_type:
          type: string
          enum:
          - oidc
          - saml
          - none
          title: Provider Type
        provider_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Name
        oidc_issuer:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Issuer
        oidc_client_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Client Id
        oidc_scopes:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Scopes
        saml_entity_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Entity Id
        saml_sso_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Sso Url
        saml_jackson_tenant:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Jackson Tenant
        saml_jackson_product:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Jackson Product
        is_enabled:
          type: boolean
          title: Is Enabled
        is_tested:
          type: boolean
          title: Is Tested
        last_tested_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Tested At
      type: object
      required:
      - id
      - tenant_id
      - provider_type
      - provider_name
      - oidc_issuer
      - oidc_client_id
      - oidc_scopes
      - saml_entity_id
      - saml_sso_url
      - saml_jackson_tenant
      - saml_jackson_product
      - is_enabled
      - is_tested
      - last_tested_at
      title: SSOConfigPublic
      description: Public SSO configuration (safe to expose to frontend)
    SSOConfigUpdate:
      properties:
        provider_type:
          anyOf:
          - type: string
            enum:
            - oidc
            - saml
            - none
          - type: 'null'
          title: Provider Type
        provider_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Name
        oidc_issuer:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Issuer
        oidc_client_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Client Id
        oidc_client_secret:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Client Secret
        oidc_scopes:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Scopes
        saml_entity_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Entity Id
        saml_sso_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Sso Url
        saml_certificate:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Certificate
        saml_jackson_tenant:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Jackson Tenant
        saml_jackson_product:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Jackson Product
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
        is_enabled:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Enabled
      type: object
      title: SSOConfigUpdate
      description: Update SSO configuration (all fields optional)
    SSODiscoveryResponse:
      properties:
        found:
          type: boolean
          title: Found
        tenant_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Tenant Id
        tenant_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Name
        tenant_slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Slug
        provider_type:
          anyOf:
          - type: string
            enum:
            - oidc
            - saml
            - none
          - type: 'null'
          title: Provider Type
        provider_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Name
        oidc_issuer:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Issuer
        oidc_authorization_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Authorization Url
        oidc_scopes:
          anyOf:
          - type: string
          - type: 'null'
          title: Oidc Scopes
        saml_entity_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Entity Id
        saml_sso_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Saml Sso Url
        requires_verification:
          type: boolean
          title: Requires Verification
          default: false
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
      type: object
      required:
      - found
      title: SSODiscoveryResponse
      description: Response from SSO discovery
    SSODomainCreate:
      properties:
        domain:
          type: string
          title: Domain
      type: object
      required:
      - domain
      title: SSODomainCreate
      description: Create SSO domain
    SSODomainPublic:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
        domain:
          type: string
          title: Domain
        is_verified:
          type: boolean
          title: Is Verified
        verified_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Verified At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - id
      - tenant_id
      - domain
      - is_verified
      - verified_at
      - created_at
      title: SSODomainPublic
      description: Public SSO domain (without verification token)
    SSOStatsResponse:
      properties:
        total_sso_logins:
          type: integer
          title: Total Sso Logins
        total_credential_logins:
          type: integer
          title: Total Credential Logins
        sso_enabled:
          type: boolean
          title: Sso Enabled
        provider_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Type
        provider_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Name
        verified_domains:
          type: integer
          title: Verified Domains
        recent_auth_events:
          items:
            $ref: '#/components/schemas/SSOAuthLog'
          type: array
          title: Recent Auth Events
      type: object
      required:
      - total_sso_logins
      - total_credential_logins
      - sso_enabled
      - provider_type
      - provider_name
      - verified_domains
      - recent_auth_events
      title: SSOStatsResponse
      description: SSO statistics for a tenant
    SSOTestRequest:
      properties:
        test_user_email:
          anyOf:
          - type: string
          - type: 'null'
          title: Test User Email
      type: object
      title: SSOTestRequest
      description: Request to test SSO connection
    SSOTestResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        provider_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Provider Type
        details:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Details
        error_code:
          anyOf:
          - type: string
          - type: 'null'
          title: Error Code
        tested_at:
          type: string
          format: date-time
          title: Tested At
      type: object
      required:
      - success
      - message
      title: SSOTestResponse
      description: Response from SSO connection test
    SanitizedDocumentReference:
      properties:
        document_id:
          type: string
          title: Document Id
        chunk_ids:
          items:
            type: string
          type: array
          title: Chunk Ids
          default: []
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
      additionalProperties: false
      type: object
      required:
      - document_id
      title: SanitizedDocumentReference
    SignupRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        password:
          type: string
          title: Password
        full_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Full Name
        marketing_opt_in:
          type: boolean
          title: Marketing Opt In
          default: false
      type: object
      required:
      - email
      - password
      title: SignupRequest
    SignupResponse:
      properties:
        success:
          type: boolean
          title: Success
        user_id:
          type: string
          title: User Id
        email:
          type: string
          format: email
          title: Email
        tenant_id:
          type: string
          title: Tenant Id
        role:
          type: string
          title: Role
        tenant_deployment_mode:
          type: string
          enum:
          - saas
          - onprem_connected
          - onprem_disconnected
          title: Tenant Deployment Mode
          default: saas
        marketing_opt_in:
          type: boolean
          title: Marketing Opt In
          default: false
        marketing_opt_in_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Marketing Opt In At
      type: object
      required:
      - success
      - user_id
      - email
      - tenant_id
      - role
      title: SignupResponse
    StreamChatRequest:
      properties:
        session_id:
          type: string
          title: Session Id
        user_id:
          anyOf:
          - type: string
          - type: 'null'
          title: User Id
        prompt:
          type: string
          title: Prompt
        reversible:
          type: boolean
          title: Reversible
          default: true
        provider:
          type: string
          title: Provider
          default: openai
        model:
          type: string
          title: Model
          default: gpt-4-turbo
        attachments:
          anyOf:
          - items:
              $ref: '#/components/schemas/ChatAttachmentMetadata'
            type: array
          - type: 'null'
          title: Attachments
        sanitized_document_references:
          anyOf:
          - items:
              $ref: '#/components/schemas/SanitizedDocumentReference'
            type: array
          - type: 'null'
          title: Sanitized Document References
      additionalProperties: false
      type: object
      required:
      - session_id
      - prompt
      title: StreamChatRequest
    StripeCheckoutSessionRequest:
      properties:
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        plan:
          type: string
          title: Plan
          default: team
        success_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Success Url
        cancel_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Cancel Url
      type: object
      title: StripeCheckoutSessionRequest
    StripePortalSessionRequest:
      properties:
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        return_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Return Url
      type: object
      title: StripePortalSessionRequest
    SystemConfigResponse:
      properties:
        key:
          type: string
          title: Key
        value:
          type: string
          title: Value
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        category:
          type: string
          title: Category
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
      type: object
      required:
      - key
      - value
      - description
      - category
      title: SystemConfigResponse
    SystemConfigUpdate:
      properties:
        value:
          type: string
          title: Value
      type: object
      required:
      - value
      title: SystemConfigUpdate
    UnmaskRequest:
      properties:
        tokenized_text:
          type: string
          title: Tokenized Text
      type: object
      required:
      - tokenized_text
      title: UnmaskRequest
    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
    VaultTokenResponse:
      properties:
        token:
          type: string
          title: Token
        original_value:
          anyOf:
          - type: string
          - type: 'null'
          title: Original Value
        ttl_seconds_remaining:
          anyOf:
          - type: integer
          - type: 'null'
          title: Ttl Seconds Remaining
        created_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created At
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
        server_time:
          type: string
          format: date-time
          title: Server Time
      type: object
      required:
      - token
      - original_value
      - server_time
      title: VaultTokenResponse
    WhitelistedTermCreate:
      properties:
        term:
          type: string
          title: Term
        match_type:
          type: string
          title: Match Type
          default: exact
        is_active:
          type: boolean
          title: Is Active
          default: true
      type: object
      required:
      - term
      title: WhitelistedTermCreate
    WhitelistedTermResponse:
      properties:
        term:
          type: string
          title: Term
        match_type:
          type: string
          title: Match Type
          default: exact
        is_active:
          type: boolean
          title: Is Active
          default: true
        id:
          type: integer
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - term
      - id
      - created_at
      title: WhitelistedTermResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
