openapi: 3.0.3
info:
  title: Zhen Platform Core API
  version: 0.1.2
  description: Canonical OpenAPI contract for zhen-platform-core. Generated from src/api/contracts.ts and src/shared/*.ts.
servers:
  - url: https://core.zhenrobot.com
    description: Production
  - url: http://localhost:8080
    description: Local development
paths:
  /healthz:
    get:
      operationId: health
      summary: health
      tags:
        - public_catalog
      x-zhen-route-key: health
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: internal
      x-zhen-console-contract: not_console_surface
  /api/plans:
    get:
      operationId: plans.list
      summary: plans.list
      tags:
        - public_catalog
      x-zhen-route-key: listPlans
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase1_stable
      x-zhen-console-contract: not_console_surface
  /api/catalog/items:
    get:
      operationId: catalog.items.list
      summary: catalog.items.list
      tags:
        - public_catalog
      x-zhen-route-key: listCatalogItems
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase1_stable
      x-zhen-console-contract: phase1_stable
  /api/trials/onboard:
    post:
      operationId: trials.onboard
      summary: trials.onboard
      tags:
        - trial_onboarding
      x-zhen-route-key: trialOnboarding
      x-zhen-contract-auth: public
      x-zhen-contract-surface: trial_onboarding
      x-zhen-contract-stability: internal
      x-zhen-console-contract: not_normal_user_contract
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrialOnboardingInput'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrialOnboardingResult'
  /api/public/docs-conversion-evidence:
    post:
      operationId: public.docs_conversion_evidence.ingest
      summary: public.docs_conversion_evidence.ingest
      tags:
        - event_ingest
      x-zhen-route-key: publicDocsConversionEvidence
      x-zhen-contract-auth: public
      x-zhen-contract-surface: event_ingest
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      responses:
        '204':
          description: Success
  /v1/developer/trials:
    post:
      operationId: developer.trials.create
      summary: developer.trials.create
      tags:
        - developer_trial
      x-zhen-route-key: developerTrial
      x-zhen-contract-auth: public_with_verification
      x-zhen-contract-surface: developer_trial
      x-zhen-contract-stability: preview
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: Client-provided key used to deduplicate trial provisioning; replays preserve resource identifiers but never re-disclose the API secret.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeveloperTrialRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeveloperTrialResponse'
  /api/billing/checkout:
    post:
      operationId: billing.checkout
      summary: billing.checkout
      tags:
        - commerce_checkout
      x-zhen-route-key: billingCheckout
      x-zhen-contract-auth: public
      x-zhen-contract-surface: commerce_checkout
      x-zhen-contract-stability: phase1_stable
      x-zhen-console-contract: phase1_stable
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCheckoutInput'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPurchaseResult'
  /api/billing/confirm:
    post:
      operationId: billing.confirm
      summary: billing.confirm
      tags:
        - admin_ops
      x-zhen-route-key: billingConfirm
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/billing/cancel:
    post:
      operationId: billing.cancel
      summary: billing.cancel
      tags:
        - admin_ops
      x-zhen-route-key: billingCancel
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingCancelInput'
  /api/billing/refund:
    post:
      operationId: billing.refund
      summary: billing.refund
      tags:
        - admin_ops
      x-zhen-route-key: billingRefund
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingRefundInput'
  /api/commerce/checkout:
    post:
      operationId: commerce.checkout
      summary: commerce.checkout
      tags:
        - commerce_checkout
      x-zhen-route-key: commerceCheckout
      x-zhen-contract-auth: public
      x-zhen-contract-surface: commerce_checkout
      x-zhen-contract-stability: phase1_stable
      x-zhen-console-contract: phase1_stable
  /api/commerce/confirm:
    post:
      operationId: commerce.confirm
      summary: commerce.confirm
      tags:
        - admin_ops
      x-zhen-route-key: commerceConfirm
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/keys:
    post:
      operationId: keys.create
      summary: keys.create
      tags:
        - console_write
      x-zhen-route-key: keysCreate
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
    get:
      operationId: keys.list
      summary: keys.list
      tags:
        - console_read
      x-zhen-route-key: keysList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/keys/rotate:
    post:
      operationId: keys.rotate
      summary: keys.rotate
      tags:
        - console_write
      x-zhen-route-key: keysRotate
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/keys/revoke:
    post:
      operationId: keys.revoke
      summary: keys.revoke
      tags:
        - console_write
      x-zhen-route-key: keysRevoke
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/keys/authorize:
    post:
      operationId: keys.authorize
      summary: keys.authorize
      tags:
        - admin_ops
      x-zhen-route-key: keysAuthorize
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/usage/record:
    post:
      operationId: usage.record
      summary: usage.record
      tags:
        - usage_ingest
      x-zhen-route-key: usageRecord
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: usage_ingest
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/protocol/c2ai2x/execute:
    post:
      operationId: c2ai2x.execute
      summary: c2ai2x.execute
      tags:
        - protocol_ingest
      x-zhen-route-key: c2ai2xExecute
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: protocol_ingest
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/C2AI2XExecuteInput'
  /api/execute:
    post:
      operationId: brain.execute
      summary: brain.execute
      tags:
        - gateway
      x-zhen-route-key: execute
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: gateway
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/reviews/resume:
    post:
      operationId: brain.review.resume
      summary: brain.review.resume
      tags:
        - admin_ops
      x-zhen-route-key: reviewsResume
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/workflows/cancel:
    post:
      operationId: brain.workflow.cancel
      summary: brain.workflow.cancel
      tags:
        - admin_ops
      x-zhen-route-key: workflowsCancel
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/workflows/:id/stream:
    get:
      operationId: brain.workflow.stream
      summary: brain.workflow.stream
      tags:
        - gateway
      x-zhen-route-key: workflowStream
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: gateway
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/workflows/:id:
    get:
      operationId: brain.workflow.query
      summary: brain.workflow.query
      tags:
        - gateway
      x-zhen-route-key: workflowQuery
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: gateway
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/workflows/:id/cancel:
    post:
      operationId: brain.workflow.cancel
      summary: brain.workflow.cancel
      tags:
        - gateway
      x-zhen-route-key: workflowCancel
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: gateway
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/recommendations:
    get:
      operationId: recommendations.list
      summary: recommendations.list
      tags:
        - console_read
      x-zhen-route-key: recommendationsList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/recommendations/events:
    post:
      operationId: recommendations.event
      summary: recommendations.event
      tags:
        - console_write
      x-zhen-route-key: recommendationsEvent
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/session/reauth:
    post:
      operationId: session.reauth
      summary: session.reauth
      tags:
        - console_write
      x-zhen-route-key: sessionReauth
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/session/refresh:
    post:
      operationId: session.refresh
      summary: session.refresh
      tags:
        - console_write
      x-zhen-route-key: sessionRefresh
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/session/logout:
    post:
      operationId: session.logout
      summary: session.logout
      tags:
        - console_write
      x-zhen-route-key: sessionLogout
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/console/session/exchange:
    post:
      operationId: console.session.exchange
      summary: console.session.exchange
      tags:
        - console_write
      x-zhen-route-key: consoleSessionExchange
      x-zhen-contract-auth: public
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_normal_user_contract
  /api/auth/console/handoff/bootstrap:
    post:
      operationId: auth.console.handoff.bootstrap
      summary: auth.console.handoff.bootstrap
      tags:
        - console_write
      x-zhen-route-key: authConsoleHandoffBootstrap
      x-zhen-contract-auth: public
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: internal
      x-zhen-console-contract: not_console_surface
  /internal/auth/developer-trials:
    post:
      operationId: auth.developer-trial.provision
      summary: auth.developer-trial.provision
      tags:
        - developer_trial
      x-zhen-route-key: authDeveloperTrialProvision
      x-zhen-contract-auth: public
      x-zhen-contract-surface: developer_trial
      x-zhen-contract-stability: internal
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: Auth-provided idempotency key.
          schema:
            type: string
        - name: x-zhen-auth-bridge-token
          in: header
          required: true
          description: Auth-to-platform service credential.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeveloperTrialRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeveloperTrialResponse'
  /api/state:
    get:
      operationId: state.dump
      summary: state.dump
      tags:
        - admin_state
      x-zhen-route-key: state
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_state
      x-zhen-contract-stability: internal
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/me/summary:
    get:
      operationId: console.summary
      summary: console.summary
      tags:
        - console_read
      x-zhen-route-key: consoleSummary
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/billing/summary:
    get:
      operationId: billing.summary
      summary: billing.summary
      tags:
        - console_read
      x-zhen-route-key: billingSummary
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/billing/orders:
    get:
      operationId: billing.orders.list
      summary: billing.orders.list
      tags:
        - console_read
      x-zhen-route-key: billingOrdersList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/settings/profile:
    get:
      operationId: settings.profile.get
      summary: settings.profile.get
      tags:
        - console_read
      x-zhen-route-key: settingsProfile
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
    post:
      operationId: settings.profile.update
      summary: settings.profile.update
      tags:
        - console_write
      x-zhen-route-key: settingsProfileUpdate
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/settings/security:
    get:
      operationId: settings.security.get
      summary: settings.security.get
      tags:
        - console_read
      x-zhen-route-key: settingsSecurity
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/settings/workspace-preferences:
    get:
      operationId: settings.workspace_preferences.get
      summary: settings.workspace_preferences.get
      tags:
        - console_read
      x-zhen-route-key: settingsWorkspacePreferences
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
    post:
      operationId: settings.workspace_preferences.update
      summary: settings.workspace_preferences.update
      tags:
        - console_write
      x-zhen-route-key: settingsWorkspacePreferencesUpdate
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/events:
    get:
      operationId: events.list
      summary: events.list
      tags:
        - console_read
      x-zhen-route-key: eventsList
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/events/export:
    get:
      operationId: events.export.get
      summary: events.export.get
      tags:
        - console_read
      x-zhen-route-key: eventsExport
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/events/export/{exportId}/download:
    get:
      operationId: events.export.download
      summary: events.export.download
      tags:
        - console_read
      x-zhen-route-key: eventsExportDownload
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: exportId
          in: path
          required: true
          schema:
            type: string
  /api/ops/access:
    get:
      operationId: ops.access.get
      summary: ops.access.get
      tags:
        - admin_ops
      x-zhen-route-key: opsAccess
      x-zhen-contract-auth: session
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/ops/dashboard:
    get:
      operationId: ops.dashboard.get
      summary: ops.dashboard.get
      tags:
        - admin_ops
      x-zhen-route-key: opsDashboard
      x-zhen-contract-auth: session
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/entitlements/sweep:
    post:
      operationId: entitlements.sweep
      summary: entitlements.sweep
      tags:
        - admin_ops
      x-zhen-route-key: entitlementsSweep
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
  /api/me/modules:
    get:
      operationId: me.modules.list
      summary: me.modules.list
      tags:
        - console_read
      x-zhen-route-key: meModules
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/workspace:
    get:
      operationId: workspace.get
      summary: workspace.get
      tags:
        - console_read
      x-zhen-route-key: workspaceGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/workspace/members:
    get:
      operationId: workspace.members.list
      summary: workspace.members.list
      tags:
        - console_read
      x-zhen-route-key: workspaceMembersList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/workspace/switch:
    post:
      operationId: workspace.switch
      summary: workspace.switch
      tags:
        - console_write
      x-zhen-route-key: workspaceSwitch
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/workspace/candidates:
    get:
      operationId: workspace.candidates.list
      summary: workspace.candidates.list
      tags:
        - console_read
      x-zhen-route-key: workspaceCandidatesList
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/orders:
    get:
      operationId: orders.list
      summary: orders.list
      tags:
        - console_read
      x-zhen-route-key: ordersList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/orders/{orderId}:
    get:
      operationId: orders.get
      summary: orders.get
      tags:
        - console_read
      x-zhen-route-key: orderGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformOrder'
  /api/entitlements:
    get:
      operationId: entitlements.list
      summary: entitlements.list
      tags:
        - console_read
      x-zhen-route-key: entitlementsList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/usage/summary:
    get:
      operationId: usage.summary
      summary: usage.summary
      tags:
        - console_read
      x-zhen-route-key: usageSummary
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/downloads:
    get:
      operationId: downloads.list
      summary: downloads.list
      tags:
        - console_read
      x-zhen-route-key: downloadsList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
  /api/integrations/channels:
    post:
      operationId: integrations.channels.create
      summary: integrations.channels.create
      tags:
        - console_write
      x-zhen-route-key: integrationsChannelsCreate
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFrontendChannelInput'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformFrontendChannel'
    get:
      operationId: integrations.channels.list
      summary: integrations.channels.list
      tags:
        - console_read
      x-zhen-route-key: integrationsChannelsList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FrontendChannelsListResponse'
  /api/public/starter/channels:
    post:
      operationId: public.starter.channels.issue
      summary: public.starter.channels.issue
      tags:
        - trial_onboarding
      x-zhen-route-key: publicStarterChannelIssue
      x-zhen-contract-auth: public
      x-zhen-contract-surface: trial_onboarding
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicStarterChannelIssueRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicStarterChannelIssueResponse'
  /api/public/starter/channels/{channelId}/domain-verification:
    get:
      operationId: public.starter.channels.domain-verification.read
      summary: public.starter.channels.domain-verification.read
      tags:
        - trial_onboarding
      x-zhen-route-key: publicStarterChannelDomainVerificationRead
      x-zhen-contract-auth: public
      x-zhen-contract-surface: trial_onboarding
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicStarterDomainVerificationSummary'
    post:
      operationId: public.starter.channels.domain-verification.retry
      summary: public.starter.channels.domain-verification.retry
      tags:
        - trial_onboarding
      x-zhen-route-key: publicStarterChannelDomainVerificationRetry
      x-zhen-contract-auth: public
      x-zhen-contract-surface: trial_onboarding
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicStarterDomainVerificationSummary'
  /api/partners/accounts:
    post:
      operationId: partners.accounts.upsert
      summary: partners.accounts.upsert
      tags:
        - console_write
      x-zhen-route-key: partnerAccountUpsert
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertPartnerAccountRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPartnerAccount'
  /api/partners/channels/{channelId}/claim:
    post:
      operationId: partners.channels.claim
      summary: partners.channels.claim
      tags:
        - console_write
      x-zhen-route-key: partnerChannelClaim
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaimChannelOwnershipRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformChannelOwnership'
  /api/partners/payout-profiles:
    post:
      operationId: partners.payout_profiles.upsert
      summary: partners.payout_profiles.upsert
      tags:
        - console_write
      x-zhen-route-key: partnerPayoutProfileUpsert
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertPayoutProfileRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPayoutProfile'
  /api/admin/partners/payout-profiles/{payoutProfileId}/verify:
    post:
      operationId: admin.partners.payout_profiles.verify
      summary: admin.partners.payout_profiles.verify
      tags:
        - admin_ops
      x-zhen-route-key: adminPartnerPayoutProfileVerify
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      parameters:
        - name: payoutProfileId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPayoutProfile'
  /api/partners/settlement-center:
    get:
      operationId: partners.settlement_center.get
      summary: partners.settlement_center.get
      tags:
        - console_read
      x-zhen-route-key: partnerSettlementCenterGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPartnerSettlementCenter'
  /api/partners/settlement-activation:
    get:
      operationId: partners.settlement.activation.get
      summary: partners.settlement.activation.get
      tags:
        - console_read
      x-zhen-route-key: partnerSettlementActivationGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPartnerSettlementActivationResponse'
  /api/partners/settlement-query:
    get:
      operationId: partners.settlement.query.get
      summary: partners.settlement.query.get
      tags:
        - console_read
      x-zhen-route-key: partnerSettlementQueryGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPartnerSettlementQueryResponse'
  /api/partners/payout-batches:
    get:
      operationId: partners.payout_batches.list
      summary: partners.payout_batches.list
      tags:
        - console_read
      x-zhen-route-key: partnerPayoutBatchesList
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPayoutBatchListResponse'
  /api/admin/settlement/reconciliation:
    get:
      operationId: admin.settlement.reconciliation.list
      summary: admin.settlement.reconciliation.list
      tags:
        - admin_ops
      x-zhen-route-key: adminSettlementReconciliationList
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSettlementReconciliationListResponse'
  /api/admin/settlement/cases/{settlementCaseId}:
    get:
      operationId: admin.settlement.cases.detail.get
      summary: admin.settlement.cases.detail.get
      tags:
        - admin_ops
      x-zhen-route-key: adminSettlementCaseDetailGet
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      parameters:
        - name: settlementCaseId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSettlementCaseDetailResponse'
  /api/admin/settlement/orders/{orderId}/reconcile:
    post:
      operationId: admin.settlement.orders.reconcile
      summary: admin.settlement.orders.reconcile
      tags:
        - admin_ops
      x-zhen-route-key: adminSettlementOrderReconcile
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminSettlementOrderReconcileRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSettlementCase'
  /api/admin/settlement/cases/{settlementCaseId}/hold:
    post:
      operationId: admin.settlement.cases.hold
      summary: admin.settlement.cases.hold
      tags:
        - admin_ops
      x-zhen-route-key: adminSettlementCaseHold
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      parameters:
        - name: settlementCaseId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminSettlementCaseHoldRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSettlementCase'
  /api/admin/settlement/cases/{settlementCaseId}/economics:
    patch:
      operationId: admin.settlement.cases.economics.update
      summary: admin.settlement.cases.economics.update
      tags:
        - admin_ops
      x-zhen-route-key: adminSettlementCaseEconomicsUpdate
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      parameters:
        - name: settlementCaseId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminSettlementCaseEconomicsRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformSettlementCase'
  /api/admin/settlement/payout-batches/run:
    post:
      operationId: admin.settlement.payout_batches.run
      summary: admin.settlement.payout_batches.run
      tags:
        - admin_ops
      x-zhen-route-key: adminSettlementPayoutBatchRun
      x-zhen-contract-auth: admin
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_admin_ops
      x-zhen-console-contract: not_normal_user_contract
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPayoutBatchListResponse'
  /api/integrations/channels/{channelId}/starter:
    get:
      operationId: integrations.channel.starter
      summary: integrations.channel.starter
      tags:
        - console_read
      x-zhen-route-key: integrationsChannelStarter
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FrontendChannelStarterDetailResponse'
  /api/integrations/channels/{channelId}/starter/assets/{assetId}/events:
    post:
      operationId: integrations.channel.starter.asset_event.write
      summary: integrations.channel.starter.asset_event.write
      tags:
        - console_write
      x-zhen-route-key: integrationsChannelStarterAssetEventWrite
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
        - name: assetId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WriteStarterAssetEventRequest'
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WriteStarterAssetEventResponse'
  /api/integrations/channels/{channelId}/starter/events:
    post:
      operationId: integrations.channel.starter.events.write
      summary: integrations.channel.starter.events.write
      tags:
        - console_write
      x-zhen-route-key: integrationsChannelStarterEventWrite
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WriteStarterTrackedEventRequest'
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WriteStarterAssetEventResponse'
  /api/integrations/channels/{channelId}/starter/campaigns:
    post:
      operationId: integrations.channel.starter.campaigns.create
      summary: integrations.channel.starter.campaigns.create
      tags:
        - console_write
      x-zhen-route-key: integrationsChannelStarterCampaignCreate
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertStarterCampaignRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformStarterCampaign'
  /api/integrations/channels/{channelId}/starter/campaigns/{campaignId}:
    patch:
      operationId: integrations.channel.starter.campaigns.update
      summary: integrations.channel.starter.campaigns.update
      tags:
        - console_write
      x-zhen-route-key: integrationsChannelStarterCampaignUpdate
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertStarterCampaignRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformStarterCampaign'
  /api/integrations/channels/{channelId}/full-api:
    get:
      operationId: integrations.channels.full_api
      summary: integrations.channels.full_api
      tags:
        - console_read
      x-zhen-route-key: integrationsChannelFullApiReadiness
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: channelId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FrontendChannelFullApiReadinessResponse'
  /go/{shortCode}:
    get:
      operationId: starter.short_link.redirect
      summary: starter.short_link.redirect
      tags:
        - public_catalog
      x-zhen-route-key: starterShortLinkRedirect
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: shortCode
          in: path
          required: true
          schema:
            type: string
      responses:
        '302':
          description: Success
          headers:
            Location:
              description: Resolved starter redirect target.
              schema:
                type: string
  /api/public/channels/{channelKey}/widget-config:
    get:
      operationId: public.widget.config
      summary: public.widget.config
      tags:
        - public_catalog
      x-zhen-route-key: publicWidgetConfig
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase1_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicWidgetConfigResponse'
  /api/public/channels/{channelKey}/intake:
    post:
      operationId: public.widget.intake
      summary: public.widget.intake
      tags:
        - trial_onboarding
      x-zhen-route-key: publicWidgetIntake
      x-zhen-contract-auth: public
      x-zhen-contract-surface: trial_onboarding
      x-zhen-contract-stability: phase1_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChannelLeadRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformProviderLead'
  /api/public/channels/{channelKey}/conversations:
    post:
      operationId: public.widget.conversation.create
      summary: public.widget.conversation.create
      tags:
        - public_catalog
      x-zhen-route-key: publicWidgetConversationCreate
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePublicConversationRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicConversationCreateResponse'
  /api/public/channels/{channelKey}/conversations/{conversationId}/messages:
    post:
      operationId: public.widget.conversation.message
      summary: public.widget.conversation.message
      tags:
        - public_catalog
      x-zhen-route-key: publicWidgetConversationMessage
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendPublicConversationMessageRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicConversationMessageResponse'
  /api/public/channels/{channelKey}/conversations/{conversationId}/workflows/{workflowId}:
    get:
      operationId: public.widget.workflow.query
      summary: public.widget.workflow.query
      tags:
        - public_catalog
      x-zhen-route-key: publicWidgetWorkflowQuery
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
  /api/public/channels/{channelKey}/conversations/{conversationId}/workflows/{workflowId}/stream:
    get:
      operationId: public.widget.workflow.stream
      summary: public.widget.workflow.stream
      tags:
        - public_catalog
      x-zhen-route-key: publicWidgetWorkflowStream
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
  /api/public/channels/{channelKey}/conversations/{conversationId}/workflows/{workflowId}/cancel:
    post:
      operationId: public.widget.workflow.cancel
      summary: public.widget.workflow.cancel
      tags:
        - public_catalog
      x-zhen-route-key: publicWidgetWorkflowCancel
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: channelKey
          in: path
          required: true
          schema:
            type: string
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
  /api/provider/profile:
    get:
      operationId: provider.profile.get
      summary: provider.profile.get
      tags:
        - console_read
      x-zhen-route-key: providerProfileGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderProfileResponse'
    post:
      operationId: provider.profile.upsert
      summary: provider.profile.upsert
      tags:
        - console_write
      x-zhen-route-key: providerProfileUpsert
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitProviderProfileRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformProviderProfile'
  /api/provider/profile/review:
    get:
      operationId: provider.profile.review.get
      summary: provider.profile.review.get
      tags:
        - console_read
      x-zhen-route-key: providerProfileReviewGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderAdmissionReviewResponse'
  /api/provider/profile/role-change-request:
    get:
      operationId: provider.profile.role_change_request.get
      summary: provider.profile.role_change_request.get
      tags:
        - console_read
      x-zhen-route-key: providerRoleChangeRequestGet
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderRoleChangeRequest'
    post:
      operationId: provider.profile.role_change_request.create
      summary: provider.profile.role_change_request.create
      tags:
        - console_write
      x-zhen-route-key: providerRoleChangeRequestCreate
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProviderRoleChangeRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderRoleChangeRequestResponse'
  /api/provider/workbench/leads:
    get:
      operationId: provider.workbench.leads.list
      summary: provider.workbench.leads.list
      tags:
        - console_read
      x-zhen-route-key: providerWorkbenchLeads
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderWorkbenchLeadListResponse'
  /api/provider/handoffs:
    get:
      operationId: provider.handoffs.list
      summary: provider.handoffs.list
      tags:
        - console_read
      x-zhen-route-key: providerHandoffs
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderHandoffListResponse'
    post:
      operationId: provider.handoffs.offer
      summary: provider.handoffs.offer
      tags:
        - console_write
      x-zhen-route-key: providerHandoffOffer
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProviderHandoffRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderHandoffResponse'
  /api/provider/handoffs/{handoffId}/claim:
    post:
      operationId: provider.handoffs.claim
      summary: provider.handoffs.claim
      tags:
        - console_write
      x-zhen-route-key: providerHandoffClaim
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: handoffId
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderHandoffResponse'
  /api/provider/handoffs/{handoffId}/status:
    post:
      operationId: provider.handoffs.status
      summary: provider.handoffs.status
      tags:
        - console_write
      x-zhen-route-key: providerHandoffStatus
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: handoffId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProviderHandoffStatusRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderHandoffResponse'
  /api/provider/handoffs/{handoffId}/revoke:
    post:
      operationId: provider.handoffs.revoke
      summary: provider.handoffs.revoke
      tags:
        - console_write
      x-zhen-route-key: providerHandoffRevoke
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: handoffId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RevokeProviderHandoffRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderHandoffResponse'
  /api/provider/handoffs/{handoffId}/evidence-receipt:
    get:
      operationId: provider.handoffs.evidence_receipt.read
      summary: provider.handoffs.evidence_receipt.read
      tags:
        - console_read
      x-zhen-route-key: providerHandoffEvidenceReceipt
      x-zhen-contract-auth: session
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: handoffId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderHandoffEvidenceReceiptResponse'
  /api/provider/workbench/demo-seed:
    post:
      operationId: provider.workbench.demo_seed
      summary: provider.workbench.demo_seed
      tags:
        - console_write
      x-zhen-route-key: providerWorkbenchDemoSeed
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderWorkbenchDemoSeedResponse'
  /api/provider/workbench/leads/{leadId}/claim:
    post:
      operationId: provider.workbench.leads.claim
      summary: provider.workbench.leads.claim
      tags:
        - console_write
      x-zhen-route-key: providerWorkbenchLeadClaim
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: leadId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaimProviderLeadRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformProviderLead'
  /api/provider/workbench/leads/{leadId}/status:
    post:
      operationId: provider.workbench.leads.status
      summary: provider.workbench.leads.status
      tags:
        - console_write
      x-zhen-route-key: providerWorkbenchLeadStatus
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_write
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: leadId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProviderLeadStatusRequest'
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformProviderLead'
  /api/provider/workbench/leads/{leadId}/evidence-receipt:
    get:
      operationId: provider.workbench.leads.evidence_receipt.read
      summary: provider.workbench.leads.evidence_receipt.read
      tags:
        - console_read
      x-zhen-route-key: providerWorkbenchLeadEvidenceReceipt
      x-zhen-contract-auth: session_or_admin
      x-zhen-contract-surface: console_read
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: phase2_stable
      security:
        - bearerAuth: []
      parameters:
        - name: leadId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderLeadEvidenceReceiptResponse'
  /api/public/evidence-receipts/{receiptToken}:
    get:
      operationId: public.evidence_receipts.read
      summary: public.evidence_receipts.read
      tags:
        - public_catalog
      x-zhen-route-key: publicEvidenceReceiptRead
      x-zhen-contract-auth: public
      x-zhen-contract-surface: public_catalog
      x-zhen-contract-stability: phase2_stable
      x-zhen-console-contract: not_console_surface
      parameters:
        - name: receiptToken
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEvidenceReceiptResponse'
  /api/partners/usage/consume:
    post:
      operationId: partners.usage.consume
      summary: partners.usage.consume
      tags:
        - usage_ingest
      x-zhen-route-key: partnerUsageConsume
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: usage_ingest
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/partners/usage/summary:
    get:
      operationId: partners.usage.summary
      summary: partners.usage.summary
      tags:
        - usage_ingest
      x-zhen-route-key: partnerUsageSummary
      x-zhen-contract-auth: admin_or_api_key
      x-zhen-contract-surface: usage_ingest
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/partners/entitlements/grant-free:
    post:
      operationId: partners.entitlements.grant_free
      summary: partners.entitlements.grant_free
      tags:
        - admin_ops
      x-zhen-route-key: partnerGrantFreeEntitlement
      x-zhen-contract-auth: admin_or_api_key_or_partner
      x-zhen-contract-surface: admin_ops
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/partners/events:
    post:
      operationId: partners.events.ingest
      summary: partners.events.ingest
      tags:
        - event_ingest
      x-zhen-route-key: partnerEventsIngest
      x-zhen-contract-auth: admin_or_api_key_or_partner
      x-zhen-contract-surface: event_ingest
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/v1/events/ingest:
    post:
      operationId: events.management.ingest.v1
      summary: events.management.ingest.v1
      tags:
        - event_ingest
      x-zhen-route-key: managementEventsIngestV1
      x-zhen-contract-auth: admin_or_api_key_or_partner
      x-zhen-contract-surface: event_ingest
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
      security:
        - bearerAuth: []
  /api/webhooks/alipay:
    post:
      operationId: webhooks.alipay
      summary: webhooks.alipay
      tags:
        - gateway
      x-zhen-route-key: alipayWebhook
      x-zhen-contract-auth: public
      x-zhen-contract-surface: gateway
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
  /api/webhooks/wechat:
    post:
      operationId: webhooks.wechat
      summary: webhooks.wechat
      tags:
        - gateway
      x-zhen-route-key: wechatWebhook
      x-zhen-contract-auth: public
      x-zhen-contract-surface: gateway
      x-zhen-contract-stability: phase1_gateway
      x-zhen-console-contract: not_console_surface
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token used for admin, API key, or session authentication depending on route. See x-zhen-contract-auth extension for precise mode.
  schemas:
    ActorType:
      enum:
        - key
        - service
        - system
        - user
      type: string
    AdminSettlementCaseEconomicsRequest:
      additionalProperties: false
      properties:
        net_settlement_base_cents:
          type: number
        partner_amount_cents:
          type: number
        partner_share_bps:
          type: number
      required:
        - net_settlement_base_cents
        - partner_amount_cents
        - partner_share_bps
      type: object
    AdminSettlementCaseHoldRequest:
      additionalProperties: false
      properties:
        reason:
          type: string
      required:
        - reason
      type: object
    AdminSettlementOrderReconcileRequest:
      additionalProperties: false
      properties:
        accepted_reason:
          type: string
      required:
        - accepted_reason
      type: object
    ApiKeyStatus:
      enum:
        - active
        - expired
        - revoked
      type: string
    AuthorizationSnapshot:
      additionalProperties: false
      properties:
        entitlements:
          items:
            type: string
          type: array
        quota_snapshot:
          additionalProperties: false
          properties:
            messages_remaining:
              type: number
            tasks_remaining:
              type: number
            tokens_remaining:
              type: number
            transactions_remaining:
              type: number
            workflow_runs_remaining:
              type: number
          type: object
        scopes:
          items:
            type: string
          type: array
      required:
        - entitlements
        - quota_snapshot
        - scopes
      type: object
    BillingCancelInput:
      additionalProperties: false
      properties:
        order_id:
          description: Order ID to cancel
          type: string
        reason:
          description: Reason for cancellation
          type: string
      required:
        - order_id
      type: object
    BillingCheckoutInput:
      additionalProperties: false
      properties:
        amount_cents:
          description: Override amount in cents
          type: number
        billing_cycle:
          description: 'Billing cycle: monthly or annual'
          enum:
            - annual
            - monthly
          type: string
        channel_id:
          description: Attributed frontend channel ID
          type: string
        channel_key:
          description: Attributed frontend channel key
          type: string
        currency:
          description: Currency code (e.g. CNY)
          type: string
        frontend_order_number:
          description: Frontend order number
          type: string
        frontend_source:
          description: Frontend identifier
          type: string
        installment_periods:
          description: Installment periods (annual only, 2-24)
          type: number
        paid_plan_code:
          description: Plan or SKU code to purchase
          type: string
        payment_provider:
          $ref: '#/components/schemas/PaymentProvider'
          description: Preferred payment provider
      required:
        - paid_plan_code
      type: object
    BillingRefundInput:
      additionalProperties: false
      properties:
        order_id:
          description: Order ID to refund
          type: string
        reason:
          description: Reason for refund
          type: string
        refund_amount_cents:
          description: Refund amount in cents (defaults to full order amount)
          type: number
      required:
        - order_id
      type: object
    BillingUnit:
      enum:
        - download
        - message
        - seat
        - task
        - token
        - transaction
        - workflow_run
      type: string
    BrainAsyncAcceptedPayload:
      additionalProperties: false
      properties:
        cancel_url:
          type: string
        message:
          type: string
        query_url:
          type: string
        status:
          const: accepted
          type: string
        stream_url:
          type: string
        workflow_id:
          type: string
      required:
        - cancel_url
        - message
        - query_url
        - status
        - stream_url
        - workflow_id
      type: object
    BrainCancellationPayload:
      additionalProperties: false
      properties:
        reason:
          type: string
        request_id:
          type: string
        workflow_id:
          type: string
      required:
        - reason
        - request_id
        - workflow_id
      type: object
    BrainErrorCode:
      enum:
        - AUTHORIZATION_ERROR
        - ENTITLEMENT_ERROR
        - INTERNAL_ERROR
        - QUOTA_EXCEEDED
        - RISK_BLOCKED
        - TIMEOUT
        - TOOL_ERROR
        - VALIDATION_ERROR
        - WORKFLOW_ERROR
      type: string
    BrainEvaluationSummary:
      additionalProperties: false
      properties:
        evaluation_version:
          type: string
        policy_version:
          type: string
        score:
          type: number
      type: object
    BrainExecutionSandbox:
      additionalProperties: false
      properties:
        execution:
          $ref: '#/components/schemas/BrainSandboxExecutionPolicy'
        lifecycle:
          additionalProperties: false
          properties:
            cleanup_policy:
              enum:
                - manual_review
                - ttl
                - workflow_end
              type: string
            expires_at:
              type: string
            started_at:
              type: string
          required:
            - cleanup_policy
            - expires_at
            - started_at
          type: object
        memory:
          $ref: '#/components/schemas/BrainSandboxMemoryPolicy'
        namespace:
          $ref: '#/components/schemas/BrainSandboxNamespace'
        sandbox_id:
          type: string
      required:
        - execution
        - lifecycle
        - memory
        - namespace
        - sandbox_id
      type: object
    BrainInputPayload:
      additionalProperties: false
      properties:
        actor:
          additionalProperties: false
          properties:
            actor_id:
              type: string
            actor_type:
              enum:
                - key
                - service
                - system
                - user
              type: string
            key_id:
              type: string
            session_id:
              type: string
            user_id:
              type: string
          required:
            - actor_id
            - actor_type
          type: object
        attachments:
          items:
            additionalProperties: false
            properties:
              attachment_id:
                type: string
              kind:
                type: string
              metadata:
                $ref: '#/components/schemas/Record_string_unknown'
              url:
                type: string
            required:
              - attachment_id
              - kind
            type: object
          type: array
        authorization:
          $ref: '#/components/schemas/AuthorizationSnapshot'
        execution:
          additionalProperties: false
          properties:
            domain:
              type: string
            execution_mode:
              $ref: '#/components/schemas/ExecutionMode'
          required:
            - domain
            - execution_mode
          type: object
        idempotency_key:
          type: string
        input:
          additionalProperties: false
          properties:
            structured_input:
              $ref: '#/components/schemas/Record_string_unknown'
            text:
              type: string
          type: object
        request_id:
          type: string
        sandbox:
          $ref: '#/components/schemas/BrainExecutionSandbox'
        tenant:
          $ref: '#/components/schemas/CanonicalTenantRef'
        trace_id:
          type: string
      required:
        - actor
        - attachments
        - authorization
        - execution
        - idempotency_key
        - input
        - request_id
        - sandbox
        - tenant
        - trace_id
      type: object
    BrainOutputPayload:
      additionalProperties: false
      properties:
        artifacts:
          items:
            $ref: '#/components/schemas/Record_string_unknown'
          type: array
        audit:
          additionalProperties: false
          properties:
            decision_path:
              items:
                type: string
              type: array
            policy_version:
              type: string
            request_id:
              type: string
            requires_human_review:
              type: boolean
            sandbox_id:
              type: string
            tool_invocations:
              type: number
            trace_id:
              type: string
            workflow_id:
              type: string
          required:
            - trace_id
          type: object
        domain:
          type: string
        error:
          additionalProperties: false
          properties:
            code:
              $ref: '#/components/schemas/BrainErrorCode'
            message:
              type: string
            retryable:
              type: boolean
          required:
            - code
            - message
          type: object
        evaluation:
          $ref: '#/components/schemas/BrainEvaluationSummary'
        request_id:
          type: string
        result:
          additionalProperties: false
          properties:
            output_text:
              type: string
            structured_output:
              $ref: '#/components/schemas/Record_string_unknown'
          type: object
        review:
          $ref: '#/components/schemas/BrainReviewCheckpoint'
        risk:
          $ref: '#/components/schemas/BrainRiskSummary'
        status:
          $ref: '#/components/schemas/WorkflowStatus'
        trace_id:
          type: string
        usage:
          $ref: '#/components/schemas/CanonicalUsageRecord'
        workflow_id:
          type: string
      required:
        - domain
        - request_id
        - status
        - trace_id
      type: object
    BrainResumePayload:
      additionalProperties: false
      properties:
        idempotency_key:
          type: string
        resume_payload:
          $ref: '#/components/schemas/Record_string_unknown'
        review_token:
          type: string
      required:
        - idempotency_key
        - resume_payload
        - review_token
      type: object
    BrainReviewCheckpoint:
      additionalProperties: false
      properties:
        resume_requirements:
          items:
            type: string
          type: array
        review_deadline:
          type: string
        review_reason:
          type: string
        review_token:
          type: string
      required:
        - review_reason
        - review_token
      type: object
    BrainRiskSummary:
      additionalProperties: false
      properties:
        level:
          enum:
            - critical
            - high
            - low
            - medium
          type: string
        policy_version:
          type: string
        requires_human_review:
          type: boolean
        tags:
          items:
            type: string
          type: array
      required:
        - level
        - requires_human_review
        - tags
      type: object
    BrainSandboxExecutionPolicy:
      additionalProperties: false
      properties:
        allow_cross_workspace_context:
          type: boolean
        allow_global_prompts:
          type: boolean
        allow_persistent_memory_write:
          type: boolean
        isolation_profile:
          type: string
      required:
        - allow_cross_workspace_context
        - allow_global_prompts
        - allow_persistent_memory_write
        - isolation_profile
      type: object
    BrainSandboxMemoryPolicy:
      additionalProperties: false
      properties:
        namespace_key:
          type: string
        promotion_scope:
          enum:
            - tenant
            - user
            - workspace
          type: string
        redact_sensitive_fields:
          type: boolean
        ttl_seconds:
          type: number
      required:
        - namespace_key
        - promotion_scope
        - redact_sensitive_fields
        - ttl_seconds
      type: object
    BrainSandboxNamespace:
      additionalProperties: false
      properties:
        domain:
          type: string
        org_id:
          type: string
        project_id:
          type: string
        session_id:
          type: string
        user_id:
          type: string
        visibility:
          enum:
            - session
            - task
            - tenant
            - user
            - workspace
          type: string
        workspace_id:
          type: string
      required:
        - domain
        - org_id
        - visibility
        - workspace_id
      type: object
    BrainStreamEvent:
      anyOf:
        - additionalProperties: false
          properties:
            status:
              $ref: '#/components/schemas/WorkflowStatus'
            type:
              const: status
              type: string
          required:
            - status
            - type
          type: object
        - additionalProperties: false
          properties:
            delta:
              type: string
            type:
              const: token
              type: string
          required:
            - delta
            - type
          type: object
        - additionalProperties: false
          properties:
            input: {}
            tool:
              type: string
            type:
              const: tool_start
              type: string
          required:
            - input
            - tool
            - type
          type: object
        - additionalProperties: false
          properties:
            result: {}
            tool:
              type: string
            type:
              const: tool_end
              type: string
          required:
            - result
            - tool
            - type
          type: object
        - additionalProperties: false
          properties:
            text:
              type: string
            type:
              const: reasoning
              type: string
          required:
            - text
            - type
          type: object
        - additionalProperties: false
          properties:
            code:
              $ref: '#/components/schemas/BrainErrorCode'
            message:
              type: string
            type:
              const: error
              type: string
          required:
            - code
            - message
            - type
          type: object
        - additionalProperties: false
          properties:
            result:
              $ref: '#/components/schemas/BrainOutputPayload'
            type:
              const: done
              type: string
            workflow_id:
              type: string
          required:
            - result
            - type
            - workflow_id
          type: object
    C2AI2XActorRef:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        actor_role:
          type: string
        actor_type:
          type: string
        delegated_by:
          type: string
      required:
        - actor_id
        - actor_role
        - actor_type
      type: object
    C2AI2XAttachment:
      additionalProperties: false
      properties:
        attachment_id:
          type: string
        kind:
          type: string
        metadata:
          $ref: '#/components/schemas/Record_string_unknown'
        url:
          type: string
      required:
        - attachment_id
        - kind
      type: object
    C2AI2XAuthorizationGrant:
      additionalProperties: false
      properties:
        action_scope:
          items:
            type: string
          type: array
        automation_policy:
          type: string
        constraints:
          $ref: '#/components/schemas/Record_string_unknown'
        data_scope:
          items:
            type: string
          type: array
        demand_id:
          type: string
        expires_at:
          type: string
        extension:
          $ref: '#/components/schemas/Record_string_unknown'
        grant_id:
          type: string
        grantee:
          $ref: '#/components/schemas/C2AI2XActorRef'
        grantor:
          $ref: '#/components/schemas/C2AI2XActorRef'
        issued_at:
          type: string
        redaction_policy:
          type: string
        revocable:
          type: boolean
        revocation_reason:
          type: string
        revoked_at:
          type: string
        status:
          type: string
      required:
        - demand_id
        - grant_id
        - status
      type: object
    C2AI2XDemand:
      additionalProperties: false
      properties:
        authorization:
          $ref: '#/components/schemas/Record_string_unknown'
        constraints:
          $ref: '#/components/schemas/Record_string_unknown'
        extension:
          $ref: '#/components/schemas/Record_string_unknown'
        identity:
          $ref: '#/components/schemas/C2AI2XDemandIdentity'
        input_context:
          $ref: '#/components/schemas/C2AI2XDemandInputContext'
        intent:
          $ref: '#/components/schemas/Record_string_unknown'
        state:
          $ref: '#/components/schemas/Record_string_unknown'
      required:
        - identity
        - input_context
      type: object
    C2AI2XDemandIdentity:
      additionalProperties: false
      properties:
        created_at:
          type: string
        demand_id:
          type: string
        protocol_version:
          type: string
        source_surface:
          type: string
        source_type:
          type: string
      required:
        - demand_id
      type: object
    C2AI2XDemandInputContext:
      additionalProperties: false
      properties:
        attachment_refs:
          items:
            type: string
          type: array
        conversation_refs:
          items:
            type: string
          type: array
        external_refs:
          items:
            type: string
          type: array
        raw_input:
          type: string
        structured_summary:
          type: string
      type: object
    C2AI2XEnvelope:
      additionalProperties: false
      properties:
        actor:
          $ref: '#/components/schemas/C2AI2XActorRef'
        envelope_id:
          type: string
        event_type:
          type: string
        idempotency_key:
          type: string
        message_kind:
          type: string
        occurred_at:
          type: string
        payload:
          $ref: '#/components/schemas/Record_string_unknown'
        producer:
          $ref: '#/components/schemas/C2AI2XEnvelopeProducer'
        protocol:
          type: string
        protocol_version:
          type: string
        subject:
          $ref: '#/components/schemas/C2AI2XEnvelopeSubject'
        trace:
          $ref: '#/components/schemas/C2AI2XEnvelopeTrace'
      required:
        - envelope_id
      type: object
    C2AI2XEnvelopeProducer:
      additionalProperties: false
      properties:
        implementation:
          $ref: '#/components/schemas/Record_string_unknown'
        service:
          type: string
        surface:
          type: string
      required:
        - service
        - surface
      type: object
    C2AI2XEnvelopeSubject:
      additionalProperties: false
      properties:
        demand_id:
          type: string
        phase:
          type: string
        resource_id:
          type: string
        resource_type:
          type: string
      required:
        - resource_id
        - resource_type
      type: object
    C2AI2XEnvelopeTrace:
      additionalProperties: false
      properties:
        causation_id:
          type: string
        parent_event_id:
          type: string
        request_id:
          type: string
        trace_id:
          type: string
      type: object
    C2AI2XExactBridgeMetadata:
      additionalProperties: false
      properties:
        billing_id:
          type: string
        contract_id:
          type: string
        dispute_id:
          type: string
        dispute_status:
          type: string
        escrow_id:
          type: string
        escrow_status:
          type: string
        recovery_id:
          type: string
        recovery_status:
          type: string
        transfer_status:
          type: string
      type: object
    C2AI2XExecuteAcceptedResponse:
      additionalProperties: false
      properties:
        accepted:
          $ref: '#/components/schemas/Record_string_unknown'
        protocol:
          $ref: '#/components/schemas/C2AI2XProtocolReference'
      required:
        - accepted
        - protocol
      type: object
    C2AI2XExecuteCompletedResponse:
      additionalProperties: false
      properties:
        execution:
          $ref: '#/components/schemas/Record_string_unknown'
        protocol:
          $ref: '#/components/schemas/C2AI2XProtocolReference'
      required:
        - execution
        - protocol
      type: object
    C2AI2XExecuteInput:
      additionalProperties: false
      properties:
        attachments:
          items:
            $ref: '#/components/schemas/C2AI2XAttachment'
          type: array
        authorization_grant:
          $ref: '#/components/schemas/C2AI2XAuthorizationGrant'
        demand:
          $ref: '#/components/schemas/C2AI2XDemand'
        domain:
          type: string
        envelope:
          $ref: '#/components/schemas/C2AI2XEnvelope'
        exact_bridge:
          $ref: '#/components/schemas/C2AI2XExactBridgeMetadata'
        execution_mode:
          $ref: '#/components/schemas/C2AI2XExecutionMode'
        idempotency_key:
          type: string
        key_id:
          type: string
        project_id:
          type: string
        request_id:
          type: string
        required_scopes:
          items:
            type: string
          type: array
        session_id:
          type: string
        trace_id:
          type: string
        user_id:
          type: string
      required:
        - demand
        - domain
      type: object
    C2AI2XExecutionMode:
      enum:
        - async
        - sync
      type: string
    C2AI2XProtocolReference:
      additionalProperties: false
      properties:
        demand_id:
          type: string
        envelope_id:
          type: string
        grant_id:
          type: string
        standard:
          type: string
        version:
          type: string
      required:
        - demand_id
        - standard
        - version
      type: object
    CanonicalActorRef:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        actor_type:
          $ref: '#/components/schemas/ActorType'
        key_id:
          type: string
        session_id:
          type: string
        user_id:
          type: string
      required:
        - actor_id
        - actor_type
      type: object
    CanonicalAuditRecord:
      additionalProperties: false
      properties:
        action:
          type: string
        actor_id:
          type: string
        actor_type:
          $ref: '#/components/schemas/ActorType'
        created_at:
          type: string
        event_id:
          type: string
        key_id:
          type: string
        metadata:
          $ref: '#/components/schemas/Record_string_unknown'
        org_id:
          type: string
        policy_version:
          type: string
        request_id:
          type: string
        requires_human_review:
          type: boolean
        resource_id:
          type: string
        resource_type:
          $ref: '#/components/schemas/ResourceType'
        result:
          enum:
            - allowed
            - completed
            - denied
            - failed
          type: string
        risk_level:
          enum:
            - critical
            - high
            - low
            - medium
          type: string
        trace_id:
          type: string
        workspace_id:
          type: string
      required:
        - action
        - actor_id
        - actor_type
        - created_at
        - event_id
        - org_id
        - resource_id
        - resource_type
        - result
        - trace_id
        - workspace_id
      type: object
    CanonicalEventEnvelope:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        actor_type:
          $ref: '#/components/schemas/ActorType'
        event_id:
          type: string
        event_name:
          type: string
        metadata:
          $ref: '#/components/schemas/Record_string_unknown'
        org_id:
          type: string
        request_id:
          type: string
        resource_id:
          type: string
        resource_type:
          $ref: '#/components/schemas/ResourceType'
        status:
          $ref: '#/components/schemas/EventStatus'
        timestamp:
          type: string
        trace_id:
          type: string
        workspace_id:
          type: string
      required:
        - actor_id
        - actor_type
        - event_id
        - event_name
        - metadata
        - org_id
        - resource_id
        - resource_type
        - status
        - timestamp
        - trace_id
        - workspace_id
      type: object
    CanonicalId:
      enum:
        - event_id
        - key_id
        - org_id
        - project_id
        - request_id
        - session_id
        - task_id
        - trace_id
        - user_id
        - workflow_id
        - workspace_id
      type: string
    CanonicalTenantRef:
      additionalProperties: false
      properties:
        org_id:
          type: string
        project_id:
          type: string
        workspace_id:
          type: string
      required:
        - org_id
        - workspace_id
      type: object
    CanonicalUsageRecord:
      additionalProperties: false
      properties:
        duration_ms:
          type: number
        input_tokens:
          type: number
        model_calls:
          type: number
        output_tokens:
          type: number
        tool_calls:
          type: number
        workflow_runs:
          type: number
      required:
        - duration_ms
        - input_tokens
        - model_calls
        - output_tokens
        - tool_calls
        - workflow_runs
      type: object
    ChannelOwnershipStatus:
      enum:
        - active
        - disputed
        - transferred
        - unclaimed
      type: string
    ClaimChannelOwnershipRequest:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        frontend_source_confirmation:
          type: string
        ownership_confirmation:
          type: boolean
        partner_account_id:
          type: string
      required:
        - actor_id
        - frontend_source_confirmation
        - ownership_confirmation
        - partner_account_id
      type: object
    ClaimProviderLeadRequest:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        provider_profile_id:
          type: string
      required:
        - actor_id
        - provider_profile_id
      type: object
    CommercialItemKind:
      enum:
        - one_time
        - plan
        - service
      type: string
    CreateChannelLeadRequest:
      additionalProperties: false
      properties:
        message:
          type: string
        requester_contact:
          type: string
        requester_name:
          type: string
        source_url:
          type: string
      required:
        - message
      type: object
    CreateFrontendChannelInput:
      additionalProperties: false
      properties:
        channel_name:
          type: string
        created_by:
          type: string
        display_name:
          type: string
        entry_origin:
          $ref: '#/components/schemas/PlatformFrontendChannelEntryOrigin'
        frontend_source:
          type: string
        industry_or_vertical:
          type: string
        locale:
          type: string
        mode:
          $ref: '#/components/schemas/PlatformAccessMode'
        operator_display_name:
          type: string
        org_id:
          type: string
        provider_entry_mode:
          $ref: '#/components/schemas/ProviderEntryMode'
        use_case_summary:
          type: string
        workspace_id:
          type: string
      required:
        - mode
        - provider_entry_mode
      type: object
    CreateProviderHandoffRequest:
      additionalProperties: false
      properties:
        lead_id:
          type: string
        provider_profile_id:
          type: string
        redacted_summary:
          type: string
      required:
        - lead_id
        - provider_profile_id
        - redacted_summary
      type: object
    CreateProviderRoleChangeRequest:
      additionalProperties: false
      properties:
        requested_role:
          $ref: '#/components/schemas/PlatformProviderRole'
      required:
        - requested_role
      type: object
    CreatePublicConversationRequest:
      additionalProperties: false
      properties:
        requester_contact:
          type: string
        requester_name:
          type: string
        source_url:
          type: string
      type: object
    DeliveryKind:
      enum:
        - activation
        - download
        - link
        - manual_service
      type: string
    DeliveryStatus:
      enum:
        - activated
        - completed
        - pending
        - ready
      type: string
    DeveloperTrialApiKeyResponse:
      additionalProperties: false
      properties:
        environment:
          $ref: '#/components/schemas/Environment'
        issued_token_once:
          description: Returned only on the initial successful provisioning response.
          type: string
        key_id:
          type: string
        scopes:
          items:
            type: string
          type: array
      required:
        - environment
        - key_id
        - scopes
      type: object
    DeveloperTrialRequest:
      additionalProperties: false
      properties:
        display_name:
          type: string
        email:
          type: string
        organization_name:
          type: string
        verification_token:
          type: string
      required:
        - display_name
        - email
        - organization_name
        - verification_token
      type: object
    DeveloperTrialResponse:
      additionalProperties: false
      properties:
        api_key:
          $ref: '#/components/schemas/DeveloperTrialApiKeyResponse'
        entitlement:
          $ref: '#/components/schemas/Pick_PlatformEntitlement_"status"|"entitlement_id"|"plan_code"'
        organization:
          $ref: '#/components/schemas/Pick_PlatformOrganization_"name"|"org_id"'
        workspace:
          $ref: '#/components/schemas/Pick_PlatformWorkspace_"name"|"workspace_id"'
      required:
        - api_key
        - entitlement
        - organization
        - workspace
      type: object
    EntitlementSource:
      enum:
        - admin
        - order
        - trial
      type: string
    EntitlementStatus:
      enum:
        - active
        - cancelled
        - exhausted
        - expired
        - trialing
      type: string
    Environment:
      enum:
        - production
        - sandbox
        - staging
      type: string
    EventStatus:
      enum:
        - accepted
        - cancelled
        - completed
        - expired
        - failed
        - in_progress
      type: string
    Exclude:
      enum:
        - pending_review
        - profile_incomplete
        - suspended
      type: string
    ExecutionMode:
      enum:
        - async
        - sync
      type: string
    Extract:
      enum:
        - ENTITLEMENT_ERROR
        - QUOTA_EXCEEDED
      type: string
    FrontendChannelFullApiReadinessResponse:
      additionalProperties: false
      properties:
        auth_status:
          enum:
            - pending
            - ready
          type: string
        channel_id:
          type: string
        missing_prerequisites:
          items:
            type: string
          type: array
        scope_status:
          enum:
            - pending
            - ready
          type: string
        status:
          $ref: '#/components/schemas/PlatformFullApiStatus'
        usage_status:
          enum:
            - pending
            - ready
          type: string
        webhook_status:
          enum:
            - pending
            - ready
          type: string
      required:
        - auth_status
        - channel_id
        - missing_prerequisites
        - scope_status
        - status
        - usage_status
        - webhook_status
      type: object
    FrontendChannelStarterBundleResponse:
      additionalProperties: false
      properties:
        asset_status:
          additionalProperties: false
          properties:
            copy_kit:
              const: ready
              type: string
            qr_code:
              const: ready
              type: string
            short_link:
              enum:
                - fallback
                - ready
              type: string
          required:
            - copy_kit
            - qr_code
            - short_link
          type: object
        channel:
          $ref: '#/components/schemas/PlatformFrontendChannel'
        copy_blocks:
          items:
            $ref: '#/components/schemas/PlatformStarterCopyBlock'
          type: array
        preview_url:
          type: string
        primary_url:
          type: string
        provider_cta:
          additionalProperties: false
          properties:
            enabled:
              type: boolean
            url:
              type: string
          required:
            - enabled
          type: object
        qr_code_value:
          type: string
        short_link_url:
          type: string
      required:
        - asset_status
        - channel
        - copy_blocks
        - preview_url
        - primary_url
        - qr_code_value
        - short_link_url
      type: object
    FrontendChannelStarterDetailResponse:
      additionalProperties: false
      properties:
        activation_summary:
          $ref: '#/components/schemas/PlatformFrontendChannelActivationSummary'
        assets:
          items:
            $ref: '#/components/schemas/PlatformStarterAsset'
          type: array
        bundle:
          $ref: '#/components/schemas/PlatformStarterBundle'
        campaigns:
          items:
            $ref: '#/components/schemas/PlatformStarterCampaign'
          type: array
        channel:
          $ref: '#/components/schemas/PlatformFrontendChannel'
        commercial:
          $ref: '#/components/schemas/PlatformStarterCommercialStatus'
        comparable_funnel:
          $ref: '#/components/schemas/PlatformStarterComparableFunnel'
        funnel:
          $ref: '#/components/schemas/PlatformStarterGaFunnel'
        ownership:
          $ref: '#/components/schemas/PlatformStarterOwnershipSummary'
      required:
        - activation_summary
        - assets
        - bundle
        - campaigns
        - channel
        - commercial
        - comparable_funnel
        - funnel
        - ownership
      type: object
    FrontendChannelStatus:
      enum:
        - active
        - draft
        - suspended
      type: string
    FrontendChannelsListResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlatformFrontendChannel'
          type: array
      required:
        - items
      type: object
    FulfillmentKind:
      enum:
        - download
        - entitlement
        - hybrid
        - service
      type: string
    IssuedPlatformApiKeyResponse:
      additionalProperties: false
      description: The public creation response excludes the durable bearer-token verifier.
      properties:
        created_at:
          type: string
        created_by:
          type: string
        entitlement_ids:
          items:
            type: string
          type: array
        environment:
          $ref: '#/components/schemas/Environment'
        issued_token_once:
          type: string
        key_id:
          type: string
        label:
          type: string
        org_id:
          type: string
        scopes:
          items:
            type: string
          type: array
        status:
          $ref: '#/components/schemas/ApiKeyStatus'
        token_preview:
          type: string
        workspace_id:
          type: string
      required:
        - created_at
        - created_by
        - entitlement_ids
        - environment
        - issued_token_once
        - key_id
        - label
        - org_id
        - scopes
        - status
        - token_preview
        - workspace_id
      type: object
    MembershipStatus:
      enum:
        - active
        - disabled
        - invited
      type: string
    OrderStatus:
      enum:
        - cancelled
        - draft
        - paid
        - pending_payment
        - refunded
      type: string
    OrgStatus:
      enum:
        - active
        - suspended
      type: string
    Partial_Record_BillingUnit_number:
      additionalProperties: false
      properties:
        download:
          type: number
        message:
          type: number
        seat:
          type: number
        task:
          type: number
        token:
          type: number
        transaction:
          type: number
        workflow_run:
          type: number
      type: object
    PartnerAccountStatus:
      enum:
        - active
        - pending_claim
        - suspended
      type: string
    PaymentProvider:
      enum:
        - alipay
        - wechat
      type: string
    PayoutBatchStatus:
      enum:
        - failed
        - paid
        - partially_failed
        - processing
        - scheduled
      type: string
    PayoutLineStatus:
      enum:
        - batched
        - held
        - paid
        - ready
        - reversed
      type: string
    PayoutVerificationStatus:
      enum:
        - disabled
        - pending_review
        - rejected
        - verified
      type: string
    Pick_PlatformEntitlement_"status"|"entitlement_id"|"plan_code":
      additionalProperties: false
      properties:
        entitlement_id:
          type: string
        plan_code:
          type: string
        status:
          $ref: '#/components/schemas/EntitlementStatus'
      required:
        - entitlement_id
        - plan_code
        - status
      type: object
    Pick_PlatformOrganization_"name"|"org_id":
      additionalProperties: false
      properties:
        name:
          type: string
        org_id:
          type: string
      required:
        - name
        - org_id
      type: object
    Pick_PlatformWorkspace_"name"|"workspace_id":
      additionalProperties: false
      properties:
        name:
          type: string
        workspace_id:
          type: string
      required:
        - name
        - workspace_id
      type: object
    PlatformAccessMode:
      enum:
        - full_api
        - hosted_inbox
        - widget_embed
      type: string
    PlatformChannelOwnership:
      additionalProperties: false
      properties:
        channel_id:
          type: string
        created_at:
          type: string
        ownership_effective_at:
          type: string
        ownership_id:
          type: string
        partner_account_id:
          type: string
        status:
          $ref: '#/components/schemas/ChannelOwnershipStatus'
        updated_at:
          type: string
      required:
        - channel_id
        - created_at
        - ownership_effective_at
        - ownership_id
        - status
        - updated_at
      type: object
    PlatformDeliveryAsset:
      additionalProperties: false
      properties:
        asset_code:
          type: string
        delivery_kind:
          $ref: '#/components/schemas/DeliveryKind'
        instructions:
          type: string
        metadata:
          $ref: '#/components/schemas/Record_string_unknown'
        title:
          type: string
        url:
          type: string
      required:
        - asset_code
        - delivery_kind
        - title
      type: object
    PlatformEntitlement:
      additionalProperties: false
      properties:
        assigned_user_id:
          type: string
        created_at:
          type: string
        ends_at:
          type: string
        entitlement_id:
          type: string
        limits:
          $ref: '#/components/schemas/Partial_Record_BillingUnit_number'
        linked_order_id:
          type: string
        org_id:
          type: string
        plan_code:
          type: string
        product_code:
          $ref: '#/components/schemas/ProductCode'
        scopes:
          items:
            type: string
          type: array
        source:
          $ref: '#/components/schemas/EntitlementSource'
        source_item_code:
          type: string
        starts_at:
          type: string
        status:
          $ref: '#/components/schemas/EntitlementStatus'
        usage:
          $ref: '#/components/schemas/Partial_Record_BillingUnit_number'
        warning_ratio:
          type: number
        workspace_id:
          type: string
      required:
        - created_at
        - entitlement_id
        - limits
        - org_id
        - plan_code
        - product_code
        - scopes
        - source
        - starts_at
        - status
        - usage
        - warning_ratio
        - workspace_id
      type: object
    PlatformEvidenceReceiptOutcome:
      enum:
        - completed
        - follow_up_required
        - resolved
      type: string
    PlatformEvidenceReceiptStatus:
      enum:
        - published
        - revoked
      type: string
    PlatformFrontendChannel:
      additionalProperties: false
      properties:
        channel_id:
          type: string
        channel_key:
          type: string
        created_at:
          type: string
        created_by:
          type: string
        display_name:
          type: string
        domain_verification_status:
          $ref: '#/components/schemas/StarterDomainVerificationStatus'
        entry_origin:
          $ref: '#/components/schemas/PlatformFrontendChannelEntryOrigin'
        frontend_source:
          type: string
        full_api_missing_prerequisites:
          items:
            type: string
          type: array
        full_api_status:
          $ref: '#/components/schemas/PlatformFullApiStatus'
        hosted_inbox_status:
          $ref: '#/components/schemas/PlatformHostedInboxStatus'
        hosted_inbox_url:
          type: string
        industry_or_vertical:
          type: string
        locale:
          type: string
        mode:
          $ref: '#/components/schemas/PlatformAccessMode'
        operator_display_name:
          type: string
        org_id:
          type: string
        provider_entry_mode:
          $ref: '#/components/schemas/ProviderEntryMode'
        status:
          $ref: '#/components/schemas/FrontendChannelStatus'
        updated_at:
          type: string
        use_case_summary:
          type: string
        verified_domain:
          type: string
        widget_enabled:
          type: boolean
        workspace_id:
          type: string
      required:
        - channel_id
        - channel_key
        - created_at
        - created_by
        - display_name
        - domain_verification_status
        - entry_origin
        - frontend_source
        - full_api_missing_prerequisites
        - full_api_status
        - hosted_inbox_status
        - hosted_inbox_url
        - industry_or_vertical
        - locale
        - mode
        - org_id
        - provider_entry_mode
        - status
        - updated_at
        - use_case_summary
        - widget_enabled
        - workspace_id
      type: object
    PlatformFrontendChannelActivationSummary:
      additionalProperties: false
      properties:
        snippet_copied:
          type: boolean
        widget_verified:
          type: boolean
      required:
        - snippet_copied
        - widget_verified
      type: object
    PlatformFrontendChannelEntryOrigin:
      enum:
        - managed_integrations
        - public_starter
      type: string
    PlatformFullApiStatus:
      enum:
        - not_enabled
        - pending
        - ready
      type: string
    PlatformHostedInboxStatus:
      enum:
        - failed
        - provisioning
        - ready
      type: string
    PlatformModule:
      additionalProperties: false
      properties:
        doesNotOwn:
          items:
            type: string
          type: array
        name:
          $ref: '#/components/schemas/PlatformModuleName'
        owns:
          items:
            type: string
          type: array
        responsibility:
          type: string
      required:
        - doesNotOwn
        - name
        - owns
        - responsibility
      type: object
    PlatformModuleName:
      enum:
        - auth
        - billing
        - entitlements
        - events
        - keys
        - orgs
      type: string
    PlatformOpenApiSchemaAnchor:
      additionalProperties: false
      properties:
        billing_cancel_input:
          $ref: '#/components/schemas/BillingCancelInput'
        billing_checkout_input:
          $ref: '#/components/schemas/BillingCheckoutInput'
        billing_refund_input:
          $ref: '#/components/schemas/BillingRefundInput'
        developer_trial_request:
          $ref: '#/components/schemas/DeveloperTrialRequest'
        developer_trial_response:
          $ref: '#/components/schemas/DeveloperTrialResponse'
        platform_order:
          $ref: '#/components/schemas/PlatformOrder'
        platform_purchase_result:
          $ref: '#/components/schemas/PlatformPurchaseResult'
        trial_onboarding_input:
          $ref: '#/components/schemas/TrialOnboardingInput'
        trial_onboarding_result:
          $ref: '#/components/schemas/TrialOnboardingResult'
      type: object
    PlatformOrder:
      additionalProperties: false
      properties:
        amount_cents:
          type: number
        bridge:
          $ref: '#/components/schemas/PlatformOrderBridge'
        created_at:
          type: string
        created_by:
          type: string
        currency:
          type: string
        delivery_items:
          items:
            $ref: '#/components/schemas/PlatformDeliveryAsset'
          type: array
        delivery_status:
          $ref: '#/components/schemas/DeliveryStatus'
        fulfillment_kind:
          $ref: '#/components/schemas/FulfillmentKind'
        idempotency_key:
          type: string
        item_code:
          type: string
        item_title:
          type: string
        order_id:
          type: string
        order_kind:
          $ref: '#/components/schemas/CommercialItemKind'
        org_id:
          type: string
        paid_at:
          type: string
        payment_payload:
          $ref: '#/components/schemas/Record_string_unknown'
        payment_provider:
          $ref: '#/components/schemas/PaymentProvider'
        plan_code:
          type: string
        product_code:
          $ref: '#/components/schemas/ProductCode'
        recommended_item_codes:
          items:
            type: string
          type: array
        sku_code:
          type: string
        status:
          $ref: '#/components/schemas/OrderStatus'
        workspace_id:
          type: string
      required:
        - amount_cents
        - bridge
        - created_at
        - created_by
        - currency
        - delivery_items
        - delivery_status
        - fulfillment_kind
        - item_code
        - item_title
        - order_id
        - order_kind
        - org_id
        - product_code
        - recommended_item_codes
        - status
        - workspace_id
      type: object
    PlatformOrderBridge:
      additionalProperties: false
      properties:
        assigned_user_id:
          type: string
        billing_cycle:
          enum:
            - annual
            - monthly
          type: string
        cancellation_reason:
          type: string
        channel_id:
          type: string
        channel_key:
          type: string
        entitlement_id:
          type: string
        frontend_order_number:
          type: string
        frontend_source:
          type: string
        payment_code_url:
          type: string
        payment_provider:
          $ref: '#/components/schemas/PaymentProvider'
        platform_order_id:
          type: string
        refund_amount_cents:
          type: number
        refund_reason:
          type: string
        workspace_id:
          type: string
      required:
        - platform_order_id
        - workspace_id
      type: object
    PlatformOrganization:
      additionalProperties: false
      properties:
        created_at:
          type: string
        name:
          type: string
        org_id:
          type: string
        owner_user_id:
          type: string
        status:
          $ref: '#/components/schemas/OrgStatus'
      required:
        - created_at
        - name
        - org_id
        - owner_user_id
        - status
      type: object
    PlatformPartnerAccount:
      additionalProperties: false
      properties:
        auth_user_id:
          type: string
        created_at:
          type: string
        created_by_user_id:
          type: string
        legal_name:
          type: string
        org_id:
          type: string
        partner_account_id:
          type: string
        partner_role:
          const: channel_partner
          type: string
        status:
          $ref: '#/components/schemas/PartnerAccountStatus'
        updated_at:
          type: string
        workspace_id:
          type: string
      required:
        - created_at
        - created_by_user_id
        - legal_name
        - org_id
        - partner_account_id
        - partner_role
        - status
        - updated_at
        - workspace_id
      type: object
    PlatformPartnerSettlementActivationResponse:
      additionalProperties: false
      properties:
        admission_fee:
          $ref: '#/components/schemas/PlatformProviderAdmissionFeeStatus'
        auth_user_id:
          type: string
        eligible_workspace_ids:
          items:
            type: string
          type: array
        missing_requirements:
          items:
            type: string
          type: array
        partner_account_id:
          type: string
        payout_profile_id:
          type: string
        provider_profile_id:
          type: string
        status:
          $ref: '#/components/schemas/PlatformPartnerSettlementActivationStatus'
        workspace_id:
          type: string
      required:
        - admission_fee
        - auth_user_id
        - eligible_workspace_ids
        - missing_requirements
        - status
      type: object
    PlatformPartnerSettlementActivationStatus:
      enum:
        - activation_incomplete
        - not_onboarded
        - ready
        - workspace_selection_required
      type: string
    PlatformPartnerSettlementCenter:
      additionalProperties: false
      properties:
        channel_ownerships:
          items:
            $ref: '#/components/schemas/PlatformChannelOwnership'
          type: array
        partner_account:
          $ref: '#/components/schemas/PlatformPartnerAccount'
        payout_profile:
          $ref: '#/components/schemas/PlatformPayoutProfile'
        settlement_summary:
          additionalProperties: false
          properties:
            held_count:
              type: number
            paid_count:
              type: number
            pending_count:
              type: number
            ready_count:
              type: number
          required:
            - held_count
            - paid_count
            - pending_count
            - ready_count
          type: object
      required:
        - channel_ownerships
        - partner_account
        - settlement_summary
      type: object
    PlatformPartnerSettlementFormulaBreakdown:
      additionalProperties: false
      properties:
        currency:
          type: string
        gross_amount_cents:
          type: number
        net_payout_cents:
          type: number
        platform_fee_cents:
          type: number
        provider_payout_cents:
          type: number
        refund_reserved_cents:
          type: number
        take_rate_bps:
          type: number
        tax_withheld_cents:
          type: number
      required:
        - currency
        - gross_amount_cents
        - net_payout_cents
        - platform_fee_cents
        - provider_payout_cents
        - refund_reserved_cents
        - take_rate_bps
        - tax_withheld_cents
      type: object
    PlatformPartnerSettlementNotificationPreview:
      additionalProperties: false
      properties:
        created_at:
          type: string
        delivery_target:
          enum:
            - email
            - in_app
            - sms
          type: string
        event_name:
          enum:
            - payout_batched
            - payout_failed
            - payout_paid
            - payout_profile_verified
            - settlement_on_hold
            - settlement_ready
            - settlement_reversed
          type: string
        status:
          enum:
            - pending
            - sent
          type: string
      required:
        - created_at
        - delivery_target
        - event_name
        - status
      type: object
    PlatformPartnerSettlementQueryResponse:
      additionalProperties: false
      properties:
        acceptance_record:
          $ref: '#/components/schemas/PlatformSettlementAcceptanceRecord'
        eligibility_status:
          type: string
        formula:
          $ref: '#/components/schemas/PlatformPartnerSettlementFormulaBreakdown'
        missing_requirements:
          items:
            type: string
          type: array
        notification_events:
          items:
            $ref: '#/components/schemas/PlatformPartnerSettlementNotificationPreview'
          type: array
        order:
          $ref: '#/components/schemas/PlatformOrder'
        payout_batches:
          items:
            $ref: '#/components/schemas/PlatformPayoutBatch'
          type: array
        payout_line:
          $ref: '#/components/schemas/PlatformPayoutLine'
        payout_status:
          $ref: '#/components/schemas/PlatformPartnerSettlementQueryStatus'
        query:
          additionalProperties: false
          properties:
            matched_by:
              enum:
                - order_id
                - settlement_case_id
              type: string
            order_id:
              type: string
            settlement_case_id:
              type: string
          required:
            - matched_by
          type: object
        reconciliation:
          $ref: '#/components/schemas/PlatformPartnerSettlementReconciliationRecord'
        settlement_case:
          $ref: '#/components/schemas/PlatformSettlementCase'
        source_of_truth:
          const: platform-core
          type: string
        status_explanation:
          type: string
      required:
        - eligibility_status
        - missing_requirements
        - notification_events
        - order
        - payout_batches
        - payout_status
        - query
        - source_of_truth
        - status_explanation
      type: object
    PlatformPartnerSettlementQueryStatus:
      enum:
        - in_payout
        - not_ready
        - on_hold
        - paid
        - pending_review
        - ready_to_settle
      type: string
    PlatformPartnerSettlementReconciliationRecord:
      additionalProperties: false
      properties:
        batch_id:
          type: string
        eligibility_status:
          type: string
        gross_amount_cents:
          type: number
        net_payout_cents:
          type: number
        order_id:
          type: string
        partner_account_id:
          type: string
        payout_status:
          type: string
        platform_fee_cents:
          type: number
        provider_payout_cents:
          type: number
        refund_reserved_cents:
          type: number
        settlement_case_id:
          type: string
        tax_withheld_cents:
          type: number
        updated_at:
          type: string
      required:
        - eligibility_status
        - gross_amount_cents
        - net_payout_cents
        - order_id
        - partner_account_id
        - payout_status
        - platform_fee_cents
        - provider_payout_cents
        - refund_reserved_cents
        - settlement_case_id
        - tax_withheld_cents
        - updated_at
      type: object
    PlatformPayoutBatch:
      additionalProperties: false
      properties:
        created_at:
          type: string
        currency:
          type: string
        failure_reason:
          type: string
        line_ids:
          items:
            type: string
          type: array
        partner_account_id:
          type: string
        payout_batch_id:
          type: string
        payout_profile_id:
          type: string
        processed_at:
          type: string
        scheduled_for:
          type: string
        status:
          $ref: '#/components/schemas/PayoutBatchStatus'
        total_amount_cents:
          type: number
        transfer_reference:
          type: string
      required:
        - created_at
        - currency
        - line_ids
        - partner_account_id
        - payout_batch_id
        - payout_profile_id
        - scheduled_for
        - status
        - total_amount_cents
      type: object
    PlatformPayoutBatchListResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlatformPayoutBatch'
          type: array
      required:
        - items
      type: object
    PlatformPayoutLine:
      additionalProperties: false
      properties:
        amount_cents:
          type: number
        created_at:
          type: string
        currency:
          type: string
        partner_account_id:
          type: string
        payout_line_id:
          type: string
        payout_profile_id:
          type: string
        settlement_case_id:
          type: string
        status:
          $ref: '#/components/schemas/PayoutLineStatus'
        updated_at:
          type: string
      required:
        - amount_cents
        - created_at
        - currency
        - partner_account_id
        - payout_line_id
        - payout_profile_id
        - settlement_case_id
        - status
        - updated_at
      type: object
    PlatformPayoutProfile:
      additionalProperties: false
      properties:
        account_last4:
          type: string
        bank_name:
          type: string
        created_at:
          type: string
        holder_name:
          type: string
        partner_account_id:
          type: string
        payout_method:
          const: bank_transfer
          type: string
        payout_profile_id:
          type: string
        risk_status:
          enum:
            - clear
            - review_required
          type: string
        tax_status:
          enum:
            - collected
            - missing
          type: string
        updated_at:
          type: string
        verification_status:
          $ref: '#/components/schemas/PayoutVerificationStatus'
      required:
        - account_last4
        - bank_name
        - created_at
        - holder_name
        - partner_account_id
        - payout_method
        - payout_profile_id
        - risk_status
        - tax_status
        - updated_at
        - verification_status
      type: object
    PlatformProviderAdmissionFeeStatus:
      additionalProperties: false
      properties:
        delivered_assets:
          items:
            type: string
          type: array
        fee_code:
          const: provider_network_admission_fee
          type: string
        item_code:
          const: platform.sku.provider-network-admission
          type: string
        plan_code:
          const: platform.provider.network.admission
          type: string
        status:
          $ref: '#/components/schemas/PlatformQualificationFeeStatus'
        trigger_event:
          const: provider_activated
          type: string
      required:
        - delivered_assets
        - fee_code
        - item_code
        - plan_code
        - status
        - trigger_event
      type: object
    PlatformProviderAdmissionReview:
      additionalProperties: false
      properties:
        created_at:
          type: string
        decision:
          enum:
            - approve
            - needs_information
            - reject
          type: string
        evaluation_version:
          type: string
        policy_version:
          type: string
        provider_admission_review_id:
          type: string
        provider_profile_id:
          type: string
        reviewed_at:
          type: string
        risk_level:
          enum:
            - critical
            - high
            - low
            - medium
          type: string
        risk_tags:
          items:
            type: string
          type: array
        score:
          type: number
        status:
          $ref: '#/components/schemas/PlatformProviderAdmissionReviewStatus'
        supplement_requirements:
          items:
            type: string
          type: array
        updated_at:
          type: string
        user_message:
          type: string
        workflow_id:
          type: string
      required:
        - created_at
        - provider_admission_review_id
        - provider_profile_id
        - status
        - updated_at
      type: object
    PlatformProviderAdmissionReviewStatus:
      enum:
        - completed
        - failed
        - needs_information
        - queued
      type: string
    PlatformProviderHandoffStatus:
      enum:
        - claimed
        - closed
        - expired
        - in_progress
        - offered
        - revoked
      type: string
    PlatformProviderHandoffView:
      additionalProperties: false
      properties:
        claimed_at:
          type: string
        closed_at:
          type: string
        handoff_id:
          type: string
        offered_at:
          type: string
        redacted_summary:
          type: string
        status:
          $ref: '#/components/schemas/PlatformProviderHandoffStatus'
        updated_at:
          type: string
      required:
        - handoff_id
        - offered_at
        - redacted_summary
        - status
        - updated_at
      type: object
    PlatformProviderLead:
      additionalProperties: false
      properties:
        channel_id:
          type: string
        completed_at:
          type: string
        completion_summary:
          type: string
        created_at:
          type: string
        lead_id:
          type: string
        message:
          type: string
        org_id:
          type: string
        provider_profile_id:
          type: string
        requester_contact:
          type: string
        requester_name:
          type: string
        source_context:
          $ref: '#/components/schemas/PlatformStarterSourceContext'
        source_url:
          type: string
        status:
          $ref: '#/components/schemas/PlatformProviderLeadStatus'
        updated_at:
          type: string
        workspace_id:
          type: string
      required:
        - channel_id
        - created_at
        - lead_id
        - message
        - org_id
        - status
        - updated_at
        - workspace_id
      type: object
    PlatformProviderLeadStatus:
      enum:
        - claimed
        - closed
        - in_progress
        - open
        - rejected
      type: string
    PlatformProviderPrimaryType:
      enum:
        - aerial
        - business_development
        - community_events
        - content_production
        - customer_service
        - customer_success_support
        - data_analytics
        - decision_risk
        - education_training
        - extreme_environment
        - field_operations
        - finance_audit
        - financial_insurance
        - healthcare
        - humanoid
        - knowledge_retrieval
        - legal_compliance
        - logistics_fulfillment
        - manipulator_cobot
        - marketing_content
        - marketing_growth
        - medical_micro
        - multi_agent_orchestration
        - operations
        - operations_execution
        - other_agent
        - other_collaborator
        - other_expert
        - other_robot
        - people_organization
        - product_design
        - project_coordination
        - quadruped
        - remote_delivery
        - research_data_annotation
        - research_specialist
        - sales
        - sales_business
        - soft
        - software_engineering
        - strategy_management
        - surface_marine
        - system_integration
        - technology_engineering
        - tracked
        - underwater_deep_sea
        - wheeled
        - workflow_automation
      type: string
    PlatformProviderProfile:
      additionalProperties: false
      properties:
        admission_review:
          $ref: '#/components/schemas/PlatformProviderAdmissionReview'
        created_at:
          type: string
        display_name:
          type: string
        headline:
          type: string
        org_id:
          type: string
        provider_primary_type:
          $ref: '#/components/schemas/PlatformProviderPrimaryType'
        provider_profile_id:
          type: string
        provider_role:
          $ref: '#/components/schemas/PlatformProviderRole'
        review_context:
          $ref: '#/components/schemas/PlatformProviderReviewContext'
        review_status:
          $ref: '#/components/schemas/PlatformProviderReviewStatus'
        service_domains:
          items:
            type: string
          type: array
        service_regions:
          items:
            type: string
          type: array
        updated_at:
          type: string
        user_id:
          type: string
        workspace_id:
          type: string
      required:
        - created_at
        - display_name
        - headline
        - org_id
        - provider_profile_id
        - provider_role
        - review_status
        - service_domains
        - service_regions
        - updated_at
        - user_id
        - workspace_id
      type: object
    PlatformProviderReviewActionCode:
      enum:
        - complete_profile
        - contact_support
        - wait_for_review
      type: string
    PlatformProviderReviewContext:
      additionalProperties: false
      properties:
        message:
          type: string
        next_action:
          additionalProperties: false
          properties:
            code:
              $ref: '#/components/schemas/PlatformProviderReviewActionCode'
            label:
              type: string
          required:
            - code
            - label
          type: object
        reason_code:
          $ref: '#/components/schemas/Exclude'
        status:
          $ref: '#/components/schemas/PlatformProviderAdmissionReviewStatus'
        supplement_requirements:
          items:
            type: string
          type: array
        updated_at:
          type: string
      required:
        - message
        - updated_at
      type: object
    PlatformProviderReviewStatus:
      enum:
        - active
        - pending_review
        - profile_incomplete
        - suspended
      type: string
    PlatformProviderRole:
      enum:
        - agent
        - collaborator
        - human
        - robot
      type: string
    PlatformProviderRoleChangeRequest:
      additionalProperties: false
      properties:
        created_at:
          type: string
        current_role:
          $ref: '#/components/schemas/PlatformProviderRole'
        provider_profile_id:
          type: string
        provider_role_change_request_id:
          type: string
        requested_role:
          $ref: '#/components/schemas/PlatformProviderRole'
        status:
          const: pending_review
          type: string
        updated_at:
          type: string
      required:
        - created_at
        - current_role
        - provider_profile_id
        - provider_role_change_request_id
        - requested_role
        - status
        - updated_at
      type: object
    PlatformPublicConversationAsyncAccepted:
      additionalProperties: false
      properties:
        cancel_url:
          type: string
        conversation_id:
          type: string
        handoff_reason:
          type: string
        initial_status:
          const: accepted
          type: string
        mode:
          const: async
          type: string
        query_url:
          type: string
        stream_url:
          type: string
        suggested_handoff:
          type: boolean
        workflow_id:
          type: string
      required:
        - cancel_url
        - conversation_id
        - initial_status
        - mode
        - query_url
        - stream_url
        - suggested_handoff
        - workflow_id
      type: object
    PlatformPublicConversationStatus:
      enum:
        - active
        - closed
        - handoff_requested
      type: string
    PlatformPublicConversationSyncResult:
      additionalProperties: false
      properties:
        assistant_reply:
          type: string
        conversation_id:
          type: string
        handoff_reason:
          type: string
        lead:
          $ref: '#/components/schemas/PlatformProviderLead'
        mode:
          const: sync
          type: string
        status:
          $ref: '#/components/schemas/PlatformPublicConversationStatus'
        suggested_handoff:
          type: boolean
      required:
        - assistant_reply
        - conversation_id
        - status
        - suggested_handoff
      type: object
    PlatformPurchaseResult:
      additionalProperties: false
      properties:
        delivery_items:
          items:
            $ref: '#/components/schemas/PlatformDeliveryAsset'
          type: array
        entitlement:
          $ref: '#/components/schemas/PlatformEntitlement'
        order:
          $ref: '#/components/schemas/PlatformOrder'
        recommendations:
          items:
            $ref: '#/components/schemas/PlatformRecommendation'
          type: array
      required:
        - delivery_items
        - order
        - recommendations
      type: object
    PlatformQualificationFeeStatus:
      enum:
        - active
        - eligible_unpaid
        - not_eligible
      type: string
    PlatformRecommendation:
      additionalProperties: false
      properties:
        currency:
          type: string
        display_name:
          type: string
        item_code:
          type: string
        message:
          type: string
        price_cents:
          type: number
        priority:
          type: number
        product_code:
          $ref: '#/components/schemas/ProductCode'
        reason:
          $ref: '#/components/schemas/RecommendationReason'
      required:
        - display_name
        - item_code
        - message
        - priority
        - product_code
        - reason
      type: object
    PlatformRecoveryPayload:
      additionalProperties: false
      properties:
        action:
          const: purchase_or_upgrade
          type: string
        reason:
          $ref: '#/components/schemas/Extract'
        recommendations:
          items:
            $ref: '#/components/schemas/PlatformRecommendation'
          type: array
      required:
        - action
        - reason
        - recommendations
      type: object
    PlatformSession:
      additionalProperties: false
      properties:
        expires_at:
          type: string
        issued_at:
          type: string
        org_id:
          type: string
        session_id:
          type: string
        status:
          $ref: '#/components/schemas/SessionStatus'
        user_id:
          type: string
        workspace_id:
          type: string
      required:
        - expires_at
        - issued_at
        - session_id
        - status
        - user_id
      type: object
    PlatformSettlementAcceptanceRecord:
      additionalProperties: false
      properties:
        acceptance_record_id:
          type: string
        accepted_at:
          type: string
        accepted_by:
          type: string
        accepted_reason:
          type: string
        settlement_case_id:
          type: string
      required:
        - acceptance_record_id
        - accepted_at
        - accepted_by
        - accepted_reason
        - settlement_case_id
      type: object
    PlatformSettlementCase:
      additionalProperties: false
      properties:
        channel_id:
          type: string
        created_at:
          type: string
        currency:
          type: string
        gross_amount_cents:
          type: number
        net_settlement_base_cents:
          type: number
        order_id:
          type: string
        partner_account_id:
          type: string
        partner_amount_cents:
          type: number
        partner_share_bps:
          type: number
        payout_profile_id:
          type: string
        settlement_case_id:
          type: string
        settlement_confirmed_at:
          type: string
        source_event_id:
          type: string
        status:
          $ref: '#/components/schemas/SettlementCaseStatus'
        updated_at:
          type: string
      required:
        - channel_id
        - created_at
        - currency
        - gross_amount_cents
        - order_id
        - settlement_case_id
        - source_event_id
        - status
        - updated_at
      type: object
    PlatformSettlementCaseDetailResponse:
      additionalProperties: false
      properties:
        acceptance_record:
          $ref: '#/components/schemas/PlatformSettlementAcceptanceRecord'
        payout_batches:
          items:
            $ref: '#/components/schemas/PlatformPayoutBatch'
          type: array
        payout_line:
          $ref: '#/components/schemas/PlatformPayoutLine'
        settlement_case:
          $ref: '#/components/schemas/PlatformSettlementCase'
      required:
        - payout_batches
        - settlement_case
      type: object
    PlatformSettlementReconciliationListResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlatformPartnerSettlementReconciliationRecord'
          type: array
      required:
        - items
      type: object
    PlatformStarterActivationFeeStatus:
      additionalProperties: false
      properties:
        delivered_assets:
          items:
            type: string
          type: array
        fee_code:
          const: starter_activation_fee
          type: string
        item_code:
          const: platform.sku.hosted-inbox-starter-base
          type: string
        plan_code:
          const: platform.hosted_inbox.starter.base
          type: string
        status:
          $ref: '#/components/schemas/PlatformQualificationFeeStatus'
        trigger_event:
          const: starter_claim_succeeded
          type: string
      required:
        - delivered_assets
        - fee_code
        - item_code
        - plan_code
        - status
        - trigger_event
      type: object
    PlatformStarterAsset:
      additionalProperties: false
      properties:
        asset_code:
          type: string
        asset_id:
          type: string
        asset_kind:
          $ref: '#/components/schemas/PlatformStarterAssetKind'
        bundle_id:
          type: string
        campaign_id:
          type: string
        channel_id:
          type: string
        delivery_status:
          $ref: '#/components/schemas/PlatformStarterAssetDeliveryStatus'
        enabled:
          type: boolean
        preview_value:
          type: string
        title:
          type: string
        value:
          type: string
      required:
        - asset_code
        - asset_id
        - asset_kind
        - bundle_id
        - channel_id
        - delivery_status
        - enabled
        - title
        - value
      type: object
    PlatformStarterAssetAction:
      enum:
        - copied
        - downloaded
        - opened
      type: string
    PlatformStarterAssetDeliveryStatus:
      enum:
        - fallback
        - ready
      type: string
    PlatformStarterAssetKind:
      enum:
        - copy_block
        - entry_url
        - provider_cta
        - qr_code
        - short_link
        - upgrade_cta
      type: string
    PlatformStarterBundle:
      additionalProperties: false
      properties:
        activated_at:
          type: string
        bundle_id:
          type: string
        channel_id:
          type: string
        commercial_tier:
          $ref: '#/components/schemas/PlatformStarterCommercialTier'
        updated_at:
          type: string
      required:
        - activated_at
        - bundle_id
        - channel_id
        - commercial_tier
        - updated_at
      type: object
    PlatformStarterCampaign:
      additionalProperties: false
      properties:
        asset_ids:
          items:
            type: string
          type: array
        campaign_code:
          type: string
        campaign_id:
          type: string
        channel_id:
          type: string
        created_at:
          type: string
        display_name:
          type: string
        enabled:
          type: boolean
        updated_at:
          type: string
      required:
        - asset_ids
        - campaign_code
        - campaign_id
        - channel_id
        - created_at
        - display_name
        - enabled
        - updated_at
      type: object
    PlatformStarterCommercialStatus:
      additionalProperties: false
      properties:
        activation_fee:
          $ref: '#/components/schemas/PlatformStarterActivationFeeStatus'
        item_code:
          type: string
        plan_code:
          type: string
        tier:
          $ref: '#/components/schemas/PlatformStarterCommercialTier'
        upgrade_targets:
          items:
            enum:
              - advanced_growth
              - full_api
              - widget_embed
            type: string
          type: array
      required:
        - activation_fee
        - tier
        - upgrade_targets
      type: object
    PlatformStarterCommercialTier:
      enum:
        - advanced_growth
        - base_access
        - starter_operations
      type: string
    PlatformStarterComparableFunnel:
      additionalProperties: false
      properties:
        channel_created:
          type: number
        channel_form_submitted:
          type: number
        full_api_quickstart_clicked:
          type: number
        integrations_page_viewed:
          type: number
        provider_activated:
          type: number
        provider_onboarding_opened:
          type: number
        provider_workbench_opened:
          type: number
        starter_channel_issued:
          type: number
        starter_claim_started:
          type: number
        starter_claim_succeeded:
          type: number
        starter_hosted_inbox_opened:
          type: number
        starter_intake_created:
          type: number
        starter_issue_viewed:
          type: number
        starter_lead_claimed:
          type: number
        starter_lead_visible_in_workbench:
          type: number
        starter_snippet_copied:
          type: number
        starter_upgrade_clicked:
          type: number
        starter_upgrade_completed:
          type: number
        starter_widget_config_loaded:
          type: number
        widget_snippet_copied:
          type: number
      type: object
    PlatformStarterCopyBlock:
      additionalProperties: false
      properties:
        block_code:
          $ref: '#/components/schemas/StarterCopyBlockCode'
        content:
          type: string
        title:
          type: string
      required:
        - block_code
        - content
        - title
      type: object
    PlatformStarterGaFunnel:
      additionalProperties: false
      properties:
        starter_channel_created:
          type: number
        starter_delivery_viewed:
          type: number
        starter_intake_created:
          type: number
        starter_lead_claimed:
          type: number
        starter_lead_visible_in_workbench:
          type: number
        starter_upgrade_clicked:
          type: number
        starter_widget_config_loaded:
          type: number
      required:
        - starter_channel_created
        - starter_delivery_viewed
        - starter_intake_created
        - starter_lead_claimed
        - starter_lead_visible_in_workbench
        - starter_upgrade_clicked
        - starter_widget_config_loaded
      type: object
    PlatformStarterOwnershipStatus:
      enum:
        - starter_claim_pending
        - starter_house_owned
        - tenant_owned_managed
      type: string
    PlatformStarterOwnershipSummary:
      additionalProperties: false
      properties:
        channel_id:
          type: string
        claim_required:
          type: boolean
        claim_requirements:
          items:
            type: string
          type: array
        org_id:
          type: string
        partner_account_id:
          type: string
        status:
          $ref: '#/components/schemas/PlatformStarterOwnershipStatus'
        workspace_id:
          type: string
      required:
        - channel_id
        - claim_required
        - claim_requirements
        - org_id
        - status
        - workspace_id
      type: object
    PlatformStarterSourceContext:
      additionalProperties: false
      properties:
        channel_id:
          type: string
        channel_key:
          type: string
        channel_mode:
          $ref: '#/components/schemas/PlatformAccessMode'
        frontend_source:
          type: string
        hosted_inbox_url:
          type: string
        starter_tier:
          $ref: '#/components/schemas/PlatformStarterCommercialTier'
      required:
        - channel_id
        - channel_key
        - channel_mode
        - frontend_source
        - hosted_inbox_url
        - starter_tier
      type: object
    PlatformStarterTrackedEventName:
      enum:
        - channel_created
        - channel_form_submitted
        - full_api_quickstart_clicked
        - integrations_page_viewed
        - provider_activated
        - provider_onboarding_opened
        - provider_workbench_opened
        - starter_channel_issued
        - starter_claim_started
        - starter_claim_succeeded
        - starter_hosted_inbox_opened
        - starter_intake_created
        - starter_issue_viewed
        - starter_lead_claimed
        - starter_lead_visible_in_workbench
        - starter_snippet_copied
        - starter_upgrade_clicked
        - starter_upgrade_completed
        - starter_widget_config_loaded
        - widget_snippet_copied
      type: string
    PlatformUser:
      additionalProperties: false
      properties:
        auth_user_id:
          type: string
        created_at:
          type: string
        display_name:
          type: string
        email:
          type: string
        phone:
          type: string
        status:
          $ref: '#/components/schemas/UserStatus'
        user_id:
          type: string
      required:
        - created_at
        - display_name
        - email
        - status
        - user_id
      type: object
    PlatformWorkspace:
      additionalProperties: false
      properties:
        created_at:
          type: string
        name:
          type: string
        org_id:
          type: string
        status:
          $ref: '#/components/schemas/WorkspaceStatus'
        workspace_id:
          type: string
      required:
        - created_at
        - name
        - org_id
        - status
        - workspace_id
      type: object
    ProductCode:
      enum:
        - platform
        - zhencap
        - zhencollege
        - zhencontract
        - zhenhire
        - zhenins
        - zhenlegal
        - zhenmate
        - zhenmem
        - zhenmeta
        - zhenquant
        - zhenrent
        - zhenrobot
        - zhenskill
        - zhenteam
      type: string
    ProviderAdmissionReviewResponse:
      additionalProperties: false
      properties:
        profile:
          $ref: '#/components/schemas/PlatformProviderProfile'
        review:
          $ref: '#/components/schemas/PlatformProviderAdmissionReview'
      type: object
    ProviderEntryMode:
      enum:
        - always
        - hidden
        - zhen_only
      type: string
    ProviderHandoffEvidenceReceiptResponse:
      anyOf:
        - additionalProperties: false
          properties:
            status:
              const: not_published
              type: string
          required:
            - status
          type: object
        - additionalProperties: false
          properties:
            public_url:
              type: string
            published_at:
              type: string
            receipt_id:
              type: string
            receipt_token:
              type: string
            revoked_at:
              type: string
            status:
              $ref: '#/components/schemas/PlatformEvidenceReceiptStatus'
          required:
            - public_url
            - published_at
            - receipt_id
            - receipt_token
            - status
          type: object
    ProviderHandoffListResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlatformProviderHandoffView'
          type: array
      required:
        - items
      type: object
    ProviderHandoffResponse:
      additionalProperties: false
      properties:
        claimed_at:
          type: string
        closed_at:
          type: string
        handoff_id:
          type: string
        lead_id:
          type: string
        offered_at:
          type: string
        provider_org_id:
          type: string
        provider_profile_id:
          type: string
        provider_workspace_id:
          type: string
        redacted_summary:
          type: string
        revocation_reason:
          type: string
        revoked_at:
          type: string
        source_org_id:
          type: string
        source_workspace_id:
          type: string
        status:
          $ref: '#/components/schemas/PlatformProviderHandoffStatus'
        updated_at:
          type: string
      required:
        - handoff_id
        - lead_id
        - offered_at
        - provider_org_id
        - provider_profile_id
        - provider_workspace_id
        - redacted_summary
        - source_org_id
        - source_workspace_id
        - status
        - updated_at
      type: object
    ProviderLeadEvidenceReceiptResponse:
      anyOf:
        - additionalProperties: false
          properties:
            status:
              const: not_published
              type: string
          required:
            - status
          type: object
        - additionalProperties: false
          properties:
            public_url:
              type: string
            published_at:
              type: string
            receipt_id:
              type: string
            receipt_token:
              type: string
            revoked_at:
              type: string
            status:
              $ref: '#/components/schemas/PlatformEvidenceReceiptStatus'
          required:
            - public_url
            - published_at
            - receipt_id
            - receipt_token
            - status
          type: object
    ProviderProfileResponse:
      additionalProperties: false
      properties:
        profile:
          $ref: '#/components/schemas/PlatformProviderProfile'
      type: object
    ProviderRoleChangeRequest:
      $ref: '#/components/schemas/PlatformProviderRoleChangeRequest'
    ProviderRoleChangeRequestResponse:
      additionalProperties: false
      properties:
        request:
          $ref: '#/components/schemas/PlatformProviderRoleChangeRequest'
      type: object
    ProviderWorkbenchDemoSeedResponse:
      additionalProperties: false
      properties:
        channel:
          $ref: '#/components/schemas/PlatformFrontendChannel'
        created_count:
          type: number
        items:
          items:
            $ref: '#/components/schemas/PlatformProviderLead'
          type: array
        skipped:
          type: boolean
      required:
        - channel
        - created_count
        - items
        - skipped
      type: object
    ProviderWorkbenchLeadListResponse:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlatformProviderLead'
          type: array
      required:
        - items
      type: object
    PublicConversationCreateResponse:
      additionalProperties: false
      properties:
        conversation_id:
          type: string
        status:
          $ref: '#/components/schemas/PlatformPublicConversationStatus'
      required:
        - conversation_id
        - status
      type: object
    PublicConversationMessageResponse:
      anyOf:
        - $ref: '#/components/schemas/PlatformPublicConversationSyncResult'
        - $ref: '#/components/schemas/PlatformPublicConversationAsyncAccepted'
    PublicEvidenceReceipt:
      additionalProperties: false
      description: Public allowlist; it intentionally excludes all lead and tenant identifiers.
      properties:
        outcome_category:
          $ref: '#/components/schemas/PlatformEvidenceReceiptOutcome'
        publication_rule_version:
          const: public-evidence-receipt.v1
          type: string
        published_at:
          type: string
        receipt:
          type: string
        revoked_at:
          type: string
        status:
          $ref: '#/components/schemas/PlatformEvidenceReceiptStatus'
        timeline:
          items:
            $ref: '#/components/schemas/PublicEvidenceReceiptTimelineEvent'
          type: array
      required:
        - receipt
        - status
      type: object
    PublicEvidenceReceiptResponse:
      additionalProperties: false
      properties:
        receipt:
          $ref: '#/components/schemas/PublicEvidenceReceipt'
      required:
        - receipt
      type: object
    PublicEvidenceReceiptRevokedResponse:
      additionalProperties: false
      properties:
        receipt:
          additionalProperties: false
          properties:
            revoked_at:
              type: string
            status:
              const: revoked
              type: string
          required:
            - revoked_at
            - status
          type: object
      required:
        - receipt
      type: object
    PublicEvidenceReceiptTimelineEvent:
      additionalProperties: false
      properties:
        at:
          type: string
        event:
          enum:
            - completed
            - intake_received
            - provider_claimed
          type: string
      required:
        - at
        - event
      type: object
    PublicStarterChannelIssueRequest:
      additionalProperties: false
      properties:
        channel_name:
          type: string
        display_name:
          type: string
        frontend_source:
          type: string
        industry_or_vertical:
          type: string
        locale:
          type: string
        mode:
          $ref: '#/components/schemas/PlatformAccessMode'
        provider_entry_mode:
          $ref: '#/components/schemas/ProviderEntryMode'
        use_case_summary:
          type: string
      required:
        - frontend_source
      type: object
    PublicStarterChannelIssueResponse:
      additionalProperties: false
      properties:
        channel:
          additionalProperties: false
          properties:
            channel_id:
              type: string
            channel_key:
              type: string
            display_name:
              type: string
            frontend_source:
              type: string
            hosted_inbox_url:
              type: string
            mode:
              $ref: '#/components/schemas/PlatformAccessMode'
          required:
            - channel_id
            - channel_key
            - display_name
            - frontend_source
            - hosted_inbox_url
            - mode
          type: object
        domain_verification:
          $ref: '#/components/schemas/PublicStarterDomainVerificationSummary'
      required:
        - channel
        - domain_verification
      type: object
    PublicStarterDomainVerificationSummary:
      additionalProperties: false
      properties:
        channel_key:
          type: string
        declared_domain:
          type: string
        last_attempt_at:
          type: string
        retry_available:
          type: boolean
        status:
          $ref: '#/components/schemas/StarterDomainVerificationStatus'
        user_safe_message:
          type: string
        verified_at:
          type: string
      required:
        - channel_key
        - declared_domain
        - retry_available
        - status
        - user_safe_message
      type: object
    PublicWidgetConfigChannel:
      additionalProperties: false
      properties:
        channel_key:
          type: string
        display_name:
          type: string
        frontend_source:
          type: string
        locale:
          type: string
        mode:
          $ref: '#/components/schemas/PlatformAccessMode'
      required:
        - channel_key
        - display_name
        - frontend_source
        - locale
        - mode
      type: object
    PublicWidgetConfigResponse:
      additionalProperties: false
      properties:
        channel:
          $ref: '#/components/schemas/PublicWidgetConfigChannel'
        conversation_create_endpoint:
          type: string
        conversation_message_endpoint_template:
          type: string
        hosted_inbox_url:
          type: string
        intake_endpoint:
          type: string
        provider_cta_url:
          type: string
        provider_entry_enabled:
          type: boolean
        provider_entry_mode:
          $ref: '#/components/schemas/ProviderEntryMode'
        widget_enabled:
          type: boolean
      required:
        - channel
        - hosted_inbox_url
        - intake_endpoint
        - provider_entry_enabled
        - provider_entry_mode
        - widget_enabled
      type: object
    RecommendationReason:
      enum:
        - bundle_completion
        - cross_sell
        - quota_recovery
        - trial_upgrade
        - upsell
        - workflow_next_step
      type: string
    Record_string_unknown:
      additionalProperties: false
      type: object
    ResourceType:
      enum:
        - api_key
        - billing
        - entitlement
        - event
        - order
        - organization
        - project
        - request
        - session
        - task
        - usage
        - user
        - workflow
        - workspace
      type: string
    RevokeProviderHandoffRequest:
      additionalProperties: false
      properties:
        reason:
          type: string
      type: object
    RoleCode:
      enum:
        - admin
        - developer
        - member
        - operator
        - owner
        - reviewer
        - viewer
      type: string
    SendPublicConversationMessageRequest:
      additionalProperties: false
      properties:
        message:
          type: string
        requester_contact:
          type: string
        requester_name:
          type: string
        source_url:
          type: string
      required:
        - message
      type: object
    SessionStatus:
      enum:
        - active
        - expired
        - revoked
      type: string
    SettlementCaseStatus:
      enum:
        - in_payout
        - on_hold
        - pending_settlement_review
        - ready_to_settle
        - reversed
        - settled
      type: string
    StarterCopyBlockCode:
      enum:
        - customer_service_reply
        - poster_short_copy
        - website_button
        - website_menu
        - wechat_menu
      type: string
    StarterDomainVerificationStatus:
      enum:
        - pending_domain_verification
        - verification_failed
        - verified_active
        - verifying
      type: string
    SubmitProviderProfileRequest:
      additionalProperties: false
      properties:
        display_name:
          type: string
        headline:
          type: string
        provider_primary_type:
          $ref: '#/components/schemas/PlatformProviderPrimaryType'
        provider_role:
          $ref: '#/components/schemas/PlatformProviderRole'
        service_domains:
          items:
            type: string
          type: array
        service_regions:
          items:
            type: string
          type: array
      required:
        - display_name
        - headline
        - provider_primary_type
        - provider_role
        - service_domains
        - service_regions
      type: object
    TrialOnboardingInput:
      additionalProperties: false
      properties:
        display_name:
          description: User display name
          type: string
        email:
          description: Primary contact email
          type: string
        environment:
          $ref: '#/components/schemas/Environment'
          description: Target environment
        key_label:
          description: Optional label for the bootstrap API key
          type: string
        key_scopes:
          description: Optional scopes for the bootstrap API key
          items:
            type: string
          type: array
        org_name:
          description: Organization name
          type: string
        trial_plan_code:
          description: Trial plan code to provision
          type: string
      required:
        - display_name
        - email
        - org_name
        - trial_plan_code
      type: object
    TrialOnboardingResult:
      additionalProperties: false
      properties:
        api_key:
          $ref: '#/components/schemas/IssuedPlatformApiKeyResponse'
        entitlement:
          $ref: '#/components/schemas/PlatformEntitlement'
        membership:
          $ref: '#/components/schemas/WorkspaceMembership'
        org:
          $ref: '#/components/schemas/PlatformOrganization'
        session:
          $ref: '#/components/schemas/PlatformSession'
        user:
          $ref: '#/components/schemas/PlatformUser'
        workspace:
          $ref: '#/components/schemas/PlatformWorkspace'
      required:
        - api_key
        - entitlement
        - membership
        - org
        - session
        - user
        - workspace
      type: object
    UpdateProviderHandoffStatusRequest:
      additionalProperties: false
      properties:
        completion_summary:
          type: string
        status:
          enum:
            - closed
            - in_progress
          type: string
      required:
        - status
      type: object
    UpdateProviderLeadStatusRequest:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        completion_summary:
          type: string
        provider_profile_id:
          type: string
        status:
          $ref: '#/components/schemas/PlatformProviderLeadStatus'
      required:
        - actor_id
        - provider_profile_id
        - status
      type: object
    UpsertPartnerAccountRequest:
      additionalProperties: false
      properties:
        actor_id:
          type: string
        auth_user_id:
          type: string
        legal_name:
          type: string
        org_id:
          type: string
        workspace_id:
          type: string
      required:
        - actor_id
        - legal_name
        - org_id
        - workspace_id
      type: object
    UpsertPayoutProfileRequest:
      additionalProperties: false
      properties:
        account_number:
          type: string
        actor_id:
          type: string
        bank_name:
          type: string
        holder_name:
          type: string
        partner_account_id:
          type: string
        payout_method:
          const: bank_transfer
          type: string
        tax_id:
          type: string
      required:
        - account_number
        - actor_id
        - bank_name
        - holder_name
        - partner_account_id
        - payout_method
        - tax_id
      type: object
    UpsertStarterCampaignRequest:
      additionalProperties: false
      properties:
        asset_ids:
          items:
            type: string
          type: array
        campaign_code:
          type: string
        display_name:
          type: string
        enabled:
          type: boolean
      required:
        - asset_ids
        - campaign_code
        - display_name
        - enabled
      type: object
    UserStatus:
      enum:
        - active
        - disabled
      type: string
    WorkflowStatus:
      enum:
        - accepted
        - awaiting_human_review
        - cancelled
        - completed
        - expired
        - failed
        - in_progress
      type: string
    WorkspaceMembership:
      additionalProperties: false
      properties:
        created_at:
          type: string
        membership_id:
          type: string
        org_id:
          type: string
        role:
          $ref: '#/components/schemas/RoleCode'
        status:
          $ref: '#/components/schemas/MembershipStatus'
        user_id:
          type: string
        workspace_id:
          type: string
      required:
        - created_at
        - membership_id
        - org_id
        - role
        - status
        - user_id
        - workspace_id
      type: object
    WorkspaceStatus:
      enum:
        - active
        - archived
      type: string
    WriteStarterAssetEventRequest:
      additionalProperties: false
      properties:
        action:
          $ref: '#/components/schemas/PlatformStarterAssetAction'
        campaign_id:
          type: string
      required:
        - action
      type: object
    WriteStarterAssetEventResponse:
      additionalProperties: false
      properties:
        acknowledged:
          type: boolean
        event_id:
          type: string
      required:
        - acknowledged
        - event_id
      type: object
    WriteStarterTrackedEventRequest:
      additionalProperties: false
      properties:
        campaign_id:
          type: string
        event_name:
          $ref: '#/components/schemas/PlatformStarterTrackedEventName'
        metadata:
          $ref: '#/components/schemas/Record_string_unknown'
      required:
        - event_name
      type: object
