Skip to main content
POST
Regenerate Prompts
Manual Trigger Endpoint - This endpoint is for debugging and manual intervention only. It is NOT called by the daily cron job.Prompts are normally generated:
  • During onboarding via /api/onboarding/generate-all
  • When new products are discovered via /api/cron/discover-products-from-changes

Overview

Manually regenerates the AI visibility prompts for a business or product. This endpoint scrapes the website fresh and generates new prompts using Gemini. Use cases:
  • Debugging prompt generation issues
  • Refreshing prompts after significant website content changes
  • Testing prompt generation for a specific entity
This endpoint requires API key authentication (X-API-Key header).

Prompt Limits

This endpoint regenerates prompts via Gemini only. The 10 pre-tested Exa prompts are only generated during onboarding.

Request Body

string
required
Business identifier (clerk org slug)
string
required
Website URL to scrape for prompt generation
string
Optional product ID for product-specific prompts
integer
default:"50"
Number of prompts to generate (default: 50 for business, 10 for product)

Response

string
success, skipped, or error
integer
Number of prompts generated by Gemini
integer
Number of prompts saved to database
string
Reason for skipping (if status is skipped)
string
Error message if status is error

Example

Internal Process

This endpoint calls the generate_prompts service which:
  1. Scrapes the website using Firecrawl (up to 5000 pages)
  2. Generates prompts using Gemini 3 Flash
  3. Saves prompts to the entity_prompts_tracker table
The prompts are questions that AI platforms might use when recommending businesses. They are checked via daily sampling (10 prompts/day) against 8 AI platforms to calculate visibility scores.

Notes

  • Prompts should NOT contain the business name (we test if AI recommends them organically)
  • Regenerating prompts does NOT delete existing prompts - it adds new ones
  • Visibility results for new prompts will be null until tested by the daily cron job
  • Pre-tested Exa prompts (from onboarding) are not affected by regeneration