π΅ POST - Deploy to Vercel
Deploy to Vercel
Deploy all files to Vercel in a single deployment
POST
Internal endpoint for the Cron service to batch deploy files to Vercel.
Terminology: The code uses βboostedβ internally (e.g.,
boosted_path, BoostedPageMeta)
while user-facing documentation uses βAI Articlesβ. Both refer to the same feature.This endpoint deploys all files at once in a single Vercel deployment. It
also syncs the FAQ section with AI articles from the database and regenerates
sitemap.xml.FAQ Sync: Auto-Add Missing AI Articles
Whenexisting_posts OR new_posts is provided (along with business_name), this endpoint automatically:
- Checks the current homepage (
index.js) for article sections - Creates missing H3 sections (e.g., βWebsite Arena - Articlesβ, βRemix Tool - Articlesβ)
- Adds missing AI article links to each section
- Regenerates sitemap.xml with all AI articles
Why Single Deployment?
Previously, each AI article triggered its own Vercel deployment. When creating 8 pages:- 8 parallel deployments to the same project
- Vercelβs edge network gets overwhelmed
- SSL errors (
DECRYPTION_FAILED_OR_BAD_RECORD_MAC)
- Generate all content in parallel (fast, no deployment)
- Collect all files + post metadata
- Single deployment with all files + auto-synced homepage/sitemap
Request Body
Vercel project name (e.g. βai-website-arenaβ)
Array of AI article files to deploy. Each file must have: -
path: File path
(e.g. βpublic/expert-review/index.htmlβ) - content: File content as stringAI site URL for internal navigation links (e.g. βhttps://website-arena-123.searchcompany.devβ)
Customerβs real domain for canonical URLs in sitemap (e.g. βhttps://www.websitearena.devβ)
Business name for homepage section headers (e.g. βWebsite Arenaβ). Required for FAQ sync.
List of product names for product-specific article sections
Array of newly created AI article metadata. Each post must have:
title: Post titleboosted_path: Path (e.g. β/expert-review/β)published_date: ISO date (e.g. β2025-12-22β)boosted_type: Type of post (optional, default: βarticleβ)faq_category: Category for homepage grouping (βbusiness_boostedβ or βproduct_boostedβ)product_name: Product name (required if faq_category is βproduct_boostedβ)
Array of all existing AI articles from database. Used for:
- FAQ sync (adding missing links to homepage)
- Sitemap generation (include all AI articles)
Optional array of paths to verify after deployment
Response
βsuccessβ or βerrorβ
Vercel deployment URL
Number of files deployed
Paths that were successfully verified as accessible
Auto-Generated/Updated Files
Whenexisting_posts OR new_posts is provided (with business_name), this endpoint automatically:
| Action | File | Description |
|---|---|---|
| Syncs | pages/index.js | Adds missing article sections/links to homepage FAQ |
| Regenerates | public/sitemap.xml | XML sitemap with all pages (uses source_url for canonical) |
Homepage FAQ Sync
The endpoint checks the existingindex.js and:
- Creates missing H3 sections for each category with AI articles
- Adds missing links within each section
Article section links use
ai_site_url for navigation (so they work on the deployed site).
Sitemap URLs use source_url for SEO canonical references.Deployment Process
- Collect files from request
- Preserve existing article sections when deploying new index.js
- Sync FAQ with AI articles (if
existing_postsORnew_postsprovided)- Create missing H3 sections
- Add missing AI article links
- Regenerate sitemap with all URLs using
source_urlfor canonical - Upload all files to Vercelβs file store
- Create deployment with merged file list
- Wait for READY state (up to 5 minutes)
- Edge propagation wait (10 seconds)
- Verify paths are accessible (optional)
Error Handling
| Error | Description |
|---|---|
VERCEL_TOKEN not configured | Missing Vercel API token |
Project not found | Invalid project_name |
Deployment timed out | Deployment didnβt reach READY in 5 minutes |
Upload failed | File upload to Vercel failed |