# Overview (/docs/agents) Coding agents can work on answer engine optimization with Recall in two ways: * **The `recall-aeo` skill** gives the agent an evidence-based AEO workflow: build a prompt set, measure a baseline, diagnose why a brand is missing, fix access, content, and off-site sources, then re-measure. It works without a Recall account, and uses Recall's data when it has it. [Install the skill](/docs/agents/skill). * **The MCP server** lets Claude Code, Cursor, Claude Desktop, and ChatGPT read a brand's visibility, share of voice, cited sources, answers, and briefing, and add prompts. Connect with an organization API key or OAuth sign-in. See [MCP server](/docs/api/mcp). * **The REST API** lets an agent read brands, prompts, and competitors, and add prompts, with an organization API key from **Settings → API keys**. See the [API reference](/docs/api). ## What the skill covers [#what-the-skill-covers] * Repeated measurement: visibility as a rate over many runs, with the number of runs, the window, and a 95% interval, never a single answer. * Markets: each country and language measured on its own, with prompts written in the buyer's language. Poland, Germany, Austria, Switzerland (German, French, English), and the Nordics are covered in detail. * Diagnosis: retrieval absence, entity ambiguity, corpus absence, and framing loss, each with its own fix. * An access audit script that checks robots.txt, firewall blocks, raw HTML, snippet controls, and language redirects for every major AI crawler. * Evidence labels on every number: Measured, First-party, Published, or Estimated, with dated sources for published claims. * Experiments: each fix shipped as a tracked action, with a locked baseline and a lift or decline called only when the intervals separate. ## Machine-readable files [#machine-readable-files] | File | Contents | | -------------------------------------------------------------------------------------- | -------------------------------------- | | [`/.well-known/agent-skills/index.json`](/.well-known/agent-skills/index.json) | Skill discovery index | | [`/.well-known/agent-skills/recall-aeo.tgz`](/.well-known/agent-skills/recall-aeo.tgz) | The skill as an archive | | [`/llms.txt`](/llms.txt) | Index of this site for language models | | [`/llms-full.txt`](/llms-full.txt) | Full text of the documentation | # Skill (/docs/agents/skill) The `recall-aeo` skill is published at `https://dorecall.com/.well-known/agent-skills/`. Agents load it when a question is about AI visibility, for example "how do I get our brand recommended by ChatGPT?". It is MIT-licensed. ## Install [#install] The [skills CLI](https://github.com/vercel-labs/skills) finds the agents on your machine and installs the skill for each: ```bash npx skills add https://dorecall.com ``` With pnpm, use `pnpm dlx skills add https://dorecall.com`. Add `-g` to install for your user instead of the current project. ### One agent [#one-agent] | Agent | Command | Project folder | With `-g` | | ----------- | --------------------------------------------------------- | --------------------------- | ----------------------------- | | Claude Code | `npx skills add https://dorecall.com --agent claude-code` | `.claude/skills/recall-aeo` | `~/.claude/skills/recall-aeo` | | Cursor | `npx skills add https://dorecall.com --agent cursor` | `.agents/skills/recall-aeo` | `~/.cursor/skills/recall-aeo` | | Codex | `npx skills add https://dorecall.com --agent codex` | `.agents/skills/recall-aeo` | `~/.codex/skills/recall-aeo` | ### By hand [#by-hand] Download the archive and unpack it into the agent's skills folder. For Claude Code: ```bash mkdir -p ~/.claude/skills/recall-aeo curl -fsSL https://dorecall.com/.well-known/agent-skills/recall-aeo.tgz | tar -xz -C ~/.claude/skills/recall-aeo ``` For Cursor or Codex in a project, unpack into `.agents/skills/recall-aeo` instead. ## What's in it [#whats-in-it] | File | Contents | | ---------------------------- | -------------------------------------------------------------------------------------------- | | `SKILL.md` | Ground rules, the workflow, the four causes of absence, what not to recommend, report format | | `references/measurement.md` | Prompt sets, sampling, outcome classes, Wilson intervals, before-and-after comparison | | `references/markets.md` | Measuring by country and language: Poland, DACH and Switzerland, the Nordics | | `references/recall.md` | Reading Recall data from an agent: REST API, everyday questions, experiments | | `references/technical.md` | AI crawlers, robots.txt, firewall blocks, rendering, indexing, snippet controls | | `references/content.md` | Pages that get retrieved and quoted, and scaled templates to avoid | | `references/off-site.md` | Third-party sources, consistent positioning, lines not to cross | | `references/evidence.md` | Dated sources for every claim, and common myths | | `scripts/check_ai_access.py` | Access audit for AI crawlers, with a `--lang` option per market | ## Connect it to your data [#connect-it-to-your-data] With access to your Recall workspace, the agent reads your measured visibility, citations, and competitors instead of sampling answers by hand. The skill's `references/recall.md` covers the [REST API](/docs/api). Without Recall, the skill falls back to manual sampling and labels those numbers as estimates. ## Try [#try] > How do we get recommended by ChatGPT for coworking spaces in Warsaw? > Why did our Perplexity visibility in Switzerland drop last month? > Check whether AI crawlers can read our German and French pages. > Which pages do the engines cite when a competitor is named instead of us? # API keys (/docs/api/api-keys) An API key acts for one organization (workspace) and every brand in it. Keys start with `rcl_`. ## Create a key [#create-a-key] . Open **Settings → API keys**. . Enter a name, choose the access, and choose when it expires. . Copy the key. It is shown once; Recall stores only a hash of it. Only workspace owners and admins can create and revoke keys. Members can see the list. | Access | Allows | | -------------- | --------------------------------------------------------------------------------------- | | Read | Every read tool on the [MCP server](/docs/api/mcp) and the `GET` endpoints listed below | | Read and write | Read, plus adding prompts (`create_prompts`, `POST /api/v1/prompts`) | ## Use a key [#use-a-key] Send it as a bearer token: ```http Authorization: Bearer rcl_YOUR_KEY ``` ```bash curl https://app.dorecall.com/api/v1/brands \ -H "Authorization: Bearer rcl_YOUR_KEY" ``` A key sees only its own organization's data. A brand, prompt or competitor from another organization returns `404`, the same as one that does not exist. ### REST endpoints that accept organization keys [#rest-endpoints-that-accept-organization-keys] | Method | Path | Access | | ------ | -------------------------------------------------------------------------------------- | -------------- | | `GET` | `/api/v1/brands`, `/api/v1/brands/{brandId}` | Read | | `GET` | `/api/v1/competitors`, `/api/v1/competitors/{competitorId}` | Read | | `GET` | `/api/v1/prompts`, `/api/v1/prompts/{promptId}`, `/api/v1/prompts/{promptId}/snapshot` | Read | | `POST` | `/api/v1/prompts` | Read and write | Other `/api/v1` endpoints return `403` for organization keys. ## Revoke a key [#revoke-a-key] In **Settings → API keys**, choose **Revoke**. The key stops working on its next request. Expired and revoked keys stay in the list for reference. ## Limits and errors [#limits-and-errors] | Status | Meaning | | ------ | -------------------------------------------------------------------------- | | `401` | Missing, unknown, expired or revoked key | | `403` | The key lacks the scope, or the endpoint does not accept organization keys | | `429` | More than 600 requests a minute from one key; see `Retry-After` | API keys are not available on the read-only demo. # Overview (/docs/api) Recall provides a REST API for managing brands, prompts, and snapshots programmatically. All endpoints require Bearer token authentication. **Base URL:** `/api/v1` ## Authentication [#authentication] Include your API key in the `Authorization` header: ```http Authorization: Bearer YOUR_API_KEY ``` Two kinds of key are accepted: * **Organization keys** (`rcl_…`) are created in **Settings → API keys** and see only their organization's data. They work on the endpoints listed in [API keys](/docs/api/api-keys) and on the [MCP server](/docs/api/mcp). * **Operator keys** are configured server-side via the `ADMIN_API_KEYS` environment variable and reach every endpoint across all organizations. ## Endpoints [#endpoints] Browse the available endpoints in the sidebar, grouped by resource: * **Brands** — manage brand records * **Tools** — one-shot helpers (e.g. brand analysis) that don't persist anything * **Prompts** — manage brand prompts * **Competitors** — manage brand competitors * **Snapshots** — aggregated analytics snapshots for prompts * **Reports** — generate and retrieve AI Share of Voice reports # MCP server (/docs/api/mcp) Recall runs an MCP server, so an AI agent can read a brand's visibility, share of voice, cited sources and answers, and add prompts to track. | | | | --------- | ----------------------------------------------------------------------- | | URL | `https://app.dorecall.com/api/mcp` (self-hosted: `/api/mcp`) | | Transport | Streamable HTTP, stateless | | Auth | Organization API key as `Authorization: Bearer rcl_…`, or OAuth sign-in | There are two ways to authenticate: * **API key.** Create one in **Settings → API keys** (see [API keys](/docs/api/api-keys)). It acts for one organization. A read key gets the read tools; a read-and-write key also gets `create_prompts`. * **OAuth.** Clients that support it open a Recall page where you sign in and choose **Allow**. The connection then acts as you, in every organization you belong to, with read and write access. To disconnect, remove the server from the client. The server lists only the tools the connection may call. ## Connect [#connect] ### Claude Code [#claude-code] With an API key: ```bash claude mcp add --transport http recall https://app.dorecall.com/api/mcp \ --header "Authorization: Bearer rcl_YOUR_KEY" ``` With OAuth, add the server without a header, then run `/mcp` in Claude Code and choose **Authenticate**: ```bash claude mcp add --transport http recall https://app.dorecall.com/api/mcp ``` ### Cursor [#cursor] Add to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project): ```json { "mcpServers": { "recall": { "url": "https://app.dorecall.com/api/mcp", "headers": { "Authorization": "Bearer rcl_YOUR_KEY" } } } } ``` To use OAuth instead, leave out `headers`; Cursor shows a **Connect** button for the server in **Settings → MCP**. ### Claude Desktop and claude.ai [#claude-desktop-and-claudeai] With OAuth: **Settings → Connectors → Add custom connector**. Name it `Recall`, enter `https://app.dorecall.com/api/mcp`, choose **Add**, then **Connect** and approve the request in Recall. With an API key: add to `claude_desktop_config.json` (**Settings → Developer → Edit Config**) and restart Claude Desktop. This uses [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) to send the header and needs Node.js. ```json { "mcpServers": { "recall": { "command": "npx", "args": [ "-y", "mcp-remote", "https://app.dorecall.com/api/mcp", "--header", "Authorization:${RECALL_API_KEY}" ], "env": { "RECALL_API_KEY": "Bearer rcl_YOUR_KEY" } } } } ``` ### ChatGPT [#chatgpt] ChatGPT connects with OAuth only. . **Settings → Apps & Connectors → Advanced settings**: turn on **Developer mode**. . **Settings → Apps & Connectors → Create**. . Name: `Recall`. MCP server URL: `https://app.dorecall.com/api/mcp`. Authentication: **OAuth**. . Choose **Create**, then sign in to Recall and choose **Allow**. ChatGPT asks before running `create_prompts`; the read tools run without asking. ### Check the connection [#check-the-connection] Ask the agent to call `whoami`. It returns how the connection is authenticated, its organizations and scopes, and the tools it can use. ### OAuth details [#oauth-details] For client developers. Discovery follows RFC 9728 and RFC 8414: a request without credentials gets `401` with `WWW-Authenticate: Bearer resource_metadata="/.well-known/oauth-protected-resource"`. | | | | ----------------------------- | ------------------------------------------------------------------ | | Authorization server metadata | `/.well-known/oauth-authorization-server` | | Authorization endpoint | `/auth/authorize` | | Token endpoint | `/api/auth/mcp/token` | | Dynamic client registration | `/api/auth/mcp/register` | | Grant types | `authorization_code` with PKCE (`S256`, required), `refresh_token` | | Scopes | `openid`, `profile`, `email`, `offline_access` | | Token lifetime | Access token 1 hour, refresh token 7 days | ## Numbers [#numbers] * Rates and shares are fractions of 1, not percentages. * Every number comes with `n` (the answers behind it), the `window`, and the `engine` it describes. `engine: "all"` covers every engine. * Visibility counts measurable answers only. Refused, unanswered and failed runs are reported under `excluded`, not counted as absences. * Windows are whole UTC days, both ends inclusive. Pass `days` (1–365, default 30, ending today) or `from` and `to` as `YYYY-MM-DD` (up to 366 days). * `engine` filters to one engine id: `chatgpt`, `claude`, `perplexity`, `gemini`, `google-ai-overview`, `google-ai-mode`, `copilot`, `grok`, `mistral`, `deepseek`, `kimi`. ## Tools [#tools] Every brand tool takes a `brandId` from `list_brands`. A brand in another organization returns `Brand not found`, the same as one that does not exist. Read tools are annotated `readOnlyHint: true`. `create_prompts` is a write tool annotated `destructiveHint: false`: it only adds prompts. Any future write tool that changes or deletes data is annotated destructive. | Tool | Scope | Inputs | Output | | ----------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `whoami` | read | none | `kind` (`organization-api-key` or `oauth-user`), `keyName` or `email`, `organizationIds`, `scopes`, `tools` | | `list_brands` | read | none | `brands[]`: `id`, `name`, `website`, `additionalDomains`, `organizationId`, `enabled`, `engines`, `locale` | | `get_visibility` | read | `brandId`; `days` or `from`+`to`; `engine` | `window`, `prompts`; per engine and `allEngines`: `engine`, `visibility` and `nonBrandedVisibility` as `{ n, successes, rate, ci95 }`, `excluded { refused, noAnswer, error }` | | `get_share_of_voice` | read | `brandId`; `days` or `from`+`to`; `engine` | `window`, `competitorSet { version, locked, approvedAt, names }`; per engine and `allEngines`: `engine`, `n`, `totalMentions`, `entries[] { name, isBrand, mentions, share }` | | `get_top_cited_sources` | read | `brandId`; `days` or `from`+`to`; `engine`; `limit` (1–100, default 20) | `window`, `engine`, `n`, `runsWithCitations`; `domains[] { domain, category, runs, runShare, citations, prompts }`; `urls[] { url, domain, title, category, runs, runShare, citations, prompts }` | | `search_answers` | read | `brandId`; `days` or `from`+`to`; `engine`; `promptId`; `mentioned` (boolean); `contains` (text); `limit` (1–20, default 5) | `window`, `engine`, `n`, `scanned`, `matched`; `answers[] { runId, promptId, prompt, engine, observedAt, outcome, brandMentioned, competitorsMentioned, text, truncated, citations[] }` | | `list_prompts` | read | `brandId`; `enabled` (boolean) | `total`, `enabled`, `prompts[] { id, value, enabled, tags, intentRole, createdAt }` | | `create_prompts` | write | `brandId`; `prompts[] { value, tags? }` (1–20) | `created[] { id, value }`, `skipped[] { value, reason }`, `scopeVersion`, `total`, `limit` | | `get_briefing` | read | `brandId` | `nextActions[] { title, detail, urgency, minutes }`; `recommendation { title, category, why, relatedPrompts, brandPagesCited, competitorPagesCited, deliverable }`; `changes { previousWindow, currentWindow, items[] { kind, title, detail, deltaPercentagePoints, engine, previous { n }, current { n }, evidence } }` | ### Details [#details] * **`get_visibility`** — share of measurable answers that mention the brand, with a 95% Wilson interval. `nonBrandedVisibility` counts only prompts that do not name the brand. Computed over enabled prompts. * **`get_share_of_voice`** — mentions of the brand and of each competitor in the approved competitor set, as a share of all their mentions. A run that names an entity counts once. `competitorSet.locked` is `false` when no set has been approved yet; the approved competitors are used instead. * **`get_top_cited_sources`** — ranked by the number of answers that cited a source (`runs`), not by raw citation count. `runShare` is `runs / n`. `category` is `brand`, `competitor`, or the source type (`editorial`, `reviews`, `social`, …). * **`search_answers`** — newest first. `n` is the number of runs matching every filter except `contains`. A `contains` search reads at most the 500 most recent of those (`scanned`) and reports how many matched. Answer text is cut at 4,000 characters (`truncated`). * **`create_prompts`** — adds prompts and approves the new prompt set, as saving prompts in Settings does. Each new prompt is asked on every enabled engine from then on, which is billed usage. A prompt that matches an existing one (ignoring case and spacing) is skipped. A brand can track at most 100 prompts. It never edits or removes a prompt, so it is not marked destructive. * **`get_briefing`** — the to-do list, the top recommendation of the latest plan with the cited pages behind it, and the week-over-week changes from the Briefing. Changes compare the last 7 days with the 7 before, across all engines; `previous.n` and `current.n` are the comparable answers in each period, and `evidence` is one answer that shows the change. ## Errors [#errors] A failed tool call returns `isError: true` with a message, for example `Brand not found` or a window that is out of range. A request without a valid key or token gets HTTP 401 with a `WWW-Authenticate` challenge. Operator keys (`ADMIN_API_KEYS`) are not accepted. A key that sends more than 600 requests a minute gets HTTP 429 with `Retry-After`. MCP is not available on the read-only demo. # AI Contribution Policy (/docs/developer-guide/ai-policy) ## AI Tools Are Welcome [#ai-tools-are-welcome] We encourage the use of AI coding assistants (Copilot, Cursor, Claude, ChatGPT, etc.) when contributing to Recall. AI tools can help you write code faster, understand unfamiliar parts of the codebase, and generate tests. ## Guidelines [#guidelines] ### Do [#do] * **Use AI to understand the codebase** — Ask it to explain how a module works or trace a data flow * **Use AI for boilerplate** — Generating repetitive code, tests, and type definitions * **Use AI for code review** — Have it check your changes for bugs or edge cases before submitting a PR * **Use AI for documentation** — Writing clear commit messages, PR descriptions, and code comments * **Review all AI-generated code** — You are responsible for every line in your PR ### Don't [#dont] * **Don't submit AI output without review** — Always read, understand, and test generated code before committing * **Don't use AI to generate large, untested features** — Break work into small, reviewable pieces * **Don't rely on AI for security-critical code** — Authentication, authorization, and cryptographic code should be carefully hand-reviewed * **Don't let AI add unnecessary dependencies** — Verify that any suggested packages are actually needed and well-maintained * **Don't use AI to circumvent code review** — The goal is quality, not speed ## Code Quality Standards [#code-quality-standards] Whether you write code by hand or with AI assistance, the same standards apply: * All code must pass `pnpm lint` and `pnpm format` * Tests should cover new functionality * Comments should explain *why*, not *what* (avoid narrating obvious code) * PR descriptions should clearly explain the motivation and approach * Follow existing patterns in the codebase ## Attribution [#attribution] You don't need to disclose whether AI tools were used in your contribution. What matters is that the code is correct, well-tested, and follows the project's conventions. ## Automated Code Generation [#automated-code-generation] Some parts of the codebase are generated (e.g., API docs from the OpenAPI spec, Drizzle migrations). These use deterministic scripts, not AI. Do not manually edit generated files — instead, modify the source and re-run the generation command. # Architecture (/docs/developer-guide/architecture) ## Monorepo Structure [#monorepo-structure] Recall is a pnpm monorepo managed by Turborepo. The codebase is split into **apps** (deployable) and **packages** (shared libraries). ``` . ├── apps/ │ ├── web/ # Main dashboard (TanStack Start) │ ├── worker/ # Background job runner (pg-boss) │ ├── cli/ # @dorecall/cli npm package │ └── www/ # Marketing site (this site) │ ├── packages/ │ ├── ui/ # Shared UI components (shadcn/ui) │ ├── lib/ # Shared business logic, DB schema, AI providers │ ├── config/ # Deployment configuration types │ ├── deployment/ # Deployment mode resolution │ ├── demo/ # Demo mode implementation │ ├── local/ # Local development mode │ ├── whitelabel/ # White-label mode │ ├── og/ # Shared OG image generation │ └── api-spec/ # OpenAPI specification │ ├── docker/ # Dockerfile (multi-stage) ├── e2e/ # End-to-end tests ├── biome.json # Linting and formatting ├── turbo.json # Task pipeline configuration └── pnpm-workspace.yaml ``` ## Tech Stack [#tech-stack] | Layer | Technology | | ----------------- | -------------------------------- | | **Language** | TypeScript 5.x | | **Framework** | TanStack Start (App Router, SSR) | | **Styling** | Tailwind CSS v4 | | **Components** | shadcn/ui (new-york style) | | **Data Fetching** | SWR | | **Database** | PostgreSQL with Drizzle ORM | | **Job Queue** | pg-boss (Postgres-based) | | **Testing** | Vitest | | **Linting** | Biome | | **Monorepo** | Turborepo + pnpm workspaces | ## How the Apps Connect [#how-the-apps-connect] For the runtime topology (web, worker, Postgres, LLM providers), see the [System Architecture diagram](/docs/getting-started#system-architecture). What matters for development: * The **Web App** serves the dashboard UI and the REST API (`/api/v1`). * The **Worker** processes background jobs — querying AI models, running evaluations. * Both import shared code from `packages/lib` (database schema, AI provider config) and `packages/config` (deployment types). * The **CLI** generates Docker Compose configurations and manages the deployment lifecycle. ## Deployment Modes [#deployment-modes] Each deployment mode is implemented as a separate package in `packages/`: | Package | Mode | Description | | --------------------- | ------------ | ------------------------------- | | `packages/local` | `local` | Single-org, email/password auth | | `packages/demo` | `demo` | Read-only demonstration | | `packages/whitelabel` | `whitelabel` | Multi-org with Auth0 SSO | The `packages/deployment` package resolves the active mode at runtime based on `DEPLOYMENT_MODE` and provides the correct implementation. ## Database [#database] The database schema is defined with Drizzle ORM in `packages/lib/src/db/`. Key tables include: * **brands** — Brand profiles with name, website, domains, aliases * **prompts** — Tracking prompts associated with brands * **evaluations** — Results from querying AI models * **citations** — URLs cited by AI models in their responses Migrations are generated with `drizzle-kit generate` and applied with `drizzle-kit migrate`. ## Provider Abstraction [#provider-abstraction] All AI scraping flows through a single `Provider` interface in `packages/lib/src/providers/`. The runtime wiring: . `SCRAPE_TARGETS` (env var) holds comma-separated `model:provider[:version][:online]` entries. . `parseScrapeTargets()` turns the string into `ModelConfig[]`. . `getProvider(providerId).run(model, prompt, { webSearch, version })` dispatches to a concrete `registry/` implementation and returns a normalized `ScrapeResult` (`textContent`, `rawOutput`, `webQueries`, `citations`, `modelVersion`). User-facing setup is documented in [Providers](/docs/user-guide/providers). # Commands Reference (/docs/developer-guide/commands) ## Development [#development] ```bash # Run all dev servers (turbo) pnpm dev # Run only the web app pnpm --filter @workspace/web dev # Run only the worker pnpm --filter @workspace/worker dev ``` ## Building [#building] ```bash # Build all packages pnpm build # Build only the web app pnpm --filter @workspace/web build ``` ## Testing [#testing] ```bash # Run all tests pnpm test # Watch mode for web app tests pnpm --filter @workspace/web test:watch # Postgres integration tests for the web read layer TEST_DATABASE_URL=postgres://postgres:postgres@localhost:5432/recall_test \ pnpm --filter @workspace/web test:integration ``` The integration tests refuse any database that is not local and named `*_test`, and they never migrate it. ## Code Quality [#code-quality] ```bash # Run Biome linter pnpm lint # Format code with Biome pnpm format # Find unused exports and dependencies pnpm knip ``` Always run `pnpm format` before committing to ensure consistent code style across the codebase. ## Database [#database] ```bash # Navigate to the web app cd apps/web # Generate a new migration after schema changes pnpm drizzle-kit generate # Run pending migrations pnpm drizzle-kit migrate ``` ## Component Stories [#component-stories] ```bash # Start Ladle dev server pnpm --filter @workspace/web ladle ``` ## CLI Development [#cli-development] ```bash # Run CLI directly from source pnpm recall # Build and link CLI globally for testing pnpm cli:link # Unlink global CLI pnpm cli:unlink ``` ## Docker [#docker] ```bash # Build Docker images locally recall compose build # Build without cache recall compose build --no-cache # Build only web or worker recall compose build web recall compose build worker # Run other docker compose commands recall compose up -d recall compose ps recall compose logs -f web recall compose down ``` ## Versioning [#versioning] ```bash # Create a changeset (do this before every PR) pnpm changeset # Apply changesets and bump versions (maintainers only) pnpm version-packages ``` ## Turborepo [#turborepo] The monorepo uses Turborepo for parallel task execution and caching. Most commands are defined in `turbo.json` and can be run from the repo root via `pnpm ``` Insert the field with **+ Add Field** rather than typing the braces, then publish the site. ## Publish a deliverable [#publish-a-deliverable] . Open an action you started on **Opportunities**, or the approved bundle on **Settings → AI-ready files**. . Select **Create draft**, check the title, and save. . Open the draft in your CMS and read every claim. . Select **Publish**, confirm you reviewed it, or publish it in the CMS. Recall checks drafts every 10 minutes, so publishing in the CMS is noticed without returning to Recall. A page whose text is not in the HTML yet — often a cache — stays **Live** and is checked again until it shows **Verified**. Briefs and outreach pitches are not published. JSON-LD other than FAQPage describes a page that already exists, so add it to that page by hand. ## For operators [#for-operators] Publishing needs `CMS_CREDENTIALS_KEY` on the web app and the worker: a 32-byte key, for example from `openssl rand -base64 32`. Credentials are encrypted with it (AES-256-GCM). Without it, publishing is off. After changing it, every CMS has to be reconnected. # Registration & Login (/docs/user-guide/registration) ## Create an Account [#create-an-account] With Recall running locally, open your browser to **[http://localhost:1515](http://localhost:1515)**. You'll see the Recall landing page with a **Sign In** button. Click it to navigate to the login page, then click **Create an account** to register. {/* TODO: Screenshot of the Recall landing page */} Fill in your details: * **Name** — Your display name * **Email** — Your email address * **Password** — A secure password {/* TODO: Screenshot of the registration form */} Click **Create Account** to complete registration. You'll be signed in automatically and redirected to the app. ## Sign In [#sign-in] On return visits, go to **[http://localhost:1515](http://localhost:1515)** and click **Sign In**. Enter your email and password to access the dashboard. {/* TODO: Screenshot of the login form */} ## Deployment Modes and Authentication [#deployment-modes-and-authentication] The registration flow depends on your [deployment mode](/docs/developer-guide/configuration): | Mode | Authentication | | ------------------- | --------------------------------------------- | | **Local** (default) | Email and password — the flow described above | | **Demo** | Read-only access, no registration needed | # Reports (/docs/user-guide/reports) ## Reports [#reports] Recall can generate comprehensive AI visibility reports that summarize your brand's performance across all tracked prompts and AI models. {/* TODO: Screenshot of the reports page */} ## Generating a Report [#generating-a-report] Reports are accessible from the sidebar under the **Reports** section (available to admin users). To generate a report: . Navigate to **Reports** in the sidebar . Click **Generate Report** . Select the date range and brands to include . Wait for the report to be generated {/* TODO: Screenshot of the report generation flow */} ## Report Contents [#report-contents] A typical report includes: * **Visibility summary** — Overall visibility score and trend * **Per-prompt breakdown** — Visibility scores for each tracked prompt * **Citation analysis** — Top cited sources and domain breakdown * **Competitor comparison** — How your brand compares to tracked competitors * **Recommendations** — Areas where visibility can be improved ## Sharing Reports [#sharing-reports] Generated reports can be viewed directly in the browser via a shareable URL. This makes it easy to share results with team members or stakeholders who don't have an Recall account. {/* TODO: Screenshot of a rendered report */} # Settings (/docs/user-guide/settings) ## Settings Overview [#settings-overview] The **Settings** section is accessible from the sidebar. It has four sub-pages for managing your Recall configuration. ## Brand Settings [#brand-settings] Configure your brand identity: * **Name** — Your brand name as tracked in AI responses * **Website** — Primary website URL * **Domains** — Additional domains associated with your brand (e.g. blog subdomain, product domains) * **Aliases** — Alternative names or spellings that AI models might use {/* TODO: Screenshot of brand settings */} ## Competitor Settings [#competitor-settings] Manage the competitors you're tracking: * Add competitor brand names and their domains * View competitor mentions alongside your brand in visibility data * Track citation overlap between your brand and competitors {/* TODO: Screenshot of competitor settings */} ## Prompt Settings [#prompt-settings] Manage your tracking prompts: * **Add prompt** — Add one prompt * **Add prompts** — Paste several prompts, one per line; duplicates and blank lines are skipped * **Suggest prompts** — Generate up to 5 more prompts in your market's language that fill buying stages the list is missing; up to 5 runs per brand per day * **Edit prompts** — Modify prompt text and tags * **Enable/Disable** — Toggle tracking for individual prompts without deleting them Changes stay unsaved until you click **Approve question scope** in the bar at the bottom of the page. A brand can hold up to 100 prompts, disabled ones included. {/* TODO: Screenshot of prompt settings */} ## LLM Settings [#llm-settings] Configure which AI models Recall queries: * **OpenAI (ChatGPT)** — Requires `OPENAI_API_KEY` in your environment * **Anthropic (Claude)** — Requires `ANTHROPIC_API_KEY` in your environment * **Google AI Overviews** — Tracks Google's AI-generated summaries You can enable or disable individual models and adjust query parameters. {/* TODO: Screenshot of LLM settings */} ## Updating Environment Variables [#updating-environment-variables] Some settings (like API keys) are configured via environment variables rather than the UI. To update them: ```bash # Edit your .env file in the config directory nano ./recall/.env # Restart to pick up changes recall compose down recall compose up -d ``` See the [Configuration](/docs/developer-guide/configuration) page for a complete reference of environment variables. # Visibility Tracking (/docs/user-guide/visibility) ## Visibility Page [#visibility-page] The **Visibility** page shows per-prompt visibility scores and trends. This is where you get detailed insight into which prompts are driving AI mentions of your brand. {/* TODO: Screenshot of the visibility page */} ## Understanding Visibility Scores [#understanding-visibility-scores] For each prompt, Recall shows: * **Visibility score** — How prominently your brand appears in the AI response (0–100%) * **Trend** — How the score has changed over recent evaluations * **Last checked** — When the prompt was last sent to AI models A high visibility score means AI models consistently mention your brand when answering that type of question. A low score suggests an opportunity to improve your content or SEO for that topic. ## Filtering and Sorting [#filtering-and-sorting] You can filter prompts by tags and sort by score, trend direction, or recency. This helps you focus on: * **Declining prompts** — Where you're losing visibility and may need to take action * **Top performers** — Where your brand is already well-represented * **New prompts** — Recently added prompts that haven't collected much data yet ## Per-Prompt Detail [#per-prompt-detail] Click on any prompt to see its full evaluation history, including: * The exact responses from each AI model * How the response changed over time * Which competitors were mentioned in the same response {/* TODO: Screenshot of a single prompt detail page */} { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } { "id": "recall-api", "bundled": { "openapi": "3.2.0", "info": { "title": "API", "description": "API for managing prompts and generating AI Share of Voice reports.", "version": "1.0.0", "contact": { "name": "API Support" } }, "servers": [ { "url": "/api/v1", "description": "API" } ], "security": [ { "BearerAuth": [] } ], "components": { "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "description": "Bearer API token for access" } }, "schemas": { "Prompt": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The actual prompt text" }, "enabled": { "type": "boolean", "description": "Whether the prompt is currently enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" }, "systemTags": { "type": "array", "items": { "type": "string" }, "description": "Auto-computed system tags (e.g., 'branded', 'unbranded'). Read-only." }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the prompt was last updated" } }, "required": [ "id", "brandId", "value", "enabled", "tags", "systemTags", "createdAt", "updatedAt" ] }, "CreatePromptRequest": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } }, "required": [ "brandId", "value" ] }, "UpdatePromptRequest": { "type": "object", "minProperties": 1, "properties": { "value": { "type": "string", "description": "The prompt text", "minLength": 1 }, "enabled": { "type": "boolean", "description": "Whether the prompt is enabled" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "User-defined tags for categorizing this prompt" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string", "description": "Error type" }, "message": { "type": "string", "description": "Detailed error message" } }, "required": [ "error" ] }, "SuccessMessage": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" }, "data": { "type": "object", "description": "Additional response data" } }, "required": [ "message" ] }, "CreateReportRequest": { "type": "object", "properties": { "brandName": { "type": "string", "description": "The brand name to analyze", "minLength": 1 }, "brandAliases": { "type": "array", "items": { "type": "string" }, "maxItems": 10, "description": "Other names the brand goes by; a mention of any of them counts as a brand mention" }, "brandWebsite": { "type": "string", "description": "The brand's website URL", "minLength": 1 }, "manualPrompts": { "type": "array", "items": { "type": "string" }, "description": "Optional list of custom prompts to include in the report" } }, "required": [ "brandName", "brandWebsite" ] }, "ReportSummary": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the report" }, "brandName": { "type": "string", "description": "Brand name analyzed" }, "brandAliases": { "type": "array", "items": { "type": "string" }, "description": "Other names the brand goes by" }, "brandWebsite": { "type": "string", "description": "Brand website URL" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ], "description": "Current report status" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the report was created" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time", "description": "Timestamp when the report completed" } }, "required": [ "id", "brandName", "brandWebsite", "status", "createdAt" ] }, "ReportPromptSnapshot": { "type": "object", "description": "Per-prompt snapshot of raw mention data from a report. Consumers compute SoV and other derived metrics.", "properties": { "promptValue": { "type": "string", "description": "The prompt text that was evaluated" }, "totalRuns": { "type": "integer", "description": "Number of evaluation runs for this prompt" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" } }, "required": [ "promptValue", "totalRuns", "mentions" ] }, "MentionsSummary": { "type": "object", "description": "Aggregated mention counts for a prompt across its evaluation runs.", "properties": { "mentionsTotal": { "type": "integer", "description": "Total brand + competitor mentions across all runs" }, "brandMentionsTotal": { "type": "integer", "description": "Number of runs where the brand was mentioned" }, "competitorMentionsTotal": { "type": "integer", "description": "Total count of individual competitor mentions across all runs (a single run mentioning 3 competitors counts as 3)" }, "mentionsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/MentionEntry" }, "description": "Top-K competitor entities ranked by mention count" } }, "required": [ "mentionsTotal", "brandMentionsTotal", "competitorMentionsTotal", "mentionsTopK" ] }, "MentionEntry": { "type": "object", "properties": { "entity": { "type": "string", "description": "Competitor entity name" }, "count": { "type": "integer", "description": "Number of runs where this entity was mentioned" } }, "required": [ "entity", "count" ] }, "CitedUrlEntry": { "type": "object", "properties": { "url": { "type": "string", "description": "The cited URL" }, "title": { "type": [ "string", "null" ], "description": "Page title if available" }, "count": { "type": "integer", "description": "Number of times this URL was cited" } }, "required": [ "url", "title", "count" ] }, "AnalyzeBrandRequest": { "type": "object", "properties": { "website": { "type": "string", "description": "Brand's website URL or hostname. Must parse to a valid domain.", "minLength": 1 }, "brandName": { "type": "string", "description": "Optional brand name hint. If omitted, inferred from the domain." }, "maxCompetitors": { "type": "integer", "description": "Maximum number of competitor suggestions. 0 disables competitor generation entirely.", "minimum": 0, "maximum": 100, "default": 20 }, "maxPrompts": { "type": "integer", "description": "Maximum number of suggested prompts. 0 disables prompt generation entirely.", "minimum": 0, "maximum": 100, "default": 30 } }, "required": [ "website" ] }, "OnboardingSuggestion": { "type": "object", "properties": { "brandName": { "type": "string" }, "website": { "type": "string", "description": "Cleaned hostname" }, "additionalDomains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name", "domains", "aliases" ] } }, "suggestedPrompts": { "type": "array", "items": { "type": "object", "properties": { "prompt": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "prompt", "tags" ] } } }, "required": [ "brandName", "website", "additionalDomains", "aliases", "competitors", "suggestedPrompts" ] }, "CreateBrandRequest": { "type": "object", "description": "Create a brand. Skips onboarding. The first entry in `domains` is treated as the brand's primary website; the rest are stored as additional domains.", "properties": { "id": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "ownerEmail": { "type": "string", "format": "email", "description": "Email of an existing user who becomes the owner of the brand's organization. Without it the brand exists but no login can reach it. Fails with 400 if no user has signed up with this address." }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "name" ] } }, "prompts": { "type": "array", "items": { "type": "object", "properties": { "value": { "type": "string", "minLength": 1 }, "tags": { "type": "array", "items": { "type": "string" } }, "enabled": { "type": "boolean", "default": true } }, "required": [ "value" ] } } }, "required": [ "id", "name", "domains" ] }, "UpdateBrandRequest": { "type": "object", "description": "Update brand-level fields. At least one field must be provided. Provided arrays replace the stored values verbatim. When `domains` is provided, the first entry becomes the primary website and the rest become additional domains. Prompts and competitors are managed via /prompts and /competitors.", "minProperties": 1, "properties": { "brandName": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" } } }, "Brand": { "type": "object", "properties": { "id": { "type": "string", "description": "User-supplied brand identifier (e.g. \"acme\")" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" }, "description": "Brand domains. The first entry is the primary website; remaining entries are additional domains." }, "aliases": { "type": "array", "items": { "type": "string" } }, "locale": { "type": [ "string", "null" ], "description": "Market the brand is measured in: a locale key such as ch-de, ch-fr, de, fr, no, dk or fi. Null or omitted uses the deployment default.", "examples": [ "ch-de" ] }, "enabled": { "type": "boolean" }, "onboarded": { "type": "boolean" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "domains", "aliases", "enabled", "onboarded", "createdAt", "updatedAt" ] }, "BrandsList": { "type": "object", "properties": { "brands": { "type": "array", "items": { "$ref": "#/components/schemas/Brand" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "brands", "pagination" ] }, "Competitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "brandId": { "type": "string" }, "name": { "type": "string" }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "brandId", "name", "domains", "aliases", "createdAt", "updatedAt" ] }, "CompetitorsList": { "type": "object", "properties": { "competitors": { "type": "array", "items": { "$ref": "#/components/schemas/Competitor" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } }, "required": [ "page", "limit", "total", "totalPages" ] } }, "required": [ "competitors", "pagination" ] }, "CreateCompetitorRequest": { "type": "object", "description": "Add a competitor to a brand.", "properties": { "brandId": { "type": "string", "minLength": 1 }, "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } }, "required": [ "brandId", "name" ] }, "UpdateCompetitorRequest": { "type": "object", "description": "Update a competitor. At least one field must be provided. Provided arrays replace the stored values verbatim.", "minProperties": 1, "properties": { "name": { "type": "string", "minLength": 1 }, "domains": { "type": "array", "items": { "type": "string" } }, "aliases": { "type": "array", "items": { "type": "string" } } } }, "PromptSnapshot": { "type": "object", "properties": { "brandId": { "type": "string", "description": "Brand identifier this prompt belongs to" }, "promptId": { "type": "string", "format": "uuid", "description": "Unique identifier for the prompt" }, "promptValue": { "type": "string", "description": "The prompt text" }, "startDate": { "type": "string", "format": "date", "description": "Start of the queried date range (YYYY-MM-DD)" }, "endDate": { "type": "string", "format": "date", "description": "End of the queried date range (YYYY-MM-DD)" }, "mentions": { "$ref": "#/components/schemas/MentionsSummary" }, "citations": { "type": "object", "properties": { "citationsTotal": { "type": "integer", "description": "Total number of citations across all runs" }, "brandCitationsTotal": { "type": "integer", "description": "Number of citations to brand-owned domains" }, "competitorCitationsTotal": { "type": "integer", "description": "Number of citations to competitor-owned domains" }, "citedUrlsTopK": { "type": "array", "items": { "$ref": "#/components/schemas/CitedUrlEntry" }, "description": "Top-K cited URLs ranked by frequency" } }, "required": [ "citationsTotal", "brandCitationsTotal", "competitorCitationsTotal", "citedUrlsTopK" ] } }, "required": [ "brandId", "promptId", "promptValue", "startDate", "endDate", "mentions", "citations" ] } }, "responses": { "UnauthorizedError": { "description": "Authentication required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFoundError": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ValidationError": { "description": "Invalid request data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "ConflictError": { "description": "Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "paths": { "/tools/analyze": { "post": { "summary": "Analyze a website", "description": "Run brand analysis without persisting anything. Returns suggested additional domains, aliases, competitors, and prompts.", "operationId": "analyzeBrand", "tags": [ "Tools" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnalyzeBrandRequest" } } } }, "responses": { "200": { "description": "Brand analysis suggestion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardingSuggestion" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands": { "get": { "summary": "List brands", "operationId": "listBrands", "tags": [ "Brands" ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of brands", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BrandsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a brand", "operationId": "createBrand", "tags": [ "Brands" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBrandRequest" } } } }, "responses": { "201": { "description": "Brand created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/brands/{brandId}": { "get": { "summary": "Get a brand", "operationId": "getBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "Brand", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a brand", "operationId": "updateBrand", "tags": [ "Brands" ], "parameters": [ { "name": "brandId", "in": "path", "required": true, "description": "Brand identifier", "schema": { "type": "string", "minLength": 1 } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateBrandRequest" } } } }, "responses": { "200": { "description": "Brand updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Brand" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors": { "get": { "summary": "List competitors", "operationId": "listCompetitors", "tags": [ "Competitors" ], "parameters": [ { "name": "brandId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of competitors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompetitorsList" } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Add a competitor", "operationId": "createCompetitor", "tags": [ "Competitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCompetitorRequest" } } } }, "responses": { "201": { "description": "Competitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/competitors/{competitorId}": { "get": { "summary": "Get a competitor", "operationId": "getCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a competitor", "operationId": "updateCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCompetitorRequest" } } } }, "responses": { "200": { "description": "Competitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a competitor", "operationId": "deleteCompetitor", "tags": [ "Competitors" ], "parameters": [ { "name": "competitorId", "in": "path", "required": true, "description": "Competitor identifier (UUID)", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Competitor deleted (returns the deleted competitor)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Competitor" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts": { "get": { "summary": "List all prompts", "description": "Retrieve a paginated list of all prompts across all brands", "operationId": "listPrompts", "tags": [ "Prompts" ], "parameters": [ { "name": "brandId", "in": "query", "description": "Filter prompts by brand ID", "required": false, "schema": { "type": "string" } }, { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "List of prompts", "content": { "application/json": { "schema": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/Prompt" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "post": { "summary": "Create a new prompt", "description": "Create a new prompt for a brand. This will automatically schedule the prompt for execution.", "operationId": "createPrompt", "tags": [ "Prompts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatePromptRequest" } } } }, "responses": { "201": { "description": "Prompt created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}/snapshot": { "get": { "summary": "Get prompt snapshot", "description": "Get an aggregated snapshot of mention and citation analytics for a specific prompt over a date range. Use this to identify competitive gaps, track brand visibility trends, and discover top cited URLs.", "operationId": "getPromptSnapshot", "tags": [ "Snapshots" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-08" } } }, { "name": "endDate", "in": "query", "required": true, "description": "End of date range (YYYY-MM-DD)", "schema": { "type": "string", "format": "date" }, "examples": { "default": { "value": "2026-01-15" } } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } }, { "name": "kCitations", "in": "query", "required": false, "description": "Number of top cited URLs to return in citedUrlsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 } } ], "responses": { "200": { "description": "Prompt snapshot with mention and citation analytics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PromptSnapshot" }, "examples": { "default": { "value": { "brandId": "brand_nike", "promptId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "promptValue": "best running shoes for marathon training", "startDate": "2026-01-08", "endDate": "2026-01-15", "mentions": { "mentionsTotal": 210, "brandMentionsTotal": 42, "competitorMentionsTotal": 130, "mentionsTopK": [ { "entity": "Adidas", "count": 58 }, { "entity": "New Balance", "count": 45 }, { "entity": "ASICS", "count": 27 } ] }, "citations": { "citationsTotal": 1240, "brandCitationsTotal": 85, "competitorCitationsTotal": 620, "citedUrlsTopK": [ { "url": "https://www.runnersworld.com/gear/best-running-shoes/", "title": "Best Running Shoes 2026", "count": 72 }, { "url": "https://www.nike.com/running/marathon", "title": "Nike Marathon Collection", "count": 34 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/prompts/{promptId}": { "get": { "summary": "Get a prompt", "description": "Retrieve a specific prompt by ID", "operationId": "getPrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "patch": { "summary": "Update a prompt", "description": "Update a prompt's properties. Only provided fields will be updated. Toggling `enabled` schedules or unschedules the recurring run job.", "operationId": "updatePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to update", "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdatePromptRequest" } } } }, "responses": { "200": { "description": "Prompt updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Prompt" } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "delete": { "summary": "Delete a prompt", "description": "Permanently delete a prompt and cancel all related scheduled jobs. This will also cascade delete all associated prompt runs.", "operationId": "deletePrompt", "tags": [ "Prompts" ], "parameters": [ { "name": "promptId", "in": "path", "required": true, "description": "The ID of the prompt to delete", "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Prompt deleted (returns the deleted prompt)", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/Prompt" }, { "type": "object", "properties": { "deletedRunsCount": { "type": "integer", "description": "Number of related prompt_runs rows deleted by the cascade." } }, "required": [ "deletedRunsCount" ] } ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports": { "post": { "summary": "Create a report", "description": "Create a new AI Share of Voice report and queue it for generation. The report will evaluate the brand across multiple AI engines (ChatGPT, Claude, Google AI) using generated and optional custom prompts.", "operationId": "createReport", "tags": [ "Reports" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateReportRequest" } } } }, "responses": { "201": { "description": "Report created and queued for generation", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid", "description": "Unique identifier for the created report" }, "status": { "type": "string", "enum": [ "pending" ], "description": "Initial report status" }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } }, "get": { "summary": "List reports", "description": "Retrieve a paginated list of all reports, ordered by creation date (newest first).", "operationId": "listReports", "tags": [ "Reports" ], "parameters": [ { "name": "page", "in": "query", "description": "Page number for pagination (1-based)", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "limit", "in": "query", "description": "Number of items per page", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Paginated list of reports", "content": { "application/json": { "schema": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/ReportSummary" } }, "pagination": { "type": "object", "properties": { "page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "totalPages": { "type": "integer" } } } } } } } }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/reports/{reportId}": { "get": { "summary": "Get report status and data", "description": "Poll a report's status. When completed, returns per-prompt snapshot data with raw mention counts. Consumers are responsible for computing SoV and other derived metrics from the raw data.", "operationId": "getReport", "tags": [ "Reports" ], "parameters": [ { "name": "reportId", "in": "path", "required": true, "description": "The ID of the report", "schema": { "type": "string", "format": "uuid" } }, { "name": "kMentions", "in": "query", "required": false, "description": "Number of top competitor entities to return in each prompt's mentionsTopK", "schema": { "type": "integer", "minimum": 1, "maximum": 50, "default": 5 } } ], "responses": { "200": { "description": "Report status and data. When status is 'completed', includes per-prompt snapshot data with raw mention counts.", "content": { "application/json": { "schema": { "type": "object", "properties": { "reportId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "pending", "processing", "completed", "failed" ] }, "progress": { "type": "integer", "description": "Generation progress percentage (0-100). Available while processing." }, "brandName": { "type": "string" }, "brandAliases": { "type": "array", "items": { "type": "string" } }, "brandWebsite": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "completedAt": { "type": [ "string", "null" ], "format": "date-time" }, "prompts": { "type": "array", "items": { "$ref": "#/components/schemas/ReportPromptSnapshot" }, "description": "Per-prompt snapshot data. Only present when status is 'completed'." }, "unstable": { "type": "object", "description": "Derived stats (SoV, visibility, etc.). Format may change between versions. Only present when status is 'completed'.", "properties": { "sov": { "type": [ "number", "null" ], "minimum": 0, "maximum": 1, "description": "Overall share of voice (0-1): brand_mentions / (brand_mentions + competitor_mentions). Null when no mentions at all." }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Brand visibility (0-1): brand_mentions / total_prompt_runs (how often the brand appears at all across all prompt runs)" }, "totalPrompts": { "type": "integer", "description": "Total number of prompts evaluated" }, "totalPromptRuns": { "type": "integer", "description": "Total number of prompt runs across all prompts (each prompt is executed multiple times across different AI engines)" }, "promptsWithBrandMentions": { "type": "integer", "description": "Number of prompts where the brand was mentioned in at least one prompt run" }, "promptRunsWithBrandMentions": { "type": "integer", "description": "Number of individual prompt runs where the brand was mentioned" }, "competitors": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Competitor name" }, "sov": { "type": "number", "minimum": 0, "maximum": 1, "description": "Share of voice (0-1): this competitor's mentions / total mentions (brand + all competitors)" }, "visibility": { "type": "number", "minimum": 0, "maximum": 1, "description": "Visibility (0-1): prompt runs mentioning this competitor / total prompt runs" }, "promptsWithMentions": { "type": "integer", "description": "Number of prompts where this competitor was mentioned in at least one run" }, "promptRunsWithMentions": { "type": "integer", "description": "Number of individual prompt runs where this competitor was mentioned" } }, "required": [ "name", "sov", "visibility", "promptsWithMentions", "promptRunsWithMentions" ] }, "description": "Per-competitor SoV breakdown, sorted by SoV descending" } } } }, "required": [ "reportId", "status", "brandName", "brandWebsite", "createdAt" ] }, "examples": { "default": { "value": { "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "completed", "brandName": "Acme Corp", "brandWebsite": "acme.com", "createdAt": "2026-04-08T10:00:00Z", "completedAt": "2026-04-08T10:05:00Z", "prompts": [ { "promptValue": "best project management tools", "totalRuns": 4, "mentions": { "mentionsTotal": 7, "brandMentionsTotal": 3, "competitorMentionsTotal": 4, "mentionsTopK": [ { "entity": "Competitor A", "count": 2 }, { "entity": "Competitor B", "count": 2 } ] } } ], "unstable": { "sov": 0.42, "visibility": 0.6, "totalPrompts": 70, "totalPromptRuns": 280, "promptsWithBrandMentions": 28, "promptRunsWithBrandMentions": 168, "competitors": [ { "name": "Competitor A", "sov": 0.35, "visibility": 0.35, "promptsWithMentions": 45, "promptRunsWithMentions": 98 }, { "name": "Competitor B", "sov": 0.15, "visibility": 0.15, "promptsWithMentions": 20, "promptRunsWithMentions": 42 } ] } } } } } } }, "400": { "$ref": "#/components/responses/ValidationError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "tags": [ { "name": "Brands", "description": "Manage brand records" }, { "name": "Tools", "description": "One-shot helpers (e.g. brand analysis) that don't persist anything" }, { "name": "Prompts", "description": "Manage brand prompts" }, { "name": "Competitors", "description": "Manage brand competitors" }, { "name": "Snapshots", "description": "Aggregated analytics snapshots for prompts" }, { "name": "Reports", "description": "Generate and retrieve AI Share of Voice reports" } ] } } # Changelog (https://dorecall.com/changelog) User-facing changes to Recall, published weekly. RSS: https://dorecall.com/changelog/rss.xml ## [2 October 2026](https://dorecall.com/changelog/2026-10-02.md) ### Measurement - Market starter packs now load German or French buyer questions for brands measured in a German- or French-speaking market, instead of English. - A probe the data provider failed to scrape is now recorded as an error rather than as an answer that named no one, and an engine that is down no longer holds up every other brand's measurements. - Perplexity answers collected through Oxylabs are read in full again, and a capture that holds only the question is recorded as a failed probe rather than as an answer. ### Reports - Generated deliverables can no longer assert a statistic, customer count, testimonial, case study, award or certification that appears in neither the website snapshot nor an approved fact — the report is regenerated instead. - The pilot deliverable can now be generated: a read-only endpoint assembles a brand's measured questions, absence diagnosis, citation targets and per-engine sample into the Markdown report, and the report states what each engine actually contributed rather than blending them. - The baseline report can be saved as a PDF on US Letter with the application chrome stripped, keeping Markdown as a secondary option. - The baseline report now has its own screen in primary navigation, rendered in the browser as well as downloadable, instead of a button at the bottom of the evidence workspace. - Tables in the baseline report now render, instead of appearing as raw pipe characters. ### Free audit - Fetching a page larger than the audit's size cap no longer exits the process — the response body is buffered to the cap rather than streamed through a web-stream adapter, and an oversized page is truncated instead of refused. ### Briefings and alerts - Teams can ask "why are we missing ?" and send Recall facts from a Telegram chat or by replying to a briefing email. Answers come from the brand's measured data, and facts wait for approval in the dashboard before anything can cite them. ### Dashboard - The visibility page now shows how many answers each engine actually returned, flagging any engine whose sample is far smaller than the others, and the evidence workspace can download the baseline report as Markdown. - A tab left open across a deploy now reloads itself instead of showing an error boundary when it asks for a code chunk the new build replaced. ### Website - A public /benchmarks page publishes the recorded category runs — which brands AI answer engines name, with Wilson score intervals, sample sizes and the sources cited — and the dataset now lives in shared config so the marketing site and the dashboard quote the same numbers. - The blog now has German, French and Polish editions at /blog/de, /blog/fr and /blog/pl, and every post is fact-checked and read by a native speaker before it can be published. ## [25 September 2026](https://dorecall.com/changelog/2026-09-25.md) ### Measurement - Brands whose name is an ordinary word now need context in the answer before a mention counts, instead of matching any sentence that happens to use the word. - Question packs now carry a tier: procurement-led markets ask what engines assert about a brand rather than where it ranks, and a baby and parenting gear pack joins the shortlist tier. ### Recommendations - Adds IndexNow submission and key-file verification, so a shipped page can be re-read by search engines in minutes rather than waiting for the next crawl. - Opportunity generation works against OpenAI, whose strict structured outputs rejected the report schema outright. ### Dashboard - Brand creation through the API can name an owner, shipped changes are submitted to IndexNow once a brand has published its key file, and the settings page shows the one-time setup for it. ### Website - The Shortlist Pilot is now €1,000. - Adds a public methodology page documenting how the measurement works, including the full result of running it against our own brand. ## [18 September 2026](https://dorecall.com/changelog/2026-09-18.md) ### Measurement - Add answer-position and evidence-backed brand-framing analysis, with exact source excerpts, links to stored AI responses, and a spreadsheet-safe CSV export. Add review-before-save starter prompt packs for eight technical industries. - Connect AI visibility to first-party sessions, conversions, revenue, and directional before-and-after evidence for shipped opportunities. - Google AI Overviews and AI Mode are now counted as their own answer-engine surfaces instead of standing in for the Gemini assistant, so engine coverage reports what was actually probed. - Follow-up measurement now waits as long as the kind of change needs: an earned third-party placement is read months after shipping rather than on the seven-day timetable used for a change to your own site. - Added probe locales for the United Kingdom, Germany, France, Spain, Italy, the Netherlands, and Sweden, and shared statistics formatting no longer defaults to Polish. - Tracked actions now show the smallest change their sample size could actually call a verdict on, so an under-powered scope is visible before it returns "inconclusive". - The peer set is now versioned and carries provenance, so competitors the engines start naming can be reviewed before they change what share of voice means, and tenant isolation now covers the scope and peer-set tables. - Before-and-after comparisons now split on the engine build that actually answered, so a provider shipping a new model behind the same name reads as not-comparable instead of being reported as a lift or decline the change never caused. - Competitors the engines start naming are now proposed for review instead of joining the measurement silently, every run records which approved peer set it was measured against, and only approved peers count toward share of voice. - Cited evidence is now captured and rechecked, so a page that was rewritten or deleted is reported as such and still shows what it said when it was cited, instead of leaving a link that silently stopped backing the claim. - Rechecking cited evidence and reading a customer's sitemap now go through the hardened public-web fetcher, so a URL supplied by an answer engine cannot aim a request at the network the worker runs in. - Funding rounds, launches, market entries, rebrands, and quarterly reviews can now be monitored on their own temporary question scope, with a baseline taken from before the event and a review date paced to how that kind of change actually reaches an engine. - BrightData probes now send the country as an uppercase ISO code, which its dataset collectors require — a lowercase one was rejected outright, so every probe configured with a locale failed. ### Recommendations - Recommendations now say why a brand is missing from an answer — unreachable, absent from the retrieved corpus, unresolved as an entity, or dropped during synthesis — and the suggested fix matches that cause instead of defaulting to on-site work. - A brand the engines rarely name now gets a ranked list of the independent sources that actually decide those answers, ordered by how many tracked questions each one shapes, instead of a report confirming it is invisible. - The audit now reports facts a brand states two different ways on its own pages, with both values and both URLs, so the disagreement engines already read can be settled and recorded. - Outreach actions can now be followed from the target through to the published placement, and cannot be marked shipped until that placement exists — so the follow-up measurement never reads the engines for a pitch that was never published. - Outreach recommendations can now carry who to approach at a source and whether somebody is currently editing it, so a named target comes with a route in and a reason to act this week rather than eventually. - Recall now generates the machine-readable pages a brand publishes for AI assistants — an llms.txt index, FAQ structured data, and self-contained answers — built only from facts the customer has approved, with any unanswerable question reported rather than hedged. - Opportunities now take this brand's own history into account: work that is shipped and awaiting its verdict is not proposed again while the measurement window is open, a category the customer dismissed is not revived, one that was measured without separating the answers gives way to a different approach, and one that measurably improved is preferred. ### Reports - Reports now name the specific facts a brand has not published, ranked by how many tracked questions each one would unblock, instead of asking for materials in general. - Deliverables can now be grounded in facts the customer has approved, not only in whatever the homepage happens to say, without loosening the rule against inventing claims. - Reports now say how to fix each cause they find, in the order the causes have to be worked, and name the work that cannot help — so a diagnosis arrives with a method rather than only a verdict. - The pilot report now carries the claim conflicts, unapproved peers, and publishable files the product had started producing, so a hand-delivered pilot benefits from them rather than only the dashboard. - Pilot customers now get a weekly progress note while the measurement runs — coverage so far, any engine in trouble, and findings that do not depend on sample size — without publishing a visibility rate before the sweep is complete. ### Free audit - Fixed the public-web fetcher, whose address pinning answered DNS in one shape while some Node versions ask for the other — breaking the free audit entirely on those runtimes. Adds a pre-sales diagnostic that answers whether a brand's own site is why engines do not recommend it, using no database, deployment, or API keys. - The free audit now reports whether an engine can read and identify a company from its own page — text without JavaScript, structured data, identity links and published pages — which applies to every market, and says plainly when the site is not the problem. - The free audit now runs for any company rather than Web3 projects only: crawler access and the lookalike-domain sweep apply to every market and need no industry at all, the crypto listings check appears only where a source covers it, and every industry page links to the audit. - The free audit no longer reads as a crypto tool to everyone else: the form asks for a company rather than a project, the recorded benchmark is labelled as one category's real run rather than presented as the illustration, and the page announces whatever name the deployment is branded with. - The lookalike-domain sweep now reports that a domain resolves, rather than claiming content is served there, which is all a DNS lookup establishes. - The audit page's recorded measurement now shows a vector-database run for general visitors and the DEX run only when a Web3 industry is selected, and each is stamped with the measurement version that produced it. ### Briefings and alerts - Immediate alerts are now limited to the findings worth an interruption — a lost shortlist place, monitoring that stopped, or a decision Recall is waiting on — with per-recipient delivery preferences, one-click unsubscribe, and no weekly email in a week where nothing happened. - Briefings now carry a signed reply-to address, so a plain reply can be attributed to the brand and recipient it was sent to — the groundwork for answering Recall by email instead of in the dashboard. - Briefings now respect per-recipient email preferences and carry a working unsubscribe link, so one person opting out no longer silences the channel for the rest of their team. - Replying to a Recall briefing now captures the facts you state as candidates for the approved fact base, behind provider-signature, thread-token, sender and membership checks, and still requiring a named person to approve before any deliverable can use them. - A reply can now approve, defer, or mark an action shipped, recognised only as an explicit command on a thread about a single action, and applied through the same rules the dashboard enforces. ### Dashboard - Complete Recall's answer-engine intelligence path: support category-neutral onboarding and measurement, add an optional Web3 pack and public audit, generate grounded implementation assets, track shipped fixes with before/after evidence, and expose production engine-readiness diagnostics. - Rebrand the product as Recall, add new market packs, and introduce a decision-first Briefing, Actions, and Evidence workflow. - Pilot customers now get their own workspace — the screens their four weeks actually use, their own landing page instead of an empty weekly briefing, and one plain statement of what a subscription adds. ### Sign-in - Customers can sign in with a one-time code sent to their email, so a business client needs neither a password nor permission to grant a third party Google access. - The sign-in and register pages now offer Google only when Google credentials are actually configured, instead of whenever the deployment runs in cloud mode, so a cloud instance without them no longer shows a button that leads to an error. - Cloud sign-in is now a one-time code sent by email, with no password anywhere: signing in with a new address creates the account, and the password endpoints are switched off rather than merely hidden. ### Website - The Web3 industry page now links its free audit, which was live and reachable but had nothing on the marketing site pointing at it. - The homepage now declares verified sameAs profiles, so an AI engine can confirm which company the site belongs to. ### Docs - Provider cost estimates now match the cadence the worker actually runs, so the monthly figure in the docs no longer understates what tracking a prompt costs, and each scraper is priced from the same per-probe table the spend caps are enforced against.