{
  "name": "Nika AI Lead Operations Checklist",
  "version": "2026-07-30",
  "language": "ru",
  "purpose": "Operator-facing checklist for lead intake on the live production site.",
  "lead_api": "https://agentnika.ru/api/leads",
  "integrations_page": "https://agentnika.ru/integrations",
  "lead_schema": "https://agentnika.ru/lead-schema.json",
  "receiver_contract": "https://agentnika.ru/webhook-receiver.json",
  "required_sites_environment": [
    {
      "name": "NIKA_LEAD_WEBHOOK_URL",
      "required_for_production": false,
      "owner_required_for_automatic_delivery": true,
      "description": "Receiving endpoint for accepted leads. Needed only when the owner wants automatic delivery through a webhook."
    },
    {
      "name": "NIKA_LEAD_WEBHOOK_TOKEN",
      "required_for_production": false,
      "description": "Optional bearer token sent to the receiving endpoint."
    },
    {
      "name": "NIKA_LEAD_WEBHOOK_TIMEOUT_MS",
      "required_for_production": false,
      "default": 3500,
      "description": "Webhook timeout in milliseconds, allowed range 1000-15000."
    },
    {
      "name": "NIKA_LEAD_TELEGRAM_BOT_TOKEN",
      "required_for_production": false,
      "owner_required_for_automatic_delivery": true,
      "description": "Optional Telegram bot token for direct lead delivery when webhook is not configured."
    },
    {
      "name": "NIKA_LEAD_TELEGRAM_CHAT_ID",
      "required_for_production": false,
      "owner_required_for_automatic_delivery": true,
      "description": "Optional Telegram chat ID that receives summaryText for accepted leads."
    },
    {
      "name": "NIKA_LEAD_TELEGRAM_THREAD_ID",
      "required_for_production": false,
      "description": "Optional Telegram forum topic ID for routing leads into a specific topic."
    }
  ],
  "test_routes": [
    "/",
    "/start",
    "/launch-kit",
    "/roadmap",
    "/quiz",
    "/chat",
    "/products/product-card-generator",
    "/products/product-card-generator/sample",
    "/products/product-card-generator/pilot",
    "/products/product-card-generator/delivery",
    "/products/product-card-generator/brief",
    "/agents/marketplaces",
    "/custom-agent",
    "/integrations",
    "/contacts"
  ],
  "live_site_ready_when": [
    "Each test route sends a lead with name, contact, business, task, and consent.",
    "Each accepted lead has a stable leadId for idempotency and owner follow-up.",
    "Webhook delivery sends Idempotency-Key equal to leadId.",
    "Each accepted lead preserves sourcePath and selected interest.",
    "Each accepted lead preserves sourceUrl, referrer when available, and UTM campaign labels.",
    "The receiving endpoint gets leadId, status: accepted, receivedAt, and summaryText.",
    "The public API response returns delivery: delivered when a real channel is configured, or stored_without_webhook with a readable summaryText when owner secrets are not configured yet.",
    "The owner receives a readable lead summary without technical infrastructure details.",
    "Legal pages, prices, packages, product promises, and paid-sale approval are confirmed by the owner before paid traffic."
  ],
  "manual_fallback": {
    "allowed_for_testing": true,
    "delivery": "stored_without_webhook",
    "operator_action": "Copy the human-readable lead summary from the form and send it through Telegram, MAX, or email.",
    "production_note": "A lead that is only stored_without_webhook has not reached the real owner channel automatically, but the visitor and operator still get a readable summaryText."
  },
  "failure_handling": [
    {
      "delivery": "webhook_failed",
      "operator_action": "Check the receiving endpoint, bearer token, timeout, and server response before relying on automatic delivery."
    },
    {
      "delivery": "telegram_failed",
      "operator_action": "Check the Telegram bot token, chat ID, optional topic ID, and whether the bot can post to the target chat."
    },
    {
      "error": "missing_*",
      "operator_action": "Check required form fields and consent."
    },
    {
      "error": "invalid_json",
      "operator_action": "Check that the client or integration sends application/json."
    }
  ],
  "owner_items_remaining": [
    "Choose and configure the real owner channel for automatic lead delivery: webhook or Telegram bot.",
    "Legal texts are finalized for the actual operator and contact email.",
    "The product card generator is ready for the first paid pilot."
  ]
}
