Skip to main content

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

FieldTypeRequiredDescription
business_idstringYesBusiness identifier (clerk org slug)
urlstringYesWebsite URL to scrape
product_idstringNoOptional product ID for product-specific prompts
prompt_countintegerNoNumber of prompts to generate

Prompt Limits

Entity TypeDefault CountConstant
Business50MAX_BUSINESS_PROMPTS
Product10PROMPTS_PER_PRODUCT
All products can have prompts (no limit on number of products).

Response Fields

FieldTypeDescription
statusstring”success” or β€œerror”
prompts_generatedintegerNumber of prompts generated
prompts_savedintegerNumber of prompts saved to DB
errorstringError 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)

Code Location

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