Skip to main content
POST
https://searchcompany-main.up.railway.app
/
api
/
cron
/
store-visibility-report
Store Visibility Report
curl --request POST \
  --url https://searchcompany-main.up.railway.app/api/cron/store-visibility-report \
  --header 'Content-Type: application/json' \
  --data '
{
  "clerk_org_id": "<string>",
  "results": [
    {}
  ],
  "report_date": "<string>"
}
'
{
  "status": "<string>",
  "report_date": "<string>",
  "prompts_updated": 123,
  "summary": {}
}

Overview

This endpoint stores the daily visibility report after the cron job analyzes sampled prompts. It updates the prompts with visibility results and last_tested_at timestamp.
This is an internal API used by the Cron service. Requires API key authentication.

Request Body

clerk_org_id
string
required
Organization identifier
results
array
required
Array of prompt results from visibility analysis:
  • prompt_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)
  • platforms: Object with platform visibility results (boolean for each platform)
report_date
string
Optional date in YYYY-MM-DD format. Defaults to today.

Response

status
string
"success" or "error"
report_date
string
The date of the report (YYYY-MM-DD)
prompts_updated
integer
Number of prompts processed
summary
object
Summary of results:
  • total_checked: Number of prompts checked
  • platforms_breakdown: Object with count per platform (e.g., {"chatgpt": 7, "claude": 6, ...})

Example Request

{
  "clerk_org_id": "acme-corp",
  "results": [
    {
      "prompt_id": 42,
      "prompt": "best project management software",
      "entity_id": "550e8400-e29b-41d4-a716-446655440000",
      "entity_name": "Acme Corp",
      "entity_type": "business",
      "platforms": {
        "chatgpt": true,
        "claude": true,
        "gemini": false,
        "perplexity": true,
        "copilot": false,
        "deepseek": true,
        "grok": false,
        "google_ai": true
      }
    }
  ]
}

Example Response

{
  "status": "success",
  "report_date": "2025-12-29",
  "prompts_updated": 10,
  "summary": {
    "total_checked": 10,
    "platforms_breakdown": {
      "chatgpt": 7,
      "claude": 6,
      "gemini": 5,
      "perplexity": 4,
      "copilot": 6,
      "deepseek": 3,
      "grok": 2,
      "google_ai": 5
    }
  }
}

Actions Performed

  1. Update entity_prompts_tracker with visibility results (pass/fail per platform)
  2. Set last_tested_at timestamp so tested prompts appear first in UI
  3. Upsert visibility_reports row for the day with summary

Pass/Fail Paradigm

Each platform shows a simple pass/fail result:
  • true: The entity was mentioned/recommended by this AI platform
  • false: The entity was not found in the AI platform’s response
  • null: Not yet tested (shows as ”-” in the UI)