> ## Documentation Index
> Fetch the complete documentation index at: https://docs.searchcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Store Visibility Report

> Store daily visibility report with sampled prompts and pass/fail results.

## 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.

<Warning>
  This is an internal API used by the Cron service. Requires API key authentication.
</Warning>

## Request Body

<ParamField body="clerk_org_id" type="string" required>
  Organization identifier
</ParamField>

<ParamField body="results" type="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)
</ParamField>

<ParamField body="report_date" type="string">
  Optional date in YYYY-MM-DD format. Defaults to today.
</ParamField>

## Response

<ResponseField name="status" type="string">
  `"success"` or `"error"`
</ResponseField>

<ResponseField name="report_date" type="string">
  The date of the report (YYYY-MM-DD)
</ResponseField>

<ResponseField name="prompts_updated" type="integer">
  Number of prompts processed
</ResponseField>

<ResponseField name="summary" type="object">
  Summary of results:

  * `total_checked`: Number of prompts checked
  * `platforms_breakdown`: Object with count per platform (e.g., `{"chatgpt": 7, "claude": 6, ...}`)
</ResponseField>

## Example Request

```json theme={null}
{
  "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

```json theme={null}
{
  "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)
