POST /api/cron/generate-prompts
Regenerates prompts for a business or product. This is a manual trigger/debugging endpoint.Purpose
This endpoint scrapes the website fresh and generates new prompts. Used for:- Regenerating prompts after website content changes
- Debugging prompt generation
- Manual prompt refresh
Architecture
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
business_id | string | Yes | Business identifier (clerk org slug) |
url | string | Yes | Website URL to scrape |
product_id | string | No | Optional product ID for product-specific prompts |
prompt_count | integer | No | Number of prompts to generate |
Prompt Limits
| Entity Type | Default Count | Constant |
|---|---|---|
| Business | 50 | MAX_BUSINESS_PROMPTS |
| Product | 10 | PROMPTS_PER_PRODUCT |
Response Fields
| Field | Type | Description |
|---|---|---|
status | string | βsuccessβ or βerrorβ |
prompts_generated | integer | Number of prompts generated |
prompts_saved | integer | Number of prompts saved to DB |
error | string | Error message if applicable |
Internal Services
generate_prompts
Core prompt generation service that scrapes and generates prompts. Location:src/app/shared/__init__.py (exported from prompts module)