Sample Prompts
🟢 GET - Sample Prompts
Sample Prompts
Sample prompts for daily visibility check, prioritizing untested prompts.
GET
Sample Prompts
Overview
This endpoint samples prompts from the total prompt pool (business + products) for an organization. It’s used by the cron job to check a subset of prompts each day instead of all prompts (cost optimization). Sampling Algorithm:- First, select prompts that have never been tested (
last_tested_at IS NULL) - If we need more to reach
sample_size, randomly select from already-tested prompts
Query Parameters
Organization slug (clerk_org_id)
Number of prompts to sample
Response
"success" or "error"The organization slug
Total number of prompts available for this organization
Number of prompts that have never been tested
Actual number of prompts sampled (may be less than requested if fewer prompts exist)
Array of sampled prompts with metadata:
id: Prompt ID (integer)prompt: The prompt text (string)entity_id: Entity UUID (string)entity_name: Entity name (string)entity_type:"business"or"product"(string)
Example Response
Use Case
The visibility cron job calls this endpoint once per customer per day:- Sample 10 prompts (prioritizing untested ones)
- Analyze each prompt across 8 AI platforms (pass/fail)
- Update
entity_prompts_trackerwith results andlast_tested_at - Store daily report in
visibility_reportstable
- Reduces API costs by ~50% compared to checking all prompts daily
- Ensures all prompts eventually get tested
- Prioritizes new prompts so users see results quickly after onboarding