Skip to main content
Update an AI website with content changes from detect-changes API. Uses THREE parallel Gemini calls (same pattern as onboarding):
  1. Update llms.txt
  2. Update homepage + Q&A pages
  3. Update data.json (Schema.org)
Batch 1a: This endpoint runs as part of Batch 1a along with detect-changes. Product discovery (Batch 1b) is completely decoupled and runs in parallel.
The update flow:
  1. detect-changes - Find what changed
  2. update-ai-site (this endpoint) - Update the AI website

How It Works

Product LLMs Regeneration

When pages change, this endpoint checks if any existing products have product_source_urls that overlap with the changed URLs. If so, those product llms files are regenerated.
Efficient updates: Product llms files are only regenerated if their source content changed. This scales well for sites with hundreds of products.
Partial content limitation: When regenerating product llms, we only use content from the changed pages. If a product has 3 source URLs and only 1 changed, the regenerated file will be based on that 1 page’s content. For a complete regeneration with all source content, use regenerate-fresh-website.

Request Body

Takes the output from detect-changes directly:
Key difference from old API: unchanged_pages replaces all_pages. Unchanged pages don’t have markdown because they weren’t batch scraped.

Response

The changed_urls array should be submitted to IndexNow after deployment.
skip_deploy mode: When skip_deploy=True, the endpoint returns generated files in the response instead of deploying. This is used by the cron orchestrator to collect files from Batch 1a and 1b, then perform a single combined deployment.

Three Parallel Gemini Calls

Each call receives the current file + changes and decides what to update:

1. Update llms.txt

2. Update Q&A Pages

3. Update data.json

AI Article sections are preserved - The Gemini prompts explicitly instruct NOT to modify any AI Article sections, as those are managed separately by the AI articles cron.

Database Updates

  • ai_sites.page_hashes - Updated hash map
  • ai_sites.site_map - Updated URL list
  • ai_sites.last_content_check_at - Timestamp

External API Calls

  • Gemini 3 Flash Preview (x3 parallel) - Content updates
  • Gemini 3 Flash Preview (per affected product) - Product llms regeneration
  • Vercel API - Deployment (unless skip_deploy=True)