{"openapi":"3.1.0","info":{"title":"Echolocation API","description":"Read-only API behind the GrowthOS AI Visibility page: weekly visibility of a tenant's brands in LLM answers, scored by the echolocation runner.\n\nEvery `/api/v1/visibility` route is scoped to the caller's tenant. Data routes share `start_date` / `end_date`: the **anchor run** is the last scored run inside the range, and every single-week figure is read from it. Metric definitions and auth details: `src/echolocation/api/README.md`.","version":"1.0.0"},"paths":{"/api/v1/visibility/overview":{"get":{"tags":["visibility"],"summary":"Tenant visibility, rank and weekly line","description":"The Overview tab: the tenant's anchor-run visibility, week-over-week delta and\nrank; its weekly visibility line over the range; mention rate per provider per\nweek; and the date picker's bounds.","operationId":"get_visibility_overview","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor.","title":"Start Date"},"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run.","title":"End Date"},"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run."},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Snake_cased category name from `/config`, e.g. `home_loans`. Omitted or empty: all categories blended.","title":"Category"},"description":"Snake_cased category name from `/config`, e.g. `home_loans`. Omitted or empty: all categories blended."},{"name":"brand_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Brand slug from `/config`. Omitted: all of the tenant's brands blended. A brand the tenant doesn't own is a 404.","title":"Brand Id"},"description":"Brand slug from `/config`. Omitted: all of the tenant's brands blended. A brand the tenant doesn't own is a 404."},{"name":"x-cms-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Service accounts only: the org to read. Ignored for a user JWT.","title":"X-Cms-Org-Id"},"description":"Service accounts only: the org to read. Ignored for a user JWT."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewResponse"}}}},"401":{"description":"Missing, invalid or unresolvable Auth0 user token."},"404":{"description":"`brand_id` is not owned by the caller's tenant."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/visibility/providers":{"get":{"tags":["visibility"],"summary":"Providers and models in the tenant's data","description":"Every distinct (provider, model) pair in the tenant's scored data.","operationId":"list_visibility_providers","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-cms-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Service accounts only: the org to read. Ignored for a user JWT.","title":"X-Cms-Org-Id"},"description":"Service accounts only: the org to read. Ignored for a user JWT."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvidersResponse"}}}},"401":{"description":"Missing, invalid or unresolvable Auth0 user token."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/visibility/competitors":{"get":{"tags":["visibility"],"summary":"Tenant vs configured competitors, ranked","description":"The Competitors tab: one row per configured competitor plus the tenant's own\nrow (`is_tenant`), ranked by anchor-run visibility, with period aggregates over\nthe range and a weekly series over all history. Also the mention-weighted\ncompetitor average.","operationId":"list_visibility_competitors","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor.","title":"Start Date"},"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run.","title":"End Date"},"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run."},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Snake_cased category name from `/config`, e.g. `home_loans`. Omitted or empty: all categories blended.","title":"Category"},"description":"Snake_cased category name from `/config`, e.g. `home_loans`. Omitted or empty: all categories blended."},{"name":"brand_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Brand slug from `/config`. Omitted: all of the tenant's brands blended. A brand the tenant doesn't own is a 404.","title":"Brand Id"},"description":"Brand slug from `/config`. Omitted: all of the tenant's brands blended. A brand the tenant doesn't own is a 404."},{"name":"x-cms-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Service accounts only: the org to read. Ignored for a user JWT.","title":"X-Cms-Org-Id"},"description":"Service accounts only: the org to read. Ignored for a user JWT."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompetitorsResponse"}}}},"401":{"description":"Missing, invalid or unresolvable Auth0 user token."},"404":{"description":"`brand_id` is not owned by the caller's tenant."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/visibility/prompts":{"get":{"tags":["visibility"],"summary":"Per-prompt visibility at the anchor run","description":"The Prompts tab: one row per prompt at the anchor run, collapsed across\nproviders (mean mention rate, modal position and sentiment, competitors named).","operationId":"list_visibility_prompts","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor.","title":"Start Date"},"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run.","title":"End Date"},"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run."},{"name":"intent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only prompts of this intent, matched exactly (free text). In use: `informational`, `comparative`, `transactional`, `recommendation`, `branded`, `contextual`. An unknown value returns no rows.","title":"Intent"},"description":"Only prompts of this intent, matched exactly (free text). In use: `informational`, `comparative`, `transactional`, `recommendation`, `branded`, `contextual`. An unknown value returns no rows."},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Snake_cased category name from `/config`, e.g. `home_loans`. Omitted or empty: all categories blended.","title":"Category"},"description":"Snake_cased category name from `/config`, e.g. `home_loans`. Omitted or empty: all categories blended."},{"name":"brand_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Brand slug from `/config`. Omitted: all of the tenant's brands blended. A brand the tenant doesn't own is a 404.","title":"Brand Id"},"description":"Brand slug from `/config`. Omitted: all of the tenant's brands blended. A brand the tenant doesn't own is a 404."},{"name":"x-cms-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Service accounts only: the org to read. Ignored for a user JWT.","title":"X-Cms-Org-Id"},"description":"Service accounts only: the org to read. Ignored for a user JWT."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptListResponse"}}}},"401":{"description":"Missing, invalid or unresolvable Auth0 user token."},"404":{"description":"`brand_id` is not owned by the caller's tenant."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/visibility/prompts/{prompt_id}":{"get":{"tags":["visibility"],"summary":"One prompt: every provider's answer and its trend","description":"The prompt drill-down: each provider's full answer and scoring at the anchor\nrun, plus the prompt's mention-rate trend over the range.","operationId":"get_visibility_prompt","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prompt_id","in":"path","required":true,"schema":{"type":"string","description":"`prompt_id` from `/prompts`.","title":"Prompt Id"},"description":"`prompt_id` from `/prompts`."},{"name":"brand_id","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Brand slug from `/config`. Required: `prompt_id` is shared by every brand with the same prompt.","title":"Brand Id"},"description":"Brand slug from `/config`. Required: `prompt_id` is shared by every brand with the same prompt."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor.","title":"Start Date"},"description":"Inclusive lower bound on run_date. Cutoff for the weekly series. Omitted: 16 weekly runs below the anchor."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run.","title":"End Date"},"description":"Inclusive upper bound on run_date. The anchor run is the last scored run inside [start_date, end_date]; a range with no scored run is empty. Omitted: the latest scored run."},{"name":"x-cms-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Service accounts only: the org to read. Ignored for a user JWT.","title":"X-Cms-Org-Id"},"description":"Service accounts only: the org to read. Ignored for a user JWT."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptDetailResponse"}}}},"401":{"description":"Missing, invalid or unresolvable Auth0 user token."},"404":{"description":"`brand_id` is not owned by the caller's tenant."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/visibility/config":{"get":{"tags":["visibility"],"summary":"The tenant's brand configuration","description":"Every brand the tenant owns, with its categories, prompts and configured\ncompetitors. Read from the bundled `brands/` YAML, not the database: the source\nof valid `brand_id` and `category` values.","operationId":"get_brand_config","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-cms-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Service accounts only: the org to read. Ignored for a user JWT.","title":"X-Cms-Org-Id"},"description":"Service accounts only: the org to read. Ignored for a user JWT."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandConfigResponse"}}}},"401":{"description":"Missing, invalid or unresolvable Auth0 user token."},"404":{"description":"The tenant has no brand config."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/m2m/tenants/{tenant_id}/config":{"get":{"tags":["m2m"],"summary":"A tenant's brand configuration, for service accounts","description":"Same body as `/api/v1/visibility/config`, for any tenant. Callers authenticate\nwith a Google-signed ID token whose audience is this API's URL, minted for a\nservice account on the `ALLOWED_M2M_SERVICE_ACCOUNTS` allowlist.","operationId":"get_brand_config_m2m","security":[{"HTTPBearer":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_\\-]{1,64}$","description":"The tenant to read.","title":"Tenant Id"},"description":"The tenant to read."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandConfigResponse"}}}},"401":{"description":"Missing or invalid service-account ID token."},"404":{"description":"The tenant has no brand config."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Liveness probe","description":"Unauthenticated. Always `{\"status\": \"ok\"}` once the app is up.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}}}}},"components":{"schemas":{"BrandConfigBrand":{"properties":{"brand_id":{"type":"string","title":"Brand Id","description":"Slug of `name`, the value the `brand_id` filter takes."},"name":{"type":"string","title":"Name","description":"Brand display name."},"geography":{"type":"string","title":"Geography","description":"Market the prompts are answered for, e.g. `Australia` or `Worldwide`."},"bcp_brands":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Bcp Brands","description":"BCP brand keys this brand maps to, for Perseus modelling. `null` = nothing to join yet."},"competitors":{"items":{"type":"string"},"type":"array","title":"Competitors","description":"Configured competitors, the rows `/competitors` ranks."},"categories":{"items":{"$ref":"#/components/schemas/BrandConfigCategory"},"type":"array","title":"Categories","description":"Prompt panels, one per category."}},"type":"object","required":["brand_id","name","geography","competitors","categories"],"title":"BrandConfigBrand","description":"A single brand owned by the tenant, sourced from `brands/*.yaml`."},"BrandConfigCategory":{"properties":{"name":{"type":"string","title":"Name","description":"Snake_cased category name, the value the `category` filter takes."},"prompts":{"items":{"$ref":"#/components/schemas/BrandConfigPromptItem"},"type":"array","title":"Prompts","description":"The category's prompt panel."}},"type":"object","required":["name","prompts"],"title":"BrandConfigCategory"},"BrandConfigPromptItem":{"properties":{"text":{"type":"string","title":"Text","description":"The prompt text."},"intent":{"type":"string","title":"Intent","description":"The prompt's intent."}},"type":"object","required":["text","intent"],"title":"BrandConfigPromptItem"},"BrandConfigResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id","description":"The tenant every brand below belongs to."},"brands":{"items":{"$ref":"#/components/schemas/BrandConfigBrand"},"type":"array","title":"Brands","description":"Every brand the tenant owns."}},"type":"object","required":["tenant_id","brands"],"title":"BrandConfigResponse","description":"The tenant's brand configuration, sourced from `brands/*.yaml`.\n\nInternal fields (`cms_org_id`, `aliases`) are not exposed."},"CompetitorRow":{"properties":{"name":{"type":"string","title":"Name","description":"Configured competitor name, or the tenant's brand name on the `is_tenant` row."},"mention_count":{"type":"integer","title":"Mention Count","description":"Anchor-run rows naming this brand, branded-intent prompts excluded."},"period_mention_count":{"type":"integer","title":"Period Mention Count","description":"The same count summed over every run in the range.","default":0},"visibility_score":{"type":"number","title":"Visibility Score","description":"Anchor-run visibility (0–100): `mention_count` ÷ scored rows. 0 on a break week."},"wow_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wow Delta","description":"Anchor-run visibility minus the prior run's, in points. `null` with no prior run or when either run is a break week."},"period_average":{"type":"number","title":"Period Average","description":"Mentions ÷ scored rows, both summed over every run in the range, then divided once (0–100). Never an average of weekly scores."},"period_change":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Period Change","description":"Anchor-run visibility minus the first in-range run's, in points. `null` for a single-run range (show `wow_delta` instead) or when either end is a break week."},"share_of_voice":{"type":"number","title":"Share Of Voice","description":"This row's period mentions as a % of every ranked row's period mentions, tenant included.","default":0.0},"gap_to_top":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gap To Top","description":"Leader's visibility minus this row's, in points. `null` on the leader."},"lead_over_next":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lead Over Next","description":"This row's visibility minus the next-ranked row's, in points. `null` on the last row."},"rank":{"type":"integer","title":"Rank","description":"1-based order by `visibility_score` desc, then name asc. Unset (0) on `competitor_average`.","default":0},"prior_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prior Rank","description":"The same ordering on the prior run's scores. `null` when the row has no prior-run score."},"sentiment_rank":{"type":"integer","title":"Sentiment Rank","description":"1-based order by `net_sentiment` desc, unscored rows last.","default":0},"position_rank":{"type":"integer","title":"Position Rank","description":"1-based order by `first` rate, then `top3` rate, then `listed` rate, then `period_average`.","default":0},"modal_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modal Sentiment","description":"Most frequent sentiment over the range (`positive`, `neutral`, `negative`); ties go to the better value. `null` with no sentiment-scored mention."},"modal_position":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modal Position","description":"Most frequent position band over the range (`first`, `top3`, `listed`); ties go to the better value. Never `only_mention`."},"position_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Position Distribution","description":"Mentions per position band over the range, branded-intent prompts excluded. Keys in order `first`, `top3`, `listed`; zero counts omitted. `first` = ranked above every rival named in the answer, `top3` = in the top three, `listed` = below the top three. `only_mention` is excluded: only the tracked brand can receive it, so it would make the tenant incomparable to its competitors."},"position_rates":{"additionalProperties":{"type":"number"},"type":"object","title":"Position Rates","description":"`position_distribution` as % of the brand's ranked mentions."},"sentiment_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sentiment Distribution","description":"`positive` / `neutral` / `negative` mention counts over the range, branded-intent prompts INCLUDED; zero counts omitted."},"sentiment_rates":{"additionalProperties":{"type":"number"},"type":"object","title":"Sentiment Rates","description":"`sentiment_distribution` as % of the brand's sentiment-scored mentions (sums to 100)."},"net_sentiment":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Sentiment","description":"Positive rate − negative rate over the range, in points (−100 to +100). `null` with no sentiment-scored mention."},"is_tenant":{"type":"boolean","title":"Is Tenant","description":"True only on the tenant's own row (read from its `scored_results` columns rather than `competitor_details`).","default":false},"weekly_visibility":{"items":{"$ref":"#/components/schemas/CompetitorWeeklyPoint"},"type":"array","title":"Weekly Visibility","description":"One point per entry of the response's `run_dates`: every scored week in history up to the anchor, not just the range. A week the brand wasn't named is 0. The last point equals `visibility_score`."}},"type":"object","required":["name","mention_count","visibility_score","wow_delta","period_average","modal_sentiment","modal_position","weekly_visibility"],"title":"CompetitorRow"},"CompetitorWeeklyPoint":{"properties":{"run_date":{"type":"string","format":"date","title":"Run Date","description":"Monday of the run week (Australia/Sydney), `YYYY-MM-DD`."},"visibility_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Visibility Score","description":"Visibility that week (0–100). `null` only on a competitor or competitor-average series, in a week where no competitor was named at all: a scorer gap, not a true 0%, so charts break the line there. The tenant's own series is never `null`."},"net_sentiment":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Sentiment","description":"% positive − % negative that week (−100 to +100). `null` when the brand had no sentiment-scored mention."},"mention_count":{"type":"integer","title":"Mention Count","description":"Rows that week naming the brand, branded-intent prompts excluded.","default":0}},"type":"object","required":["run_date","visibility_score"],"title":"CompetitorWeeklyPoint"},"CompetitorsResponse":{"properties":{"run_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Run Date","description":"The anchor run. `null` when the range holds no scored run."},"competitors":{"items":{"$ref":"#/components/schemas/CompetitorRow"},"type":"array","title":"Competitors","description":"Every configured competitor plus the tenant's own row, sorted by `rank`. A configured competitor nobody named gets a 0% row. Brands the judge named but the config doesn't track are omitted."},"competitor_average":{"anyOf":[{"$ref":"#/components/schemas/CompetitorRow"},{"type":"null"}],"description":"Mention-weighted average of the configured competitors: mentions summed across competitors ÷ (configured competitors × scored rows). `rank` is unset. `null` when the brand tracks no competitor or the range holds no scored run."},"run_dates":{"items":{"type":"string","format":"date"},"type":"array","title":"Run Dates","description":"The chart's x-axis: every scored week up to the anchor, ascending."},"period_weeks":{"type":"integer","title":"Period Weeks","description":"Scored runs inside the range. 1 → show `wow_delta`, otherwise `period_average`.","default":0},"history_weeks":{"type":"integer","title":"History Weeks","description":"Scored runs in all history. Below 2, no trend is possible.","default":0},"mean_period_average":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Period Average","description":"Plain mean of `period_average` over the ranked rows, tenant included: the quadrant chart's divider. Not the same as `competitor_average`. `null` when the range holds no scored run."}},"type":"object","required":["run_date","competitors"],"title":"CompetitorsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"OverviewResponse":{"properties":{"latest_run_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Latest Run Date","description":"The anchor run: last scored run inside the requested range. `null` when the range holds none."},"earliest_run_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Earliest Run Date","description":"First scored run for this brand/category in all history, ignoring the range. The date picker's lower bound."},"tenant":{"anyOf":[{"$ref":"#/components/schemas/TenantVisibility"},{"type":"null"}],"description":"The tenant's headline figures. `null` when the range holds no scored run."},"aggregate":{"items":{"$ref":"#/components/schemas/CompetitorWeeklyPoint"},"type":"array","title":"Aggregate","description":"The tenant's weekly visibility line, clipped to the range. Its last point equals `tenant.visibility`."},"per_provider":{"items":{"$ref":"#/components/schemas/ProviderMentionRate"},"type":"array","title":"Per Provider","description":"Mention rate per provider per week inside the range."}},"type":"object","required":["latest_run_date","earliest_run_date","tenant","aggregate","per_provider"],"title":"OverviewResponse"},"PromptCompetitor":{"properties":{"name":{"type":"string","title":"Name","description":"Competitor name in the config's spelling."},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment","description":"That brand's sentiment: `positive`, `neutral` or `negative`."},"position":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position","description":"That brand's position band, not an ordinal rank: two brands can both be `top3`. `first` = ranked above every rival named in the answer, `top3` = in the top three, `listed` = below the top three."}},"type":"object","required":["name","sentiment","position"],"title":"PromptCompetitor","description":"One configured competitor named in the same answer as the subject brand."},"PromptDetailProviderRow":{"properties":{"provider":{"type":"string","title":"Provider","description":"Provider name."},"model":{"type":"string","title":"Model","description":"Model id the provider was queried with."},"mentioned":{"type":"boolean","title":"Mentioned","description":"True if the answer mentioned the brand or an alias."},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment","description":"`positive`, `neutral`, `negative` or `not_mentioned`."},"position":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Position","description":"Rank relative to rivals named in the same answer: `first`, `top3`, `listed`, `only_mention` (no rival named) or `not_mentioned`."},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context","description":"`recommended`, `compared`, `mentioned_in_passing` or `not_mentioned`."},"prompt_text":{"type":"string","title":"Prompt Text","description":"The question sent."},"response_text":{"type":"string","title":"Response Text","description":"The provider's full answer."},"competitors":{"items":{"$ref":"#/components/schemas/PromptCompetitor"},"type":"array","title":"Competitors","description":"Configured competitors named in the answer, best position band first. Brands the config doesn't track are omitted."}},"type":"object","required":["provider","model","mentioned","sentiment","position","context","prompt_text","response_text"],"title":"PromptDetailProviderRow"},"PromptDetailResponse":{"properties":{"prompt_id":{"type":"string","title":"Prompt Id","description":"Echo of the path parameter."},"latest_run_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Latest Run Date","description":"The anchor run the provider rows are read from. `null` when the range holds none."},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent","description":"The prompt's intent."},"prompt_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Type","description":"`staple` for every prompt since category configs; `contextual` only on older rows."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Snake_cased category of the prompt."},"brand_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Id","description":"Echo of the `brand_id` filter."},"providers":{"items":{"$ref":"#/components/schemas/PromptDetailProviderRow"},"type":"array","title":"Providers","description":"One row per provider at the anchor run."},"trend":{"items":{"$ref":"#/components/schemas/PromptTrendPoint"},"type":"array","title":"Trend","description":"The prompt's mention rate per week inside the range."}},"type":"object","required":["prompt_id","latest_run_date","intent","prompt_type","providers","trend"],"title":"PromptDetailResponse"},"PromptListResponse":{"properties":{"run_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Run Date","description":"The anchor run the rows are read from. `null` when the range holds no scored run."},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent","description":"Echo of the `intent` filter."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Echo of the `category` filter."},"brand_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Id","description":"Echo of the `brand_id` filter."},"prompts":{"items":{"$ref":"#/components/schemas/PromptListRow"},"type":"array","title":"Prompts","description":"One row per prompt, collapsed across providers."}},"type":"object","required":["run_date","intent","prompts"],"title":"PromptListResponse"},"PromptListRow":{"properties":{"prompt_id":{"type":"string","title":"Prompt Id","description":"Hash of `category:prompt_text`. Shared by every brand that has the same prompt."},"prompt_text":{"type":"string","title":"Prompt Text","description":"The question sent to every provider."},"intent":{"type":"string","title":"Intent","description":"`informational`, `comparative`, `transactional`, `recommendation`, `branded` or `contextual`."},"prompt_type":{"type":"string","title":"Prompt Type","description":"`staple` for every prompt since category configs; `contextual` only on older rows."},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Snake_cased category the prompt belongs to."},"brand_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Id","description":"Brand the row belongs to."},"mention_rate":{"type":"number","title":"Mention Rate","description":"% of providers that mentioned the brand for this prompt at the anchor run (0–100)."},"wow_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wow Delta","description":"`mention_rate` minus the prior run's, in points. `null` when the prompt is new (absent from the prior run); `0.0` when the tenant has a single week of data."},"any_mentioned":{"type":"boolean","title":"Any Mentioned","description":"True if any provider mentioned the brand."},"modal_position":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modal Position","description":"Most common `position` across providers. Values as on the judge row: `first`, `top3`, `listed`, `only_mention`, `not_mentioned`."},"modal_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modal Sentiment","description":"Most common `sentiment` across providers: `positive`, `neutral`, `negative`, `not_mentioned`."},"competitors_mentioned":{"items":{"type":"string"},"type":"array","title":"Competitors Mentioned","description":"Configured competitors any provider named, in the config's spelling, sorted. Brands the config doesn't track are omitted."},"any_brand_url_cited":{"type":"boolean","title":"Any Brand Url Cited","description":"True if any provider cited the brand's URL."}},"type":"object","required":["prompt_id","prompt_text","intent","prompt_type","mention_rate","wow_delta","any_mentioned","modal_position","modal_sentiment","competitors_mentioned","any_brand_url_cited"],"title":"PromptListRow"},"PromptTrendPoint":{"properties":{"run_date":{"type":"string","format":"date","title":"Run Date","description":"Monday of the run week (Australia/Sydney), `YYYY-MM-DD`."},"mention_rate":{"type":"number","title":"Mention Rate","description":"% of providers that mentioned the brand that week (0–100)."}},"type":"object","required":["run_date","mention_rate"],"title":"PromptTrendPoint"},"ProviderInfo":{"properties":{"provider":{"type":"string","title":"Provider","description":"Provider name, e.g. `openai`."},"model":{"type":"string","title":"Model","description":"Model id the provider was queried with, e.g. `gpt-5.4-nano`."}},"type":"object","required":["provider","model"],"title":"ProviderInfo"},"ProviderMentionRate":{"properties":{"provider":{"type":"string","title":"Provider","description":"Provider name: `openai`, `anthropic`, `gemini` or `perplexity`."},"run_date":{"type":"string","format":"date","title":"Run Date","description":"Monday of the run week (Australia/Sydney), `YYYY-MM-DD`."},"mention_rate":{"type":"number","title":"Mention Rate","description":"% of this provider's scored rows that mention the brand that week (0–100). Branded-intent prompts excluded."}},"type":"object","required":["provider","run_date","mention_rate"],"title":"ProviderMentionRate"},"ProvidersResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/ProviderInfo"},"type":"array","title":"Providers","description":"Every distinct (provider, model) pair in the tenant's scored data."}},"type":"object","required":["providers"],"title":"ProvidersResponse"},"TenantVisibility":{"properties":{"visibility":{"type":"number","title":"Visibility","description":"Anchor-run visibility (0–100): rows mentioning the brand ÷ scored rows, branded-intent prompts excluded. Equals `visibility_score` on the `is_tenant` row of `/competitors`."},"wow_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wow Delta","description":"Anchor-run visibility minus the prior scored run's, in points. `null` with no prior run."},"rank":{"type":"integer","title":"Rank","description":"1-based rank among the tenant and its configured competitors, by anchor-run visibility."},"prior_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prior Rank","description":"The same rank on the prior scored run. `null` with no prior run."}},"type":"object","required":["visibility","wow_delta","rank","prior_rank"],"title":"TenantVisibility","description":"The tenant's own anchor-week figures.\n\nLifted off the `is_tenant` row of `/competitors`, so the two tabs cannot disagree."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"`/api/v1/visibility/*`: an Auth0 user JWT carrying a `cms_org_id` claim, or a Google-signed ID token for an allowlisted service account that names the org in `x-cms-org-id`. `/api/v1/m2m/*`: a Google-signed ID token for an allowlisted service account.","scheme":"bearer"}}}}