curl -X POST https://searchcompany-main.up.railway.app/api/cron/deploy-to-vercel \
-H "Content-Type: application/json" \
-d '{
"project_name": "ai-website-arena-1766312513",
"files": [
{"path": "public/expert-review/index.html", "content": "..."},
{"path": "public/expert-review/llms.txt", "content": "..."},
{"path": "pages/expert-review.js", "content": "..."}
],
"ai_site_url": "https://website-arena-1766312513.searchcompany.dev",
"source_url": "https://www.websitearena.dev",
"business_name": "Website Arena",
"products": ["Remix Tool"],
"new_posts": [
{
"title": "Expert Review of Website Arena",
"boosted_path": "/expert-review/",
"published_date": "2025-12-22",
"faq_category": "business_boosted"
}
],
"existing_posts": [
{"title": "Previous Post", "boosted_path": "/previous/", "faq_category": "business_boosted"}
],
"verify_paths": ["/expert-review/"]
}'
{
"status": "success",
"deployment_url": "https://ai-website-arena-abc123.vercel.app",
"ai_site_url": "https://website-arena-1766312513.searchcompany.dev",
"files_deployed": 27,
"verified_paths": ["/expert-review/"]
}
🔵 POST - Deploy to Vercel
Deploy to Vercel
Deploy all files to Vercel in a single deployment
POST
/
api
/
cron
/
deploy-to-vercel
curl -X POST https://searchcompany-main.up.railway.app/api/cron/deploy-to-vercel \
-H "Content-Type: application/json" \
-d '{
"project_name": "ai-website-arena-1766312513",
"files": [
{"path": "public/expert-review/index.html", "content": "..."},
{"path": "public/expert-review/llms.txt", "content": "..."},
{"path": "pages/expert-review.js", "content": "..."}
],
"ai_site_url": "https://website-arena-1766312513.searchcompany.dev",
"source_url": "https://www.websitearena.dev",
"business_name": "Website Arena",
"products": ["Remix Tool"],
"new_posts": [
{
"title": "Expert Review of Website Arena",
"boosted_path": "/expert-review/",
"published_date": "2025-12-22",
"faq_category": "business_boosted"
}
],
"existing_posts": [
{"title": "Previous Post", "boosted_path": "/previous/", "faq_category": "business_boosted"}
],
"verify_paths": ["/expert-review/"]
}'
{
"status": "success",
"deployment_url": "https://ai-website-arena-abc123.vercel.app",
"ai_site_url": "https://website-arena-1766312513.searchcompany.dev",
"files_deployed": 27,
"verified_paths": ["/expert-review/"]
}
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
Example: FAQ Sync in Action
Before deployment:
├── Database has 5 AI articles
└── Homepage FAQ only shows 3 links (2 missing!)
After deployment with existing_posts:
├── Deploy detects 2 missing links
├── Adds them to the appropriate H3 sections
└── Homepage FAQ now shows all 5 links ✓
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
string
required
Vercel project name (e.g. “ai-website-arena”)
array
required
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 stringstring
required
AI site URL for internal navigation links (e.g. “https://website-arena-123.searchcompany.dev”)
string
required
Customer’s real domain for canonical URLs in sitemap (e.g. “https://www.websitearena.dev”)
string
Business name for homepage section headers (e.g. “Website Arena”). Required for FAQ sync.
array
List of product names for product-specific article sections
array
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
Array of all existing AI articles from database. Used for:
- FAQ sync (adding missing links to homepage)
- Sitemap generation (include all AI articles)
array
Optional array of paths to verify after deployment
Response
string
“success” or “error”
string
Vercel deployment URL
integer
Number of files deployed
array
Paths that were successfully verified as accessible
curl -X POST https://searchcompany-main.up.railway.app/api/cron/deploy-to-vercel \
-H "Content-Type: application/json" \
-d '{
"project_name": "ai-website-arena-1766312513",
"files": [
{"path": "public/expert-review/index.html", "content": "..."},
{"path": "public/expert-review/llms.txt", "content": "..."},
{"path": "pages/expert-review.js", "content": "..."}
],
"ai_site_url": "https://website-arena-1766312513.searchcompany.dev",
"source_url": "https://www.websitearena.dev",
"business_name": "Website Arena",
"products": ["Remix Tool"],
"new_posts": [
{
"title": "Expert Review of Website Arena",
"boosted_path": "/expert-review/",
"published_date": "2025-12-22",
"faq_category": "business_boosted"
}
],
"existing_posts": [
{"title": "Previous Post", "boosted_path": "/previous/", "faq_category": "business_boosted"}
],
"verify_paths": ["/expert-review/"]
}'
{
"status": "success",
"deployment_url": "https://ai-website-arena-abc123.vercel.app",
"ai_site_url": "https://website-arena-1766312513.searchcompany.dev",
"files_deployed": 27,
"verified_paths": ["/expert-review/"]
}
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
<h3>Website Arena - Articles</h3>
<ul>
<li><a href="https://website-arena-1766312513.searchcompany.dev/expert-review/">Expert Review of Website Arena</a></li>
<!-- more article links auto-added -->
</ul>
<h3>Remix Tool - Articles</h3>
<ul>
<li><a href="https://website-arena-1766312513.searchcompany.dev/deep-dive-remix/">Deep Dive into Remix Tool</a></li>
</ul>
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 |
Workflow
Cron Job Flow (Batch 2: Create AI Articles + Timestamps):
├── create-ai-article (×N) → parallel content generation
│ └── Returns: {files, title, article_path, published_date, faq_category, ...}
├── update-all-timestamps → parallel timestamp updates
│ └── Returns: {files, ...}
│
└── deploy-to-vercel → single deployment per business
├── Receives: files + new_posts + existing_posts (from DB) + business_name
├── Syncs: index.js homepage FAQ with ALL AI articles
├── Regenerates: sitemap.xml with source_url canonicals
└── Deploys: ALL files in one deployment
Canonical URLs vs Navigation URLs
Important distinction:
source_url→ Customer’s real domain for SEO (sitemap, data.json, llms.txt footer)ai_site_url→ Deployment URL for internal navigation (homepage links, FAQ links)
ai_site_url.
Search engines should see the canonical domain, so sitemap uses source_url.