Skip to main content

POST /api/cron/regenerate-fresh-website

Performs a FULL rebuild of an existing AI site using the same flow as initial onboarding, but deploys to the EXISTING Vercel project.

Purpose

Use this endpoint when you want to:
  • Regenerate content with fresh LLM output
  • Fix issues with an existing AI site
  • Test changes to the generation pipeline
This is different from update-site which only does incremental updates when source website content changes.

Architecture

Request Body

FieldTypeRequiredDescription
business_idstringYesOrg slug (e.g., β€œwebsite-arena-1766312513”)
urlstringNoSource URL (fetched from DB if not provided)
max_pagesintegerNoMax pages to scrape (default: 5000)

Pipeline Steps

StepServiceDescription
1scrape_websiteFresh scrape of source website
2hash_pagesGenerate content hashes for change detection
3organize_with_llmLLM organizes content (fresh, not update)
4generate_ai_siteGenerate all static files
5deploy_to_vercelDeploy to existing Vercel project
6assign_domainUpdate AI site record with URLs
7store_page_hashesSave hashes for future change detection
8submit_urls_to_indexnowNotify search engines

Response Fields

FieldTypeDescription
statusstring”success” or error
ai_site_urlstringDeployed AI site URL
source_urlstringSource website URL
business_idstringBusiness identifier
pages_scrapedintegerNumber of pages scraped
files_generatedintegerNumber of files generated
pages_hashedintegerNumber of page hashes stored

Code Location

src/app/apis/cron/regenerate_fresh_website/routes.py