detect-changes API.
Uses THREE parallel Gemini calls (same pattern as onboarding):
- Update
llms.txt - Update homepage + Q&A pages
- Update
data.json(Schema.org)
detect-changes- Find what changed- update-ai-site (this endpoint) - Update the AI website
discover-products-from-changes- Find new products
How It Works
Product LLMs Regeneration
When pages change, this endpoint checks if any existing products haveproduct_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.
Request Body
Takes the output fromdetect-changes directly:
| Field | Type | Required | Description |
|---|---|---|---|
business_id | string | Yes | Clerk org ID |
new_pages | array | Yes | Pages that didnβt exist before (have markdown) |
changed_pages | array | Yes | Pages with content changes (have markdown) |
removed_urls | array | Yes | URLs that no longer exist |
unchanged_pages | array | Yes | Unchanged pages (NO markdown) |
updated_site_map | array | Yes | Current URL list |
updated_hashes | object | Yes | Current hash map |
business_info | object | Yes | Business entity and AI site info |
Key difference from old API:
unchanged_pages replaces all_pages.
Unchanged pages donβt have markdown because they werenβt batch scraped.Response
changed_urls array should be submitted to IndexNow after 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
Database Updates
ai_sites.page_hashes- Updated hash mapai_sites.site_map- Updated URL listai_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