# LLM Pulse API: llms-full.txt Last generated: 2026-11-08 Full machine-readable reference for the LLM Pulse REST API + MCP integration. Generated from the same canonical source the support agent reads, so it stays in sync with the live service. ## Where to find more - Short index (this doc's sibling): https://api.llmpulse.ai/api-docs/llms.txt - OpenAPI 3.0 spec: https://api.llmpulse.ai/openapi.json - Swagger 2.0 spec: https://api.llmpulse.ai/swagger.json - Postman collection: https://api.llmpulse.ai/LLMPulse_API_v1.postman_collection.json - Human-readable docs (in-app, with playground): https://api.llmpulse.ai/api-docs - Native Rust CLI (macOS, Linux, Windows): npm install -g @llmpulse/cli (https://www.npmjs.com/package/@llmpulse/cli), or archives at https://github.com/LLM-Pulse/llmpulse-cli/releases - Official SDKs (12 languages): https://github.com/orgs/LLM-Pulse/repositories?q=llmpulse- (TypeScript: npm install @llmpulse/sdk) - MCP endpoint: POST https://api.llmpulse.ai/api/v1/mcp (same Bearer token) ## Authentication & conventions See the "Authentication" and "Conventions" sections of llms.txt for auth, rate limits, pagination, date handling, metric aliases, and error codes. The body below is the complete endpoint reference. --- # LLM Pulse API - Complete Endpoint Reference ## How this reference is organized One section per resource, each listing that resource's full lifecycle (list, detail, then writes). Each resource below has its own documentation page, at https://llmpulse.ai/api-docs/ (for example https://llmpulse.ai/api-docs/metrics). Base URL: `https://api.llmpulse.ai/api/v1`. Every request needs `Authorization: Bearer `, and a key works only while its account is on the Scale plan or above. ## Write access and scopes Every mutation in this reference (POST, PATCH, PUT, DELETE) requires an API key with the `read_write` scope. A token with the `read` scope receives `403 ERR_INSUFFICIENT_SCOPE`. Mutations also have their own rate limit (see Rate limits). A key can also be limited to one or several projects when it is created; the set never changes. Such a key sees only those projects: any other project id, domain or name answers `ERR_PROJECT_NOT_FOUND` exactly like a project that does not exist, listings return only those projects' rows, and creating or deleting a project, or creating a project draft, answers `403 ERR_KEY_PROJECT_SCOPED` (full list in Errors). Deleting a project removes it from the key, and a key left with no project is revoked. ## Rate limits Two budgets apply per API key, both on a one-minute window: | Budget | Limit | Applies to | | --- | --- | --- | | Global | 300 requests/minute | Every `/api/v1` request, including MCP calls | | Writes | 60 requests/minute | `POST`, `PATCH`, `PUT` and `DELETE` on `/api/v1/*`, except the MCP endpoint and `POST /api/v1/web_analytics/query`, which only reads | Every response carries the remaining global budget, so a client can pace itself instead of discovering the ceiling by hitting it: | Header | Meaning | | --- | --- | | `X-RateLimit-Limit` | Requests allowed in the current window | | `X-RateLimit-Remaining` | Requests still available in it | | `X-RateLimit-Reset` | Unix timestamp when the window resets | Exceeding either budget returns `429 ERR_RATE_LIMITED` with a `Retry-After` header (seconds). Only a 429 from the global budget also carries the three headers above; the write budget has no headers of its own. Rate limits are per key, so splitting a backfill across several keys multiplies the budget. `GET /api/v1/account` reports the limits that apply to your account. ## Errors Every error uses one envelope: ```json { "error": { "code": "ERR_INVALID_PARAM", "message": "range must be a positive integer", "meta": { "message": "range must be a positive integer" } }, "request_id": "uuid" } ``` - `error.code` is the stable, machine-readable field. Branch on it, never on the message text. - `error.message` contains error details when available; otherwise, it contains a default token such as `missing_authorization`. When details are provided under `error.meta.message`, they also appear in `error.message`. The `meta` object is unchanged and may contain other fields, such as a budget reset time. A not-connected or access-revoked error from the Search Console, AI traffic, web analytics, agent traffic or WordPress endpoints carries `meta.connect_url`, the page where the user connects or reconnects the source (MCP tools return it as `connect_url`). - `request_id` identifies the request when contacting support. - `ERR_LIMIT_REACHED` (422) covers the project, prompt-slot, technical GEO report and recommendation budgets; `ERR_QUOTA_EXCEEDED` (422) covers the competitor, GEO Writer task and webhook subscription caps, and the daily limits of the `ask_support` and `send_feedback` MCP tools. The message says which one was hit. - `ERR_PLAN_REQUIRED` (403) also answers API-key requests (REST and `/mcp`) while the account is below Scale, for example after a downgrade, except `GET /webhooks`, `DELETE /webhooks/:id`, `GET /api_keys` and `DELETE /api_keys/:id`. The key is not revoked and works again back on Scale or above. MCP over OAuth is not affected. - `ERR_ACCOUNT_INACTIVE` (403) answers every REST and MCP request (OAuth included), and embeds show a neutral page, from three days after the subscription ends, when there never was one, or while the account is paused for an unpaid renewal; invoice-billed accounts are exempt. Paid work (prompt runs, GEO Writer, reports, audits, `ask_support`) stops at the end date or the pause. - `ERR_INTEGRATION_UNAVAILABLE` (403) answers the Store Integrations endpoints for accounts with a white-label portal or an embed, the WordPress endpoints on a white-label portal host, and the MCP tools a white-label portal does not offer. - `ERR_KEY_PROJECT_SCOPED` (403) answers a key limited to some projects on an operation that acts on the whole account: `POST /projects`, `DELETE /projects/:id`, the `/project_drafts` endpoints, the Team and API Keys endpoints and a `prompt_limit` or `pitch` change on `PATCH /projects/:id`. - `ERR_GENERATION_FAILED` (502) means an AI generation failed, or the `ask_support` MCP tool could not answer; retry the request. - `ERR_INVALID_RANGE` (422) is only emitted by the Search Console endpoints when `from` is after `to`; every other window problem is `ERR_INVALID_PARAM`. ## Output formats (`output` parameter) Most read endpoints return nested JSON: metrics are grouped by metric, then by actor, then by data point. That shape is convenient for code but business intelligence tools cannot walk it. The optional `output` parameter returns the same data as a rectangular table instead. | `output` | Response | | --- | --- | | omitted (default) | The nested JSON documented for each endpoint below. Unchanged. | | `flat` | The same metadata plus `columns` (ordered column names), `rows` (one flat object per row) and `row_count`. | | `csv` | Those same rows as `text/csv`, with `columns` as the header row. | This is what Tableau, Excel, Google Sheets and warehouse loaders should use. Notes: - The default is unchanged, so existing integrations are unaffected. Only requests that pass `output` behave differently. - Errors are always returned as JSON, never as CSV, so a failure is never mistaken for data. - Percentages stay on the raw 0-100 scale, exactly as in the JSON response. - Nested values inside a row (for example `matching_names`) are JSON-encoded into a single cell. - Text cells that begin with `=`, `+`, `-`, `@`, a tab or a carriage return are prefixed with an apostrophe so spreadsheets do not execute them as formulas. - CSV has no envelope for paging metadata, so paginated endpoints also return it in the `X-Total-Count`, `X-Page` and `X-Per-Page` response headers. - Flat output is capped at 200,000 rows. Above that the request returns `ERR_INVALID_PARAM`: narrow the date range, request fewer metrics, or use `granularity=week`. - `/metrics/timeseries`, `/metrics/summary` and `/metrics/sov` have a fixed column set, so they return the header row even when the period has no data. The other endpoints derive their columns from the rows themselves, so an empty result returns an empty body with no header. If a BI tool needs a stable schema from those, point it at a date range that has data. ### Columns by endpoint | Endpoint | Columns | | --- | --- | | `/metrics/timeseries` | `date, actor_type, actor_id, actor_name, actor_domain, metric, value` | | `/metrics/summary` | `actor_type, actor_id, actor_name, actor_domain, metric, aggregation, total, min, max, last` | | `/metrics/sov` | `date, actor_type, actor_id, actor_name, actor_domain, share` | | `/metrics/sov?view=current` | `actor_type, actor_id, actor_name, actor_domain, share` | | `/metrics/sov?view=breakdown` | `rank, actor_type, actor_id, actor_name, actor_domain, share, others` | | `/metrics/prompt_summary`, `/metrics/top_sources`, every `/search_console/*` read but `summary` and `brand_split`, `/custom_reports`, `/reports/sentiment/topics`, `/reports/sentiment/tags`, `/competitors/suggestions` and the list-returning `/dimensions/*` (`projects`, `competitors`, `collections`, `tags`, `sentiments`, `prompts`, `prompt_executions`, `sources`, `mentions`, `citations`, `competitor_mentions`, `competitor_citations`, `all_mentions`, `all_citations`, `agent_bots`) | The keys of the endpoint's own `data` rows | `/metrics/sov` accepts an extra `view` parameter (`over_time` by default, plus `current` and `breakdown`) because its JSON payload carries several different shapes and a table can only hold one at a time. `view` is only valid together with `output`. The MCP tool `get_sov` takes the same `view` names with the same meaning and returns that representation as JSON (see `GET /api/v1/metrics/sov`). Only the endpoints in that table support `output`. Endpoints without a flat projection reject `output` with `ERR_INVALID_PARAM` rather than silently ignoring it. Those are the ones whose payload is not one table: `/metrics/agent_traffic`, `/metrics/ai_traffic`, `/search_console/summary` and `/brand_split`, `/dimensions/models`, `/dimensions/locales`, and the single-record `/dimensions/projects/{id}`, `/dimensions/competitors/{id}` and `/custom_reports/{id}`. `/metrics/summary` omits `position_distribution` from flat output because it is a single record rather than a table; read it from the JSON response. Example: ``` GET /api/v1/metrics/timeseries?project_id=1&range=30&metrics=mentions,visibility&output=csv ``` ```csv date,actor_type,actor_id,actor_name,actor_domain,metric,value 2025-01-01,project,1,My Brand,mybrand.com,mentions,10 2025-01-01,competitor,2,Competitor A,competitor.com,mentions,5 ``` ## Date windows (`from` and `to`) Date windows are endpoint-specific. `/metrics/timeseries`, `/metrics/summary`, `/answers`, and `/sentiments` accept ISO 8601 dates or timestamps. A date-only `to` includes the entire day in `Europe/Madrid`; a full timestamp keeps its exact time. The `/metrics/timeseries`, `/metrics/summary`, date-taking dimensions, citation intelligence, and AI Model Insights endpoints reject reversed windows and windows longer than 1,500 days with `ERR_INVALID_PARAM`. `/metrics/agent_traffic` and `/metrics/ai_traffic` resolve calendar-day bounds and clamp oversized windows to 1,500 days, but reject a `range` below 1 and a `from` later than `to` with `ERR_INVALID_PARAM`. ## Multi-value analytics filters Where an endpoint already exposes them, `collection_id`, `country_code`, `language_code`, and `prompt_type` accept either one value or a comma-separated list. `GET /sentiments` also accepts one or more `analysis` values. Values inside the same parameter are combined with OR, while different parameters are combined with AND. For example, `country_code=ES,FR&language_code=es,fr` returns rows in either country whose language is either Spanish or French. A request such as `collection_id=12` keeps its existing behavior. Endpoints that expose the separate `collection_ids` array continue to support it as documented. The matching MCP tools accept the same scalar or comma-separated string, and flat or CSV output keeps the full filter selection. ## AI model filter (`model`) `model` takes one model key, such as `chatgpt` or `gemini`, enabled for the API key's user. A value that is not a model, or a model the user has not enabled, returns `ERR_INVALID_PARAM` (422) with the valid values in the message, rather than unfiltered data. These endpoints follow their own rule: - `GET /sentiments` ignores such a value and returns every enabled model, as if `model` were omitted. - `GET /citation_intelligence/groups`, `GET /citation_intelligence/mentions_by_domain`, `GET /citation_intelligence/urls/:url_sha256` and `GET /citation_intelligence/urls/:url_sha256/occurrences` accept only `chatgpt`, `ai_mode`, `ai_overview`, `perplexity`, `gemini`, `naver_ai`, `baidu_ai`, `naver_ai_tab`, `qwen` and `doubao`, and of those only a model enabled for the user. Any other model returns `ERR_INVALID_PARAM`, even when it is enabled. - `GET /reports/ai_model_insights/position_distribution` accepts only those same ten models, whether or not the model is enabled for the user. Any other model returns `ERR_INVALID_PARAM`. - `GET /metrics/timeseries`, `/metrics/summary`, `/metrics/prompt_summary`, `/metrics/sov` and `/metrics/top_sources` also accept the legacy values `google-ai-mode` and `google-ai-overview`, as `ai_mode` and `ai_overview`. ## Links into the app (`app_url`) Rows that describe one answer, prompt or Technical GEO report carry `app_url`, the link that opens that record in the LLM Pulse app. Cite it in a report so a reader can check where each number comes from. | Endpoint | `app_url` opens | | --- | --- | | `GET /answers`, `GET /answers/:id`, `GET /dimensions/prompt_executions` | The answer page: `/app/prompts//prompt_executions/` (`answer_id` is the prompt execution ID) | | `GET /dimensions/prompts`, `GET /metrics/prompt_summary` | The prompt page: `/app/prompts/` | | `GET /technical_geo_reports`, `GET /technical_geo_reports/:id`, `PATCH /technical_geo_reports/:id/content`, `POST /technical_geo_reports/:id/revert_content` | The report page: `/app/tools/_reports/` (an opaque app token, not the numeric API report `id` used for polling) | | `POST /technical_geo_reports` | Returned as `app_urls`: one link per created report, keyed by report type | - Every link ends in `?project_id=`. Opening it switches the app to that project for any user with access to it, whichever project they had selected. For anyone else the parameter is ignored: they stay on their own project and learn nothing about the one in the link. - The link uses the host the account is reached on: a white-label portal's own domain when the API is called on that portal, `https://llmpulse.ai` everywhere else (the API host does not serve the app). - With `output=flat` or `output=csv`, `app_url` is one more column. - The MCP tools return the same links. The aggregate metric tools also add one link per response, to the matching app page. ## Health Cheapest call in the API: verify that a key works, measure round-trip latency, and optionally assert access to a project. ### GET /api/v1/ping Health check. Validates API key and optionally checks project access. **Parameters:** `project_id` (optional). With it, the response adds `project` with `id`, `name` and `brand_name` (null when not set), like `GET /dimensions/projects`. **Response:** ```json { "ok": true, "user_id": 123, "project": { "id": 1, "name": "My Brand", "brand_name": "Acme" }, "request_id": "uuid" } ``` --- ## Account Plan, subscription window, quota consumption and the published rate limits for the authenticated account. Read it before spending quota, so an integration can report what is left instead of discovering the ceiling by hitting it. ### GET /api/v1/account Account plan, quota usage and rate limits. No parameters. Limits resolve through the account owner, so a team member sees the capacity that actually applies to them. An unlimited quota returns `limit` and `remaining` as `null` with `unlimited: true`, because infinity has no JSON representation. Quotas that reset carry a `period`. `rate_limits.requests_per_minute` is the ceiling of the key you called with, not a fixed number: a key raised above the default reports the raised value. `write_requests_per_minute` is the same for every key. The `subscription` block is present only for callers who can reach Plans & Billing in the app (the account owner, or a team member with billing access). Everyone else gets the same response without that key. `limits.prompt_executions`: AI answers left this tracking window (`limit`, `used`, `remaining`, `unlimited`), `period` (from `tracking_frequency`) and `resets_at` (next window, 00:00 Madrid). `limits.geo_audit_manual_runs` counts manual GEO audit runs, not prompt runs. `limits.pitch_projects`: this month's pitch projects against the allowance (`limit`, `used`, `remaining`, `unlimited`, `period: "month"`, `resets_on`) and `access` (`none`, `pending`, `approved`, `dormant` for approved but paused, `rejected` or `revoked`). Absent for a key limited to some projects; `limits.projects` leaves pitch projects out. `api_key_project_ids` lists the projects the calling key is limited to, or is `null` for a key that sees the whole account (and for OAuth). A scoped key gets nothing about the rest of the account: `plan`, `plan_name`, `subscription` and `limits.team_members` are absent, `limits.prompts.used` counts only its projects' prompts, `limits.prompts`, `limits.intelligence_tasks` and `limits.prompt_executions` give only `remaining` and `unlimited` (what the key can still add, without the account total), and `limits.projects` is capped at the projects it reaches. `tracking_frequency` stays: it is the cadence of those projects' data. `GET /store_connection` returns `account.plan` as `null` for such a key. **Response:** `plan` is the internal plan key; `plan_name` is the display name to show people (for example `Scale++` for `scaleplusplus`). ```json { "plan": "scale", "plan_name": "Scale", "tracking_frequency": "weekly", "role": "owner", "api_key_project_ids": null, "subscription": { "status": "active", "trialing": false, "current_period_ends_at": "2026-09-08T13:46:01Z" }, "limits": { "prompts": { "limit": 450, "used": 120, "remaining": 330, "unlimited": false }, "projects": { "limit": 5, "used": 2, "remaining": 3, "unlimited": false }, "competitors_per_project": { "limit": 20, "unlimited": false }, "intelligence_tasks": { "limit": 10, "used": 1, "remaining": 9, "unlimited": false, "period": "month" }, "prompt_executions": { "limit": 2363, "used": 600, "remaining": 1763, "unlimited": false, "period": "week", "resets_at": "2026-11-09T00:00:00+01:00" }, "team_members": { "limit": null, "unlimited": true } }, "rate_limits": { "requests_per_minute": 300, "write_requests_per_minute": 60 }, "request_id": "uuid" } ``` --- ## Projects A project is one tracked brand: its domain, locale, prompts and competitors. Almost every other endpoint takes a `project_id`, so start here. `project_id` also accepts the project domain or its exact name. ### GET /api/v1/dimensions/projects Lists all projects for the authenticated user. A key limited to some projects lists only those. `brand_name` is the brand label used in prompts and charts (null when unset, then `name` is used). `tracked: false` means scheduled runs skip the project (`untracked_reason`: `pitch_project`, `paused` or `project_limit`), also in project details. **Parameters:** `pitch`: `exclude` (default), `include` or `only` pitch projects (features.md, Pitch projects). Rows carry `pitch` and `pitch_expires_at`. **Response:** ```json { "projects": [ { "id": 1, "name": "My Brand", "brand_name": "Acme", "tracked": true, "untracked_reason": null, "pitch": false, "pitch_expires_at": null }, { "id": 2, "name": "Another Brand", "brand_name": null, "tracked": false, "untracked_reason": "project_limit", "pitch": false, "pitch_expires_at": null } ], "request_id": "uuid" } ``` ### GET /api/v1/dimensions/projects/:id Detailed info about a specific project. **Response:** ```json { "id": 1, "name": "My Brand", "brand_name": "My Brand", "url": "https://mybrand.com", "description": "Brand monitoring project", "matching_names": ["My Brand", "mybrand", "MB"], "additional_owned_domains": ["mybrand-blog.com"], "industry": "saas", "business_model": "b2b_saas", "business_model_other": null, "primary_products": "Product A, Product B", "target_audience": "Enterprises", "brand_voice": "Professional", "goals": "Be cited in CRM comparison questions", "country_code": "US", "language_code": "en", "paused": false, "tracked": true, "untracked_reason": null, "google_play_id": "com.mybrand.app", "app_store_id": "com.mybrand.app", "created_at": "2025-01-01T00:00:00Z", "prompt_limit": 60, "stats": { "prompts_count": 50, "prompts_by_brand_kind": { "brand": 12, "brand_other": 8, "non_brand": 30 }, "competitors_count": 5, "collections_count": 3, "prompts_available": 10 }, "data_coverage": { "models": ["chatgpt", "perplexity", "gemini"], "countries": ["US", "ES"], "languages": ["en", "es"] }, "search_console": { "status": "connected", "property": "sc-domain:mybrand.com", "properties_count": 2, "connect_url": "https://llmpulse.ai/app/project_settings?project_id=42&tab=data_connections" }, "ai_traffic": { "status": "not_connected", "provider": null, "connect_url": "https://llmpulse.ai/app/ai_traffic?project_id=42" }, "agent_traffic": { "status": "connected", "provider": "cloudflare_graphql", "connect_url": "https://llmpulse.ai/app/agent_analytics?project_id=42" } } ``` A pitch project's `pitch_run` gives `status` (`starting`, `running`, `ready`), `launched_at`, `settled_at`, `models`, `answers_expected` and `answers_received` (null for a tracked project). Read its metrics with `from` set to `launched_at`. `data_coverage` lists the AI models, countries and languages that have data for the project (same values as `/dimensions/models` and `/dimensions/locales`), and `stats.prompts_by_brand_kind` gives the prompt counts per brand focus. `search_console`, `ai_traffic` and `agent_traffic` are the data connections behind the Search Console, AI traffic and web analytics, and agent traffic endpoints: `connected`, `reconnect_required` (the source refused the stored access: web analytics reads and Search Console reads without `property` fail, synced AI and agent traffic still answer) or `not_connected`, and for `agent_traffic` also `imported` (no live source, imported logs answer). Each carries the connected `property` (the primary one) or `provider`, and `connect_url`, where the user connects or reconnects it; `search_console.properties_count` counts the properties Google still accepts. Check them first. `additional_owned_domains` is the list `PATCH /api/v1/projects/:id` replaces: read it before changing it. `prompt_limit` is the project's own prompt limit (`null` without one); `stats.prompts_available` is how many more prompts it can take now: the lower of its room under that limit and the account's remaining prompts, `null` when neither limits it. ### GET /api/v1/dimensions/models Lists AI models that have execution data. ```json { "project_id": 1, "models": ["chatgpt", "perplexity", "gemini", "ai_overview", "ai_mode"] } ``` ### GET /api/v1/dimensions/locales Lists countries and languages with data. ```json { "project_id": 1, "countries": ["US", "GB", "DE"], "languages": ["en", "de", "es"] } ``` ### POST /api/v1/projects Create a complete project in a single call (fast mode): project, prompts, competitors, weekly email subscription and initial execution, mirroring the in-app onboarding wizard. **Request body (JSON):** ```json { "website_url": "https://acme.com", "name": "Acme", "main_country": "US", "main_language": "en", "brand_name": "Acme Inc", "description": "CRM software for SMBs", "industry": ["SAAS"], "business_model": "B2B_SAAS", "target_audience": "Sales teams at SMBs", "brand_voice": "Direct, practical, no fluff", "goals": "Be cited in CRM comparison questions", "primary_products": ["Acme CRM", "Acme Dialer"], "matching_names": ["acme", "acme inc"], "prompts": ["best crm software", "top crm tools 2026"], "collections": [{ "name": "Comparisons", "prompts": ["top crm tools 2026"] }], "competitors": [{ "domain": "rival.com", "brand_name": "Rival", "matching_names": ["rival app"] }], "owned_media": { "youtube_channel_url": "https://youtube.com/@acme" }, "use_subdomain": false, "weekly_email_subscribed": true, "external_identifier": "studio-channel-8231", "execute_prompts_immediately": true } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `website_url` | Yes | Public HTTP(S) URL with a DNS hostname or public IP address. Internationalized (non-ASCII) domain names are accepted and stored as sent. Credentials, private and special IP addresses, localhost and internal hostnames are rejected | | `name` | Yes | Project name, as plain text. It can be changed later with `PATCH /api/v1/projects/:id` | | `main_country` | Yes | ISO country code (e.g. US, GB, DE) | | `main_language` | Yes | ISO language code (e.g. en, es, de) | | `brand_name` | No | Defaults to `name` | | `description` | No | Brand description. Context for Recommendations and GEO Writer (Brand Book) | | `industry` | No | One industry key or an array of keys (e.g. SAAS, TECHNOLOGY), case-insensitive. An unknown key returns `ERR_INVALID_PARAM` with the valid keys listed | | `business_model` | No | Business model key (e.g. B2B_SAAS, MARKETPLACE); unknown keys are rejected | | `business_model_other` | No | Your own wording for the business model. Only accepted when `business_model` is `OTHER`, rejected against any other key | | `target_audience` | No | Who the brand sells to. Context for Recommendations and GEO Writer (Brand Book) | | `brand_voice` | No | Tone of voice guidance for generated content (Brand Book) | | `goals` | No | What the brand wants to achieve. Context for GEO Writer and prompt suggestions | | `primary_products` | No | Array of the main products or services | | `matching_names` | No | Extra brand aliases used for mention matching. At most 50 names of up to 100 characters each; more returns `ERR_INVALID_PARAM` | | `prompts` | No | Array of prompt texts (max 100); each is queued for execution and categorization | | `collections` | No | Array (max 50) of `{name, prompts}`: collections (prompt tags) created with the project, each tagging prompts of the same request by their exact text, so no separate tagging calls are needed. A text that is not in `prompts` returns `ERR_INVALID_PARAM`. A team member also needs Tags: Create permission | | `competitors` | No | Array of `{domain, brand_name, matching_names}` (strings allowed as plain domains); capped by plan. Each starts on the `domain` citation rule. Its `matching_names` has the same limits | | `owned_media` | No | Social/app URLs (`youtube_channel_url`, `instagram_profile_url`, `facebook_page_url`, `tiktok_profile_url`, `app_store_url`, `google_play_url`); requires Growth plan or above | | `use_subdomain` | No | Treat the exact subdomain as the tracked property (default false) | | `weekly_email_subscribed` | No | Subscribe the account owner to the weekly project email (default false) | | `external_identifier` | No | Embed-enabled (Enterprise) accounts only; other accounts receive `ERR_PLAN_REQUIRED`. Idempotency key and embed-session join key, format `[a-z0-9_-]{1,64}`, unique per account. Replaying the same identifier returns the existing project with HTTP 200 and `idempotent: true` instead of creating a duplicate | | `execute_prompts_immediately` | No | Default true. When false, prompts skip the immediate first run and are picked up by the next scheduled tracking window | | `pitch` | No | Default false. True creates a pitch project (features.md, Pitch projects): uses one of the month's allowance, takes 1 to 100 prompts; `execute_prompts_immediately` cannot be false | **Response (201):** ```json { "project": { "id": 321, "name": "Acme", "brand_name": "Acme Inc", "url": "https://acme.com", "country_code": "US", "language_code": "en", "stats": { "prompts_count": 2, "competitors_count": 1, "collections_count": 0 } }, "prompts": { "created": 2, "skipped": 0, "execution": "immediate" }, "competitors": { "created": 1, "processing": false }, "collections": [{ "id": 55, "name": "Comparisons", "prompts_attached": 1 }], "same_domain_projects": [], "email_subscription": { "weekly_email_subscribed": true }, "limits": { "projects_remaining": 3, "prompts_available": 246, "competitors_remaining": 10 }, "request_id": "uuid" } ``` **Notes:** - The project belongs to the account owner even when a team member's API key creates it - Returns `ERR_LIMIT_REACHED` when the plan project cap, the prompt quota or the account's hard cap per project (**Account Settings > Prompt Limits**) would be exceeded, `ERR_QUOTA_EXCEEDED` over the competitor cap, `ERR_PLAN_REQUIRED` for `owned_media` below Growth, `ERR_INVALID_PARAM` for malformed fields - `403 ERR_INSUFFICIENT_PERMISSION` if the key belongs to a team member without Projects: Create permission - `403 ERR_KEY_PROJECT_SCOPED` if the key is limited to some projects - With `pitch: true`: `ERR_PLAN_REQUIRED` below the Scale tier, on a trial or without approved access (`error.meta.access`), `ERR_QUOTA_EXCEEDED` when the month's allowance is used (`error.meta.resets_on`), `ERR_INVALID_PARAM` for over 100 prompts or a domain tracked or pitched in the last 90 days - The endpoint never calls AI inline: competitor brand names are enriched only from the already-cached website analysis when available - Without `external_identifier`, replaying the same request creates a second project; embed integrations should always set it - `same_domain_projects` lists the projects you can already see on the same domain (`id`, `name`, `country_code`, `language_code`). It never blocks the create, because one domain tracked per market is a normal setup; check it (or `GET /api/v1/dimensions/projects` beforehand) to catch an accidental duplicate ### PATCH /api/v1/projects/:id Update a project's name and profile (the Brand Book plus brand matching), the same fields as **Preferences > Project Settings > General Information** and **Brand Book**: `name`, `brand_name`, `description`, `industry`, `business_model`, `business_model_other`, `target_audience`, `brand_voice`, `goals`, `primary_products`, `matching_names`, plus the additional owned domains of the domain editor (`additional_owned_domains`) and the project's prompt limit (`prompt_limit`). Send only the fields you want to change; unknown fields are rejected with `ERR_INVALID_PARAM`. A request is applied whole or not at all. The website URL, app-store and social profiles are NOT editable here: they re-scope what the project tracks and stay under Preferences > Project Settings. The default country and language are set when the project is created and cannot be changed. **Request body (JSON):** ```json { "description": "CRM software for SMBs", "industry": "SAAS", "business_model": "B2B_SAAS", "target_audience": "Sales teams at SMBs", "brand_voice": "Direct, practical, no fluff", "goals": "Be cited in CRM comparison questions", "primary_products": ["Acme CRM", "Acme Dialer"] } ``` | Parameter | Description | |-----------|-------------| | `name` | Project name shown in the app. A label: it does not change mention detection unless `brand_name` is empty. Cannot be blank | | `brand_name` | Brand name used to detect mentions. Applies to future runs; it does not rewrite history | | `description` | What the brand does. Context for Recommendations and GEO Writer (Brand Book) | | `industry` | One industry key (e.g. SAAS), stored as sent, or an array of keys, stored as an array like the in-app multi-select; unknown keys are rejected with the valid keys listed | | `business_model` | Business model key (e.g. B2B_SAAS); unknown keys are rejected | | `business_model_other` | Your own wording for the business model, used in place of the enum label wherever the profile is read. Only accepted when `business_model` is `OTHER`; sending it against any other key returns `ERR_INVALID_PARAM`. It is cleared automatically when `business_model` moves away from `OTHER` | | `target_audience` | Who the brand sells to (Brand Book) | | `brand_voice` | Tone of voice guidance for generated content (Brand Book) | | `goals` | What the brand wants to achieve. Context for GEO Writer and prompt suggestions | | `primary_products` | Full replacement array of the main products or services | | `matching_names` | FULL replacement array of the brand-name variants used to detect mentions. Send every variant to keep, not just the new ones. At most 50 names of up to 100 characters each; more returns `ERR_INVALID_PARAM` | | `additional_owned_domains` | FULL replacement array (at most 10) of other domains the brand owns, such as a blog or a country site; `[]` clears it. Each entry is a website's own domain and covers its subdomains; a pasted URL is stored as its domain (`https://www.acme.co.uk/x` becomes `acme.co.uk`). Account owner only | | `prompt_limit` | The most prompts the project can hold: a whole number from 1 to 2147483647, or `null` to remove the limit. Account owner, or a co-owner (account admin) with Projects: Update permission | | `pitch` | Only `false`, sent alone: converts a pitch project into a tracked project (features.md, Pitch projects) | **Response:** ```json { "project": { "id": 1, "name": "Acme", "brand_name": "Acme Inc", "description": "CRM software for SMBs", "industry": "SAAS", "business_model": "B2B_SAAS", "target_audience": "Sales teams at SMBs", "primary_products": ["Acme CRM", "Acme Dialer"], "brand_voice": "Direct, practical, no fluff", "goals": "Be cited in CRM comparison questions", "matching_names": ["Acme", "Acme Inc"], "additional_owned_domains": ["acme-blog.com"], "prompt_limit": null }, "updated_fields": ["description", "industry"], "rematching": false, "note": "These fields provide context for GEO Writer, prompt suggestions, or Recommendations; they do not change mention detection or historical numbers.", "request_id": "uuid" } ``` **Notes:** - All seven Brand Book fields (`industry`, `business_model`, `description`, `primary_products`, `target_audience`, `brand_voice`, `goals`) feed every GEO Writer task and prompt suggestions. `industry`, `description`, and `target_audience` also help Recommendations calibrate their advice. These fields do not change mention detection or historical numbers. - Changing `matching_names` re-runs mention/citation matching over the whole project history in the background (`rematching: true`, a few minutes); past visibility numbers can move. While that runs, further edits are rejected with `ERR_INVALID_PARAM` ("still recalculating"). - Changing `additional_owned_domains` reprocesses, in the background, the past answers that cite an added or removed domain (`rematching: true`): citations from the listed domains count as owned, like the project website, and past citation numbers can move. A list sent with `matching_names` starts one recalculation for both. Order does not matter: an unchanged list starts nothing. A list the domain editor would refuse (a subdomain such as `blog.acme.com`, a platform many companies share such as `youtube.com`, `amazon.com` or `wordpress.com`, the project website, a tracked competitor domain, a duplicate or an entry that is not a domain) returns `ERR_INVALID_PARAM` with the reason, and nothing in the request is applied. While that reprocessing runs, further edits are rejected with `ERR_INVALID_PARAM` ("still recalculating"). - A `brand_name` change applies to future runs only; to rewrite history, add the new spelling to `matching_names`. - A `name` change only relabels the project, unless `brand_name` is empty (then the name is the brand used for matching, and the change applies to future runs like a `brand_name` change). - `prompt_limit` works like **Account Settings > Prompt Limits**: the account's plan allowance still applies, and `note` says what the project can now hold. A limit below the current count deletes nothing; new prompts are refused until the project is under it. A request sending only `prompt_limit` is saved even during a recalculation. A value that is not a whole number in range (`"5"`, `5.0`, `0`) returns `ERR_INVALID_PARAM`. - `403 ERR_INSUFFICIENT_PERMISSION` if the key belongs to a team member without Projects: Update permission (co-owners included), if a team member (co-owners included) sends `additional_owned_domains`, which only the account owner can change, as in the domain editor, or if a team member who is not a co-owner sends `prompt_limit`. `403 ERR_KEY_PROJECT_SCOPED` if a key limited to some projects sends `prompt_limit`. Nothing in a refused request is applied. - A pitch project's website, brand name, matching names, country, language and prompt limit (and `name` while it has no brand name) are fixed from creation: changing one returns `ERR_INVALID_PARAM`. Convert it with `pitch: false` first. - `pitch: false` cannot be undone. `ERR_LIMIT_REACHED` names the full limit in `error.meta.limit` (`projects`, `prompts`, `project_prompts` or `competitors`); `ERR_INVALID_PARAM` when the project is not a live pitch project or other fields are sent. Needs a whole-account key and, for a team member, Projects: Create permission. - Also available as the MCP tool `update_project`. --- ### DELETE /api/v1/projects/:id Delete a project, like **Delete Project** in **Preferences > Project Settings**. It cannot be undone: the project disappears at once from the app and every endpoint and frees a project slot, then its prompts, answers, mentions, citations, sentiment, competitors and metrics history are purged in the background. **Response:** ```json { "project_id": 1, "deleted": true, "name": "Acme", "url": "https://acme.com", "note": "The project is hidden from every view and API listing immediately; ...", "request_id": "uuid" } ``` **Notes:** - A team member needs Projects: Delete permission, otherwise `403 ERR_INSUFFICIENT_PERMISSION`. - A project the key cannot see, or one already being deleted, returns `404 ERR_PROJECT_NOT_FOUND`. - API keys limited to the project lose it; a key left with no project is revoked. - Also available as the MCP tool `delete_project`; the in-app AI assistant asks for confirmation before deleting, and cannot delete the project its chat belongs to (use **Delete project** in Project Settings, or ask from another project's chat). --- ### POST /api/v1/project_drafts Start the multi-step project-creation wizard. Returns a `draft_id` plus AI suggestions (name, description, industry, brand aliases) for the URL. Drafts expire after 24 hours; max 25 open drafts per user. **Request body (JSON):** `website_url` (required public HTTP(S) URL with a DNS hostname or public IP address; internationalized domain names are accepted; credentials, private and special IP addresses, localhost and internal hostnames are rejected), `main_country` (required), `main_language` (required), `use_subdomain`, `suggest` (default true; false skips AI and responds instantly), `execute_prompts_immediately` (default true). **Response (201):** envelope with `draft` (draft_id, status, current_step, steps_completed/remaining, finalizable, accumulated fields, expires_at), `suggestions` ({step, status: ready|none|failed, details}) and `limits`. **Notes:** - Cold URLs can take up to ~2 minutes to analyze; set your HTTP client timeout to 180s or pass `suggest: false` - Root fields (website_url, locale, use_subdomain) are immutable; to change them start a new draft - Fails fast with `ERR_LIMIT_REACHED` / `ERR_INSUFFICIENT_PERMISSION` when the account could never finalize - Every `/project_drafts` endpoint answers `403 ERR_KEY_PROJECT_SCOPED` for a key limited to some projects --- ### GET /api/v1/project_drafts/:id Read a draft (state, current step, accumulated data). `include_suggestions=true` returns suggestions for the current step from cache only (never triggers AI, safe for polling). Reading an expired draft returns 200 with `status: "expired"`. --- ### PATCH /api/v1/project_drafts/:id Submit one wizard step. Body always includes `step` (`details` | `prompts` | `competitors` | `owned_media`) plus that step's fields; `suggest` (default true) controls whether the response includes AI suggestions for the NEXT step. | Step | Fields | |------|--------| | `details` | `name` (required), `brand_name`, `description`, `industry` (one key or an array), `matching_names` (array, at most 50 names of up to 100 characters each, checked at finalize), `external_identifier` (embed-enabled accounts only) | | `prompts` | `prompts` (array of strings, max 100; validates the account prompt quota and hard cap per project) | | `competitors` | `competitors` (array of `{domain, brand_name, matching_names}` or plain domain strings; capped by plan; each `matching_names` has the limits above) | | `owned_media` | optional, Growth+: `youtube_channel_url`, `instagram_profile_url`, `facebook_page_url`, `tiktok_profile_url`, `app_store_url`, `google_play_url` | **Notes:** - Strict forward gating: submitting a step before completing the previous ones returns `422 ERR_DRAFT_STATE` ("complete step 'x' first") - Resubmitting a completed step is allowed and does not invalidate later steps - Expired or finalized drafts return `422 ERR_DRAFT_STATE`; cross-user drafts return `404 ERR_DRAFT_NOT_FOUND` --- ### POST /api/v1/project_drafts/:id/finalize Create the real project from a completed draft: identical effects to `POST /api/v1/projects` (prompts queued for execution and categorization, competitors with recalculation, email subscription). Optional body overrides: `weekly_email_subscribed`, `execute_prompts_immediately`. **Notes:** - Idempotent: finalizing an already-finalized draft returns `200` with the existing project and `idempotent: true` - If that project has been deleted or marked for deletion, replay returns `404 ERR_PROJECT_NOT_FOUND` - All plan gates and quotas are re-validated at finalize time; on a gate failure the draft stays open and reusable - Incomplete drafts return `422 ERR_DRAFT_STATE` with the missing steps listed --- ## Metrics These endpoints return aggregated analytics data from the metrics system. ### GET /api/v1/metrics/timeseries Returns time-series data for one or more metrics, broken down by actor (project and/or competitors). **Parameters:** - `project_id` (required) - `metrics` (optional, default: `mentions`): Comma-separated list of metrics - `granularity` (optional, default: `day`): `day`, `week`, or `month`. When set to `week` or `month`, the API returns one aggregated data point per period (per week starting Monday, or per month) instead of daily data points - `range`: Number of days (7, 30, 90, 365). Required unless `from` is given - `from`, `to`: ISO8601 date range instead of `range`; `to` needs `from` and defaults to today - `model`, `collection_id`, `country_code`, `language_code`, `prompt` (optional filters) - `prompt_type` (optional): Filter by search intent: `informational`, `navigational`, `commercial`, `transactional` - `brand_kind` (optional): Filter by brand kind: `brand` (your own brand/products), `brand_other` (competing brands/products, tracked or not), `non_brand` (generic, no own or competing brand named). Retailers, marketplaces, publishers, review sites, social networks and distribution channels count as `brand_other` only when they compete with the project's business category. For fair 1:1 brand-vs-competitor comparisons (visibility, share of voice), use `brand_kind=non_brand`: brand-focused prompts skew results toward the brand they name. The in-app Overview page applies `non_brand` by default - `competitors` (optional): Comma-separated competitor IDs to include - `include_project` (optional, default: `true`): Include project brand in results **Available metrics:** - `mentions` - Count of brand mentions - `citations` - Count of responses with a visible citation or background source reference for the brand - `responses` - Count of prompt executions (responses) - `mention_rate` - (mentions / responses) × 100, also known as Mention Rate - `visibility` - Alias for mention_rate (kept for backward compatibility) - `weighted_visibility` - Position-weighted visibility score - `ai_visibility_score` - Alias for weighted_visibility - `avg_position` - Average visible citation position; background source references have no rank and are excluded - `avg_mention_position` - Average mention position - `citation_rate` - (responses citing THE BRAND's site, via a visible citation or background source reference / responses) × 100. Brand-scoped and binary per response; it is NOT the share of responses containing any source at all - `net_sentiment` - net sentiment score across classified sentiments - `sentiment_very_positive` - % of classified sentiments that are very positive - `sentiment_positive` - % of classified sentiments that are positive - `sentiment_neutral` - % of classified sentiments that are neutral - `sentiment_negative` - % of classified sentiments that are negative - `sentiment_very_negative` - % of classified sentiments that are very negative **Response:** ```json { "project_id": 1, "from": "2025-01-01T00:00:00Z", "to": "2025-01-31T23:59:59Z", "granularity": "day", "filters": { "metrics": ["mentions", "mention_rate"], "granularity": "day", "model": null, "collection_id": null, "country_code": null, "language_code": null, "prompt": null, "competitors": [], "include_project": true }, "series": { "mentions": [ { "actor": { "type": "project", "id": 1, "name": "My Brand", "domain": "mybrand.com" }, "metric": "mentions", "data": [ { "date": "2025-01-01", "value": 10 }, { "date": "2025-01-02", "value": 15 } ] }, { "actor": { "type": "competitor", "id": 2, "name": "Competitor A", "domain": "competitor.com" }, "metric": "mentions", "data": [ { "date": "2025-01-01", "value": 5 }, { "date": "2025-01-02", "value": 8 } ] } ], "mention_rate": [ ... ] }, "request_id": "uuid" } ``` ### GET /api/v1/metrics/summary Same as timeseries but adds aggregated summary statistics and position distribution. **Parameters:** Same as timeseries. **Additional response fields:** ```json { "series": { ... }, "summary": { "mentions": [ { "actor": { "type": "project", "id": 1, "name": "My Brand", "domain": "mybrand.com" }, "total": 150, "aggregation": "sum", "min": 0, "max": 25, "last": 18 } ] }, "position_distribution": { "position_1_count": 45, "position_2_count": 30, "position_3_plus_count": 25, "total_mentions": 100, "percentages": { "position_1": 45.0, "position_2": 30.0, "position_3_plus": 25.0 } } } ``` **Summary calculation:** - For count metrics (mentions, citations, responses): `total` = SUM of all period values - For rate/percentage and average metrics (visibility/mention_rate, citation_rate, ai_visibility_score/weighted_visibility, sentiment shares, avg_position, avg_mention_position, net_sentiment): `total` = AVERAGE across periods. Rates are never summed: a sum of weekly percentages is meaningless and could exceed 100%. - Each summary row includes an `aggregation` field stating which rule was applied: `"sum"` or `"average"`. - `min` / `max` = minimum/maximum period value in the range - `last` = most recent period's value ### GET /api/v1/metrics/prompt_summary Returns paginated per-prompt aggregated metrics. Useful for dashboards that need metrics broken down by individual prompt. **Parameters:** - `project_id` (required) - `range` or `from`/`to` (required): the date window, as in `/metrics/timeseries` - `breakdown` (optional): Add dimensions to the output. Currently supports: `model`. When `breakdown=model`, each row includes a `model` field and metrics are broken down per (prompt, model) combination - `model`, `collection_id`, `country_code`, `language_code`, `prompt` (optional filters) - `prompt_type`, `brand_kind` (optional): Categorization filters: same values as `/metrics/timeseries` - `sort` (optional, default: `responses`): Sort field: `responses`, `mentions`, `citations`, `mention_rate` (or `visibility`), `citation_rate`, `avg_mention_position`, `avg_position` - `sort_dir` (optional, default: `desc`): Sort direction: `asc` or `desc` - `page` (optional, default: 1): Page number - `per_page` (optional, default: 50, max: 100): Results per page **Response (default, no breakdown):** ```json { "project_id": 1, "from": "2025-01-01T00:00:00Z", "to": "2025-01-31T23:59:59Z", "filters": { ... }, "sort": "responses", "sort_dir": "desc", "page": 1, "per_page": 50, "total": 115, "data": [ { "prompt_id": 123, "prompt_text": "best CRM software", "responses": 50, "mentions": 30, "citations": 15, "visibility": 60.0, "mention_rate": 60.0, "citation_rate": 30.0, "avg_mention_position": 2.35, "avg_position": 3.1, "app_url": "https://llmpulse.ai/app/prompts/123?project_id=1", "country_code": "US", "language_code": "en", "prompt_type": "commercial", "brand_kind": "non_brand", "tags": [{ "id": 7, "name": "CRM" }], "sentiment_responses": 32, "sentiment_very_positive": 6.25, "sentiment_positive": 43.75, "sentiment_neutral": 40.63, "sentiment_negative": 9.38, "sentiment_very_negative": 0.0, "net_sentiment": 40.63 } ], "request_id": "uuid" } ``` **Response (with breakdown=model):** ```json { "project_id": 1, "from": "2025-01-01T00:00:00Z", "to": "2025-01-31T23:59:59Z", "filters": { ... }, "breakdown": "model", "sort": "responses", "sort_dir": "desc", "page": 1, "per_page": 50, "total": 230, "data": [ { "prompt_id": 123, "prompt_text": "best CRM software", "model": "chatgpt", "responses": 50, "mentions": 30, "citations": 15, "visibility": 60.0, "mention_rate": 60.0, "citation_rate": 30.0, "avg_mention_position": 1.85, "avg_position": 2.5, "app_url": "https://llmpulse.ai/app/prompts/123?project_id=1" }, { "prompt_id": 123, "prompt_text": "best CRM software", "model": "perplexity", "responses": 40, "mentions": 25, "citations": 10, "visibility": 62.5, "mention_rate": 62.5, "citation_rate": 25.0, "avg_mention_position": 2.65, "avg_position": 4.0, "app_url": "https://llmpulse.ai/app/prompts/123?project_id=1" } ], "request_id": "uuid" } ``` **Notes:** - Only brand metrics are returned (competitor_id IS NULL): no competitor breakdown per prompt - All metrics are always returned (responses, mentions, citations, mention_rate, visibility, citation_rate, avg_mention_position, avg_position, and the sentiment fields) - Each row also carries the prompt's classification, as in `/dimensions/prompts`: `country_code`, `language_code`, `prompt_type`, `brand_kind` and `tags` (`[{id, name}]`) - Sentiment: `sentiment_responses` counts the prompt's responses that carry a sentiment verdict for the brand. The five `sentiment_*` fields are percentages of that count (neutral included) and `net_sentiment` is positive minus negative (-100 to 100), computed like the sentiment metrics of `/metrics/timeseries`. All are null when `sentiment_responses` is 0. Sentiment cannot be used as a `sort` field - The sentiment percentages never filter `responses`: a prompt with 32 responses, 13 of them neutral, shows `responses: 32` and `sentiment_neutral: 40.63` - Standard filters (model, collection_id, country_code, language_code, prompt, prompt_type, brand_kind) still apply - `breakdown=model` can be combined with the `model` filter, e.g. `breakdown=model&model=chatgpt` would return only the ChatGPT rows per prompt - Without `breakdown`, total counts distinct prompts; with `breakdown=model`, total counts distinct (prompt, model) pairs - Every row carries `app_url`, the link that opens the prompt in the app (see "Links into the app") ### GET /api/v1/metrics/sov Share of Voice: your brand's share of mentions compared to competitors. **Parameters:** Same as timeseries. For a fair comparison, use `brand_kind=non_brand` (the in-app Overview default): brand-focused prompts skew the share toward the brand they name. `periods` reports, per bucket, the total `mentions` the shares were computed on (the sample size: shares in a bucket with 1-3 mentions read as 100/50/33.33 and are low-sample noise) and a `partial` flag for buckets still collecting data (the period has not finished) or clipped by the requested window on either side. Each period also carries `confidence` (`none` with no mentions, `low` under 30, `medium` under 100, `high` from 100) and `margin_of_error`, the worst-case 95% margin in percentage points (98 divided by the square root of `mentions`, `null` with no mentions). `sample` repeats the period the `current` shares were computed on (`null` when the window has no mentions). Each `current` row also carries precomputed deltas so consumers do not average shares by hand: `previous_share` (the actor's share in the last complete bucket before the current one) and `avg_share` (the mean across complete buckets with data; partial buckets are excluded from both). Both are `null` when there is no complete history. **Response:** ```json { "project_id": 1, "from": "2025-01-01T00:00:00Z", "to": "2025-01-31T23:59:59Z", "granularity": "day", "periods": [ { "date": "2025-01-01", "mentions": 42, "partial": false, "confidence": "medium", "margin_of_error": 15.1 }, { "date": "2025-01-31", "mentions": 3, "partial": true, "confidence": "low", "margin_of_error": 56.6 } ], "sample": { "date": "2025-01-31", "mentions": 3, "partial": true, "confidence": "low", "margin_of_error": 56.6 }, "over_time": [ { "actor": { "type": "project", "id": 1, "name": "My Brand" }, "data": [ { "date": "2025-01-01", "value": 45.5 }, { "date": "2025-01-02", "value": 47.3 } ] }, { "actor": { "type": "competitor", "id": 2, "name": "Competitor A" }, "data": [ ... ] } ], "current": [ { "actor": { ... }, "share": 45.5 }, { "actor": { ... }, "share": 35.2 } ], "breakdown": [ { "rank": 1, "actor": { ... }, "share": 45.5 }, { "rank": 2, "actor": { ... }, "share": 35.2 }, { "rank": 3, "actor": { ... }, "share": 12.1 }, { "rank": 4, "actor": { ... }, "share": 7.2 }, { "rank": 5, "actor": { "name": "Others" }, "share": 0.0, "others": true } ], "others": [] } ``` **SoV calculation:** - Per day: `(actor_mentions / total_mentions_all_actors) × 100` - `current`: SoV on the last day with data - `breakdown`: Top 4 actors individually + "Others" aggregate - `others`: Individual actors that fell into the "Others" group **MCP `get_sov` `view`:** the same names as the REST table selector, with the same meaning, returned as JSON: `over_time` (with `periods`), `current`, or `breakdown` (with `others`), each keeping `project_id`, `from`, `to`, `granularity`, `filters`, `sample` and `app_url`. The tool also takes `compact` (keeps `current`, `periods` and `sample`; drops `over_time`, `breakdown` and `others`) and `full`, the default. On REST, `view` still only picks the table for `output`. ### GET /api/v1/metrics/top_sources Lists registrable domains most frequently cited in AI responses, including visible citations and background source references. This endpoint intentionally remains a domain rollup even when exact-subdomain matching is enabled for the project. Google entity viewer links appear as the domain `google-entity.invalid` (see Sources & Citation Intelligence). **Additional parameters:** - `sort` (optional, default: `total_responses`): `total_responses`, `avg_mention_rate`, or `avg_visibility` - `query` (optional): Search domain by name (case-insensitive partial match) - `domains` (optional): exact domains, comma-separated (`domains[]=` also works) - `collection_ids` (optional): several tags (union), comma-separated (`collection_ids[]=` also works) - `prompt_type`, `brand_kind` (optional): Categorization filters: same values as `/metrics/timeseries` - `page`, `per_page` (pagination) **Response:** ```json { "project_id": 1, "from": "...", "to": "...", "sort": "total_responses", "page": 1, "per_page": 20, "total": 150, "data": [ { "domain": "reddit.com", "total_responses": 45, "avg_visibility": 15.5, "avg_mention_rate": 15.5 } ] } ``` --- ## Competitors The brands tracked alongside the project brand. The ids returned here are the `actor_id` values the metrics endpoints report against. ### GET /api/v1/dimensions/competitors Lists competitors for a project. **Parameters:** - `project_id` (required) - `include_project_brand` (optional, default: `false`): when `true`, prepends the main tracked brand into the same array with `actor_type=project` and `is_own=true`. The project's `domain` is normalized to a bare domain (scheme-less, no trailing slash) for parity with competitor entries, or `null` when the project has no URL. **Response:** ```json { "project_id": 1, "competitors": [ { "id": 1, "name": "Competitor A", "domain": "competitor.com", "matching_names": ["Competitor A", "CompA"] } ] } ``` **Response with `include_project_brand=true`:** ```json { "project_id": 1, "competitors": [ { "id": 1, "name": "My Brand", "domain": "mybrand.com", "actor_type": "project", "is_own": true }, { "id": 2, "name": "Competitor A", "domain": "competitor.com", "actor_type": "competitor", "is_own": false } ] } ``` ### GET /api/v1/dimensions/competitors/:id Detailed competitor info. **Response:** ```json { "id": 2, "project_id": 1, "brand_name": "Competitor A", "domain": "competitor.com", "citation_match_mode": "domain", "citation_match_path": null, "matching_names": ["Competitor A", "CompA"], "google_play_id": "com.competitor.app", "app_store_id": "com.competitor.app", "color": "#FF5733", "created_at": "2025-01-01T00:00:00Z" } ``` ### GET /api/v1/competitors/suggestions The Competitors page's Suggested tab: `basis=brands` (default) lists brands the AI discovery proposed, not yet tracked or rejected; `basis=citations` the domains AI answers cite most that are neither yours nor tracked (rows with `citations` and a null `brand_name`). Read-only: only the page's **Discover** button starts a discovery run, whose state is `discovery`. Add one with `POST /api/v1/competitors`. MCP tool `list_competitor_suggestions`. **Parameters:** `project_id` (required), `basis`, `query`, `page`, `per_page`, `output`. **Response:** ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 1, "basis": "brands", "discovery": { "status": "...", "loading": false, "generated_at": "..." }, "data": [ { "id": "...", "domain": "rival.com", "brand_name": "Rival", "matching_names": ["Rival"], "mentions": 12, "citations": null } ], "request_id": "uuid" } ``` ### POST /api/v1/competitors Add a competitor to a project. **Request body (JSON):** ```json { "project_id": 123, "brand_name": "OpenAI", "domain": "openai.com", "matching_names": ["ChatGPT"], "citation_match_mode": "path_prefix", "citation_match_path": "/research" } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `brand_name` | Yes | Competitor brand name | | `domain` | Yes | Primary domain (URL is accepted and normalised) | | `matching_names` | No | Extra brand aliases for mention matching (brand_name is auto-included). At most 50 names in all, of up to 100 characters each | | `citation_match_mode` | No | `domain` (default), `host`, or `path_prefix` | | `citation_match_path` | With `path_prefix` | Case-sensitive path prefix such as `/es`; trailing slash is optional; query and fragment are ignored | **Response (201):** ```json { "project_id": 123, "competitor": { "id": 42, "brand_name": "OpenAI", "domain": "openai.com", "citation_match_mode": "path_prefix", "citation_match_path": "/research", "color": "#000000", "matching_names": ["OpenAI", "ChatGPT"] }, "competitors_remaining": 4, "total_competitors": 11, "request_id": "uuid" } ``` **Notes:** - Exact duplicate rules (same domain, mode, and path in the same project) return `ERR_INVALID_PARAM`. One host can have separate path-prefix competitors, such as `/es` and `/en`. - Plan-cap reached returns `ERR_QUOTA_EXCEEDED`. - Recalculates the competitor's past mentions and citations in the background. ### PATCH /api/v1/competitors/:id Update a competitor's `brand_name`, website `domain` or host, `matching_names` (full replacement list of name variants; the brand name is always included automatically; at most 50 names in all, of up to 100 characters each), `color` (hex like `#1a2b3c`), and/or `citation_match_mode` plus `citation_match_path`. A full URL in `domain` is accepted and normalised to its host. **Notes:** - Changing `brand_name`, `matching_names`, the website, or the citation match rule re-runs historical mention and citation matching in the background: the competitor shows `processing: true` for a few minutes and further edits are rejected with `ERR_INVALID_PARAM` meanwhile. It does not change whether prompts are categorized as own-brand, other-brand, or non-brand; that classification is separate. Website-only and rule-only changes skip sentiment reanalysis. - The website `domain`, `citation_match_mode`, and `citation_match_path` share one 7-day change cooldown per competitor. Changing any one locks all three until the timestamp returned in the `ERR_INVALID_PARAM` message. Other competitor fields remain editable. Existing competitors start unlocked when this feature is introduced, and creating a competitor does not start the cooldown. - Also available as the MCP tool `update_competitor`. **Response:** ```json { "project_id": 123, "competitor": { "id": 42, "brand_name": "...", "domain": "...", "citation_match_mode": "host", "citation_match_path": null, "color": "...", "matching_names": [...], "processing": true }, "request_id": "uuid" } ``` ### DELETE /api/v1/competitors/:id Delete a competitor. The competitor disappears immediately (and frees a competitor slot); a background job then deletes its mentions, citations, sentiment and share of voice history. Its ads, shopping products, local businesses and brand entities are kept: they move to the project or another competitor they match, or stay unattributed. Irreversible. **Parameters:** `project_id` (required), `id` (required path param). **Response:** ```json { "project_id": 123, "deleted": true, "id": 42, "brand_name": "...", "domain": "...", "total_competitors": 9, "request_id": "uuid" } ``` Returns `ERR_NOT_FOUND` for competitors that do not belong to the project. Also available as the MCP tool `delete_competitor`. ## Prompts The questions run against the AI models on the account's schedule, and their execution records. ### GET /api/v1/dimensions/prompts Lists prompts with pagination and filtering. **Parameters:** `project_id` (required), `page`, `per_page`, standard filters (`model`, `collection_id`, `country_code`, `language_code`, `prompt`, `prompt_type`, `brand_kind`), `from`, `to` `model` keeps only prompts with an execution on that model (any outcome or date), so one with none yet (a newly enabled model, or a locale the model does not cover) is left out. `from` and `to` filter by prompt creation date. **Response per item:** ```json { "id": 1, "prompt_text": "What are the best AI visibility tools?", "collection_id": 5, "collection_ids": [5, 12], "tags": [{"id": 5, "name": "pricing"}, {"id": 12, "name": "comparisons"}], "country_code": "US", "language_code": "en", "prompt_type": "commercial", "brand_kind": "non_brand", "last_executed_at": "2025-01-31T12:00:00Z", "tracked": true, "untracked_reason": null } ``` `tracked` and `untracked_reason` as in the project list, plus `prompt_limit`. Note: `tags` is the authoritative list of ALL tags assigned to this prompt as id+name pairs; `collection_ids` carries the same ids only. `collection_id` is a legacy primary-tag field and can be null even when the prompt has tags. ### GET /api/v1/dimensions/prompt_executions Lists prompt execution records. **Parameters:** `project_id` (required), `page`, `per_page`, standard filters, `from`, `to`, `mention_filter`, `citation_filter`, `competitors` (same two-axis matrix documented under `GET /api/v1/answers`) **Response per item:** ```json { "id": 1001, "prompt_id": 1, "executed_at": "2025-01-31T12:00:00Z", "duration_ms": 2500, "success": true, "model": "chatgpt", "fan_out_queries": ["best CRM software 2025", "top CRM for startups"], "has_mention": true, "has_citation": false, "mentions_count": 1, "citations_count": 0 } ``` ### GET /api/v1/dimensions/query_fan_outs Query fan-out: the sub-queries a model actually issued when answering your tracked prompts. Useful for finding the phrasing models search for, which is often not the phrasing of the prompt. Fan-out is reported mainly by ChatGPT and Claude, so an empty result usually means the models in scope do not expose it rather than that nothing was searched. The API returns the aggregation only; for a period-over-period delta, call it twice with explicit `from`/`to` and subtract. **Parameters:** `project_id` (required), `view` (`query` default, or `prompt`), `query` (case-insensitive substring on the sub-query text), `order`, `direction`, `page`, `per_page`, standard filters (`model`, `collection_id`, `country_code`, `language_code`, `prompt`, `prompt_type`, `brand_kind`), `range`, `from`, `to`, `output`. `order` depends on `view`: `count` (default), `share` or `query_text` for `view=query`; `total_count` (default), `variations_count` or `prompt_text` for `view=prompt`. An order that does not belong to the view returns `ERR_INVALID_PARAM`. **Response (`view=query`):** ```json { "project_id": 1, "view": "query", "page": 1, "per_page": 20, "total": 1203, "total_occurrences": 1225, "data": [ { "query_text": "best CRM software 2025", "count": 5, "share": 0.41 } ] } ``` `total` is the number of rows you can page through (distinct sub-queries, or prompts on `view=prompt`), while `total_occurrences` is the denominator behind `share`. **Response (`view=prompt`):** ```json { "project_id": 1, "view": "prompt", "page": 1, "per_page": 20, "total": 226, "data": [ { "prompt_id": 9081, "prompt_text": "best CRM for startups", "variations_count": 30, "total_count": 30 } ] } ``` ### GET /api/v1/suggested_prompts The **Prompts > Suggested Prompts** queue, oldest first, with every generator's suggestions: `website`, `magic` (keyword runs), `topic`, `reddit`, `paa`, `reputational`, `translate`, `gsc` (Search Console), `catalog`. Team members need Prompts: Create, as for the tab. MCP tool `list_suggested_prompts`. **Parameters:** `project_id` (required), `source` (a generator), `status` (`pending` default, `accepted`, `rejected`, `all`), `page`, `per_page` (default 50, max 100). **Response:** `prompt_id` and `accepted_at` are set once accepted. ```json { "project_id": 123, "page": 1, "per_page": 50, "total": 18, "data": [ { "id": 77, "prompt": "best running shoes for flat feet", "source": "magic", "status": "pending", "country_code": "US", "language_code": "en", "prompt_id": null, "accepted_at": null, "created_at": "..." } ], "request_id": "uuid" } ``` ### GET /api/v1/prompt_generations/:id Polls a `POST /prompt_generations` run (`project_id` required; `id` is the run id), in the same shape: `status` is `processing`, then `completed` with `suggestions` (the rows saved to the queue, with their current status) or `failed` with `error` (`code`, `message`). Most runs finish within a minute; poll every few seconds. After 24 hours a run is `ERR_NOT_FOUND`; its suggestions stay queued. MCP tool `get_prompt_generation`. ### POST /api/v1/prompts Add prompts to a project in bulk. Validates against account prompt limits and skips duplicates. **Request body (JSON):** ```json { "project_id": 123, "prompts": ["best CRM software 2026", "top project management tools"], "country_code": "US", "language_code": "en" } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `prompts` | Yes | Array of prompt texts (max 100 per request) | | `country_code` | Yes | ISO 3166-1 alpha-2 country code (e.g. US, GB, DE) | | `language_code` | Yes | Two-letter ISO 639-1 language code (e.g. en, es, de). Regional variants such as pt-BR are refused | **Response (201):** ```json { "project_id": 123, "created": 1, "skipped": 1, "total_after": 47, "prompts_available": 3, "tracked": true, "untracked_reason": null, "warning": null, "first_runs_wait_until": null, "data": [ { "id": 456, "raw_input": "best CRM software 2026", "status": "created" }, { "id": 400, "raw_input": "top project management tools", "status": "exists" } ], "request_id": "uuid" } ``` **Notes:** - Prompts that already exist in the project (same locale and the same text, ignoring case and extra spaces) are skipped with status "exists", and so is a second spelling of a prompt sent in the same request - Returns `ERR_INVALID_PARAM` if `country_code` or `language_code` is not one the app offers - Returns `ERR_LIMIT_REACHED` if the account doesn't have enough prompt slots - Returns `ERR_LIMIT_REACHED` if the request would exceed the project's own prompt limit (**Preferences > Project Settings > General Information**) or the account's hard cap per project (**Account Settings > Prompt Limits**) - A pitch project holds at most 100 prompts in all, deleted ones included (`ERR_LIMIT_REACHED` past that). Once it has run its prompts are fixed: adding one returns `ERR_INVALID_PARAM` with `error.meta.reason` `pitch_prompts_frozen`, as do importing, accepting a suggestion, starting a prompt generation and deleting a prompt there - Returns `403 ERR_INSUFFICIENT_PERMISSION` if the API key belongs to a team member whose permission matrix does not grant Prompts: Create - New prompts are queued for execution across all AI models unless `tracked` is false (see `untracked_reason` and `warning`) - New prompts get first answers within about 24 hours. If the cycle's AI answer allowance cannot cover one answer per AI model for each, `first_runs_wait_until` is the reset time (00:00 Madrid) when the rest run, and `warning` says so - Prompt text has no length limit here, but some AI models track prompts only up to a set length: Google AI Mode and AI Overviews up to 700 characters, ChatGPT and Gemini up to 2,000. A longer prompt is still created and tracked on the other models; the models whose limit it passes return no answers for it ### POST /api/v1/prompts/import The app's CSV import as JSON: `project_id` and up to 500 `rows` of `prompt` (required), `country_code` and `language_code` (codes or names, default the project's) and `tags` (names, created when missing). Prompt limits are checked first: `ERR_LIMIT_REACHED` imports nothing. A row matching an existing prompt (same locale and the same text, ignoring case and extra spaces) counts in `duplicates` and still gets its tags. A row is skipped, listed by index in `row_errors`, when its country or language is unknown, when it would give a prompt more than 50 tags (rows repeating a prompt add up) or when its tags would take the request past 500 new tags. For a team member it is also skipped when it would tag an existing prompt without Prompts: Update or create a tag without Tags: Create. If none is valid, `ERR_INVALID_PARAM`; a pitch project that has run refuses the import (`pitch_prompts_frozen`, see `POST /prompts`). `length_warning` names the AI models that will skip new prompts longer than they accept. Team members need Prompts: Create. MCP tool `import_prompts`. **Request body (JSON):** ```json { "project_id": 123, "rows": [ { "prompt": "best CRM for startups", "country_code": "US", "language_code": "en", "tags": ["CRM", "Comparisons"] }, { "prompt": "mejor CRM para pymes", "country_code": "ES", "language_code": "es" } ] } ``` **Response (201 when prompts were created, 200 otherwise):** ```json { "project_id": 123, "processed_rows": 2, "created": 2, "duplicates": 0, "tagged": 2, "created_tags": 1, "row_errors": [], "length_warning": null, "prompts_available": 46, "tracked": true, "untracked_reason": null, "warning": null, "first_runs_wait_until": null, "request_id": "uuid" } ``` ### POST /api/v1/prompt_generations Runs a generator behind the app's **Add prompts** wizards and answers 202 with a run. Its suggestions land in the Suggested prompts queue; nothing is tracked until `POST /suggested_prompts/accept`. MCP tool `generate_prompt_suggestions`. **Request body (JSON):** ```json { "project_id": 123, "source": "topic", "query": "electric SUVs", "count": 20, "country_code": "US", "language_code": "en" } ``` `source` and its parameters: - `website`: from the scraped website, 80% non-brand and 20% brand, up to 100 per project. - `keyword`: from `query` (optional; else the project profile), `count`, optional `competitor_id` angle. - `topic`: about `query` (required), `count`. - `reddit`: questions from Reddit discussions; `query` (required), `search_type` (`topic` or `brand`). - `paa`: Google People Also Ask questions; `keywords` (up to 5) or `query`. - `reputational`: brand reputation questions. - `translate`: the project's prompts of another locale, translated; `source_country_code`, `source_language_code` (required). - `search_console`: a connected property's top queries of the last 28 days; `property` (one id, default the primary), `min_words` (0-10), `all_countries`. Growth plan or above (else `ERR_PLAN_REQUIRED`); `ERR_SEARCH_CONSOLE_NOT_CONNECTED` without a connection. `country_code` and `language_code` set the locale (default the project's); `count` is 1-100 (default 20), capped by the prompt slots left. **Response (202):** ```json { "id": "6f1c2a7e-0d4b-4c39-9a51-2f7b8e3d1c90", "project_id": 123, "source": "topic", "status": "processing", "params": { "country_code": "US", "language_code": "en", "query": "electric SUVs", "count": 20 }, "created_at": "...", "finished_at": null, "suggestions_count": 0, "suggestions": [], "error": null, "request_id": "uuid" } ``` **Errors:** `ERR_INVALID_PARAM` before the run starts; `ERR_LIMIT_REACHED` with no prompt slot left or once the website generator wrote its 100; `ERR_QUOTA_EXCEEDED` after 60 runs in an hour (the per-user suggestion allowance, shared with project setup and the app's AI generators). A failed run's `error.code` is `ERR_GENERATION_FAILED` (start another run), `ERR_NOT_FOUND` (nothing came back: try a broader query), `ERR_QUOTA_EXCEEDED` (the 24-hour People Also Ask allowance is used up) or a Search Console error. Team members need Prompts: Create. ### POST /api/v1/suggested_prompts/accept Tracks pending suggestions (`ids`, up to 100) as prompts in their own country and language, with at most one tag (`tag_ids` or `tag_names`; `create_missing` creates a missing name if the team member may create tags). Ones no longer pending come back in `skipped`; `prompts_available` is `null` when unlimited. If the new prompts would exceed the plan, `ERR_LIMIT_REACHED` accepts nothing. Team members need Prompts: Create. MCP tool `accept_suggested_prompts`. **Request body (JSON):** ```json { "project_id": 123, "ids": [77, 78], "tag_names": ["Electric"], "create_missing": true } ``` **Response:** ```json { "project_id": 123, "accepted": [ { "suggestion_id": 77, "prompt_id": 501, "collection_id": 12 } ], "skipped": [ { "suggestion_id": 78, "reason": "rejected" } ], "prompts_available": 44, "request_id": "uuid" } ``` ### POST /api/v1/suggested_prompts/reject Rejects pending suggestions (`ids`, up to 100) so they leave the pending list; nothing is tracked or deleted. Team members need Prompts: Create. MCP tool `reject_suggested_prompts`. **Request body (JSON):** ```json { "project_id": 123, "ids": [79] } ``` **Response:** ```json { "project_id": 123, "rejected": 1, "ids": [79], "request_id": "uuid" } ``` ### PATCH /api/v1/prompts/:id Sets a prompt's search intent (`prompt_type`: `informational`, `navigational`, `commercial`, `transactional`) and/or brand focus (`brand_kind`: `brand`, `brand_other`, `non_brand`) by hand, like editing its badges on the prompt page; send `project_id` and at least one. Other fields or values return `ERR_INVALID_PARAM`, a prompt outside the project `ERR_NOT_FOUND`, a white-label portal `ERR_INTEGRATION_UNAVAILABLE`. The prompt is then manually categorized: automatic categorization no longer changes it, and the prompt page can revert it to automatic. Team members need Prompts: Update. MCP tool `update_prompt_categorization`. **Response:** ```json { "project_id": 123, "prompt": { "id": 10, "raw_input": "best crm software", "prompt_type": "commercial", "brand_kind": "non_brand", "categorization_source": "manual", "manually_categorized": true, "categorized_at": "..." }, "request_id": "uuid" } ``` ### DELETE /api/v1/prompts/:id Delete a prompt. The prompt disappears immediately (and frees a prompt slot); its historical data (executions, mentions, citations, sentiment) is purged by a background job. Irreversible. A pitch project that has run keeps its prompts: `ERR_INVALID_PARAM` with `error.meta.reason` `pitch_prompts_frozen`. **Parameters:** `project_id` (required), `id` (required path param). **Response:** ```json { "project_id": 123, "deleted": true, "id": 10, "raw_input": "best crm software", "total_after": 99, "request_id": "uuid" } ``` Returns `ERR_NOT_FOUND` for prompts that do not belong to the project. Also available as the MCP tool `delete_prompt`. --- ## Collections & Tags Collections (labelled Tags in the app) group prompts by topic, funnel stage or campaign so metrics can be filtered by them. A prompt can belong to several. `/dimensions/collections` and `/dimensions/tags` are the same endpoint. ### GET /api/v1/dimensions/collections (alias: /tags) Lists tags/collections for a project. ```json { "project_id": 1, "collections": [ { "id": 1, "name": "Brand Monitoring" } ] } ``` ### POST /api/v1/collections Create a tag (Collection) in a project. Optionally attach existing prompts in the same call. **Request body (JSON):** ```json { "project_id": 123, "name": "pricing", "description": "Pricing related prompts", "prompt_ids": [10, 11, 12] } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `name` | Yes | Tag name (case-insensitive unique per project) | | `description` | No | Optional description | | `prompt_ids` | No | Prompt IDs to attach (must belong to the project) | **Response (201):** ```json { "project_id": 123, "collection": { "id": 5, "name": "pricing", "description": "Pricing related prompts" }, "prompts_attached": 3, "total_collections": 7, "request_id": "uuid" } ``` ### PATCH /api/v1/collections/:id Rename a tag/collection or change its description. Prompt membership is managed via `POST /prompts/assign_tags` and `POST /prompts/remove_tags`, not here. **Body params:** `project_id` (required), `name` and/or `description` (at least one). **Response:** ```json { "project_id": 123, "collection": { "id": 5, "name": "...", "description": "...", "prompts_count": 12 }, "request_id": "uuid" } ``` Also available as the MCP tool `update_collection`. ### DELETE /api/v1/collections/:id Delete a tag/collection. The prompts inside it are NOT deleted; only the grouping disappears. **Parameters:** `project_id` (required), `id` (required path param). **Response:** ```json { "project_id": 123, "deleted": true, "id": 5, "name": "pricing", "prompts_kept": 12, "total_collections": 6, "request_id": "uuid" } ``` Also available as the MCP tool `delete_collection`. ### POST /api/v1/prompts/assign_tags Attach tags to existing prompts in bulk. Idempotent: re-running with the same input does not duplicate assignments. **Request body (JSON):** ```json { "project_id": 123, "prompt_ids": [10, 11, 12], "tag_ids": [5], "tag_names": ["pricing"], "create_missing": false } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `prompt_ids` | Yes | Prompt IDs to tag | | `tag_ids` | No | Tag IDs to attach | | `tag_names` | No | Tag names (case-insensitive lookup) | | `create_missing` | No | When true, unknown `tag_names` are created on the fly (default false) | Provide at least one of `tag_ids` or `tag_names`. You may provide both, and tags from both inputs will be assigned. **Response (200):** ```json { "project_id": 123, "prompts_targeted": 3, "tags_attached": [{ "id": 5, "name": "pricing" }], "new_links_created": 3, "skipped_already_linked": 0, "missing_tag_names": [], "ignored_prompt_ids": [], "request_id": "uuid" } ``` ### POST /api/v1/prompts/remove_tags Detaches up to 50 tags (`tag_ids` and/or `tag_names`) from up to 500 `prompt_ids`; only the links go, tags and prompts stay. Idempotent. Team members need Prompts: Update. MCP tool `remove_prompt_tags`. **Request body (JSON):** ```json { "project_id": 123, "prompt_ids": [10, 11], "tag_names": ["pricing"] } ``` **Response:** ```json { "project_id": 123, "prompts_targeted": 2, "tags_detached": [{ "id": 5, "name": "pricing" }], "links_removed": 2, "skipped_not_linked": 0, "missing_tag_names": [], "ignored_prompt_ids": [], "request_id": "uuid" } ``` ## Answers The AI responses behind every metric, with their full text, mentions, citations and sentiment analysis. ### GET /api/v1/answers Lists successful prompt execution responses with the full AI response text. **Parameters:** `project_id` (required), standard filters, `from`, `to`, `page`, `per_page`, `query` (optional full-text search), `mention_filter`, `citation_filter`, `competitors`, `no_result` (optional boolean) **`no_result`** separates sentinel non-answers from real ones. When no answer can be collected for a prompt after all retries, or the model declined to answer (today only Gemini, for its safety filters or a restricted topic; such an answer is not retried), the row is flagged `no_result: true` and it never enters the platform metrics (`metrics/timeseries`, `summary`, `sov` already exclude these rows). Pass `no_result=false` to list only real answers (recommended when computing your own metrics from this endpoint), `no_result=true` to list only the sentinels, or omit it to get both. Every item also carries its own `no_result` flag. Any other value returns `ERR_INVALID_PARAM` (422). **`no_result_reason`** is present only on a sentinel and says which kind it is: `declined` (the model declined to answer; the app shows it as **Declined**, and `response` holds the reply the model gave instead) or `no_answer` (no answer could be collected; `response` is a placeholder such as "The request didn't trigger a response", not an AI response). The show endpoint and the MCP `list_answers` and `get_answer` tools carry the same field. **`mention_filter` and `citation_filter`** are the two-axis matrix the Responses page exposes (your brand crossed with competitors, each axis present / absent / any): - `mention_filter`: `mentions_you`, `not_mentions_you`, `mentions_competitor`, `not_mentions_competitor`, `you_and_competitor`, `competitor_not_you` (a rival wins and the brand is absent), `you_not_competitor`, `no_brands` (no tracked brand appears; finished answers only). The legacy value `competitors_only` still works as an alias of `competitor_not_you`. - `citation_filter`: the same cells applied to the domains cited in the answer: `cites_you`, `not_cites_you`, `cites_competitor`, `not_cites_competitor`, `you_and_competitor`, `competitor_not_you`, `you_not_competitor`, `cites_no_brands` (other domains allowed), plus `no_citations` (finished answers citing no source at all). - The two are independent and intersect, so `mention_filter=mentions_you&citation_filter=not_cites_you` finds answers that talk about the brand without linking to it. - `competitors` (comma-separated IDs) narrows the competitor side of either filter to those rivals. On a negative cell it reads "none of these". Unknown or foreign IDs are ignored, not rejected. - An unknown preset returns `ERR_INVALID_PARAM` (422). **Response per item:** ```json { "id": 1001, "prompt_id": 1, "prompt_text": "What are the best AI visibility tools?", "model": "chatgpt", "response": "AI visibility tools include...", "response_truncated": false, "executed_at": "2025-01-31T12:00:00Z", "duration_ms": 2500, "no_result": false, "mentions_count": 1, "citations_count": 3, "app_url": "https://llmpulse.ai/app/prompts/1/prompt_executions/1001?project_id=1" } ``` Note: In list view, responses are truncated to 10,000 characters. Use the show endpoint for full responses. **Full-text search with `query`:** pass `query` to search case-insensitively inside the AI response texts (a brand, place, or phrase). `total` then equals the exact number of matching responses, so it can answer "how many responses mention X" without paging. In query mode each item returns a `snippet` (text around the first match) and `match_count` (occurrences in that response) instead of `response`/`response_truncated`. The same parameter is available on the MCP `list_answers` tool. ### GET /api/v1/answers/:id Full details for a specific execution including all mentions, citations, sentiments, and sources. **Parameters:** `project_id` (required), `id` (execution ID in URL), `include_source_page_details` (optional, default: `false`) **Response:** ```json { "id": 1001, "prompt_id": 1, "prompt_text": "What are the best AI visibility tools?", "model": "chatgpt", "response": "Full AI response text...", "executed_at": "2025-01-31T12:00:00Z", "duration_ms": 2500, "success": true, "no_result": false, "fan_out_queries": ["targeted advertising strategies", "best ad platforms 2025"], "mentions": [ { "id": 2001, "keywords": ["My Brand"], "position": 1 } ], "citations": [ { "id": 3001, "url": "https://mybrand.com", "position": 1 } ], "competitor_mentions": [ { "id": 4001, "competitor_id": 2, "competitor_name": "Competitor A", "keywords": ["CompA"], "position": 3 } ], "competitor_citations": [ { "id": 5001, "competitor_id": 2, "competitor_name": "Competitor A", "url": "https://competitor.com", "position": 2 } ], "sentiments": [ { "id": 6001, "analysis": "positive", "score": 0.5, "comment": "Tool mentioned favorably", "topics": "innovation, reliability", "competitor_id": null, "is_brand_sentiment": true } ], "sources": [ { "id": 7001, "url": "https://reddit.com/r/...", "url_sha256": "abc123...", "normalized_url": "https://reddit.com/r/...", "domain": "reddit.com", "position": 1, "is_owned": false, "is_competitor": false } ], "shopping_products": [ { "id": 8001, "competitor_id": 2, "competitor_name": "Competitor A", "model": "chatgpt", "product_id_external": "prod-123", "title": "Competitor Product", "url": "https://competitor.com/product", "domain": "competitor.com", "price": 29.99, "currency": "USD", "rating_value": 4.6, "rating_max": 5.0, "rating_votes_count": 120, "images": ["https://competitor.com/image.jpg"], "tag": "popular", "rank_group": 1, "is_owned": false } ], "brand_entities": [ { "id": 9001, "competitor_id": null, "competitor_name": null, "model": "chatgpt", "title": "My Brand", "category": "brand", "markdown": "Short description here", "urls": ["https://mybrand.com/about"], "domain": "mybrand.com", "is_owned": true } ], "local_businesses": [ { "id": 501, "competitor_id": null, "competitor_name": null, "model": "chatgpt", "title": "La Casa Del Caffe", "description": "A local favorite known for great cappuccinos.", "address": "1036 Morris Park Ave, Bronx, NY 10461", "phone": null, "reviews_count": 22, "url": "http://www.lacasadelcaffe.com", "domain": "lacasadelcaffe.com", "rating_value": 3.9, "rating_max": 5.0, "rating_votes_count": 22, "rank_group": 1, "rank_absolute": 2, "position": 1, "is_owned": false } ], "locale": { "country_code": "US", "language_code": "en" }, "plan_required_fields": [], "app_url": "https://llmpulse.ai/app/prompts/1/prompt_executions/1001?project_id=1" } ``` `sentiments` need the Growth plan or above and `shopping_products` the Scale plan or above. Below those plans each is left out of the response and named in `plan_required_fields`, which is always present and empty when nothing is left out. The MCP `get_answer` tool returns the same. If `include_source_page_details=true`, each source also includes nested `page_details` with page-cache metadata and mention evidence from the cited page. This endpoint is also the closest equivalent to Peec's `get_chat`, because it now includes the full response, fan-out queries, cited sources, shopping products, extracted brand entities, and local businesses shown in local-intent answers. --- ## Mentions & Citations The raw records behind the visibility metrics: one row per brand mention or per cited URL. Read them for the project brand, for competitors, or for both in a single stream (`all_*`, where `actor_type` is `project` or `competitor`). Citation listings include visible citations and background source references; a background reference has `position: 0`, which means it has no visible rank. **Parameters (every listing here):** `project_id` (required), `page`, `per_page`, standard filters, `range` (`from`/`to` win), `from`, `to`. ### GET /api/v1/dimensions/mentions Lists brand mention records (project brand only). **Response per item:** ```json { "id": 2001, "name": "My Brand", "prompt_id": 1, "prompt_execution_id": 1001, "created_at": "2025-01-31T12:00:00Z" } ``` ### GET /api/v1/dimensions/citations Lists brand citation records (project brand only). **Response per item:** ```json { "id": 3001, "name": "My Brand", "domain": "mybrand.com", "prompt_id": 1, "prompt_execution_id": 1001, "url": "https://mybrand.com/page", "position": 1, "created_at": "2025-01-31T12:00:00Z" } ``` ### GET /api/v1/dimensions/competitor_mentions Lists competitor mention records. **Additional parameter:** `competitors` (optional, CSV of competitor IDs) **Response per item:** ```json { "id": 4001, "competitor_id": 2, "name": "Competitor A", "domain": "competitor.com", "prompt_execution_id": 1001, "created_at": "2025-01-31T12:00:00Z" } ``` ### GET /api/v1/dimensions/competitor_citations Lists competitor citation records. **Additional parameter:** `competitors` (optional, CSV of competitor IDs) **Response per item:** ```json { "id": 5001, "competitor_id": 2, "name": "Competitor A", "domain": "competitor.com", "prompt_execution_id": 1001, "url": "https://competitor.com/page", "position": 1, "created_at": "2025-01-31T12:00:00Z" } ``` ### GET /api/v1/dimensions/all_mentions Lists all mentions (brand + competitor) in a single unified endpoint. **Additional parameter:** `competitors` (optional, CSV of competitor IDs to filter competitor portion) **Response per item (project):** ```json { "id": 2001, "actor_type": "project", "name": "My Brand", "prompt_id": 1, "prompt_execution_id": 1001, "created_at": "2025-01-31T12:00:00Z" } ``` **Response per item (competitor):** ```json { "id": 4001, "actor_type": "competitor", "competitor_id": 2, "name": "Competitor A", "domain": "competitor.com", "prompt_id": 1, "prompt_execution_id": 1001, "created_at": "2025-01-31T12:00:00Z" } ``` ### GET /api/v1/dimensions/all_citations Lists all citations (brand + competitor) in a single unified endpoint. **Additional parameter:** `competitors` (optional, CSV of competitor IDs to filter competitor portion) **Response per item (project):** ```json { "id": 3001, "actor_type": "project", "name": "My Brand", "domain": "mybrand.com", "prompt_id": 1, "prompt_execution_id": 1001, "url": "https://mybrand.com/page", "position": 1, "created_at": "2025-01-31T12:00:00Z" } ``` **Response per item (competitor):** ```json { "id": 5001, "actor_type": "competitor", "competitor_id": 2, "name": "Competitor A", "domain": "competitor.com", "prompt_id": 1, "prompt_execution_id": 1001, "url": "https://competitor.com/page", "position": 2, "created_at": "2025-01-31T12:00:00Z" } ``` ## Sentiments Sentiment records with their comments, topics and scores, plus the category catalog used to label them. `/sentiments` returns records; `/dimensions/sentiments` returns the categories. Both endpoints require the Growth plan or higher and return `ERR_PLAN_REQUIRED` below that tier. ### GET /api/v1/sentiments Lists individual sentiment analysis records with full details. **Parameters:** - `project_id` (required) - `competitor_id` (optional): Filter by specific competitor - `brand_only` (optional): Set to `true` to only include brand sentiments (competitor_id = NULL) - `analysis` (optional): One sentiment value or a comma-separated list: `very_positive`, `positive`, `neutral`, `negative`, `very_negative` - Standard filters: `model`, `collection_id`, `country_code`, `language_code`, `from`, `to`. A `model` that is not enabled for the API key's user, or is not a model, is ignored rather than rejected (see AI model filter) - `page`, `per_page` (pagination) **Response per item:** ```json { "id": 6001, "prompt_execution_id": 1001, "prompt_text": "What are the best AI visibility tools?", "model": "chatgpt", "analysis": "positive", "score": 0.5, "comment": "Tool is reliable and feature-rich", "topics": "reliability, features", "competitor_id": null, "competitor_name": null, "is_brand_sentiment": true, "executed_at": "2025-01-31T12:00:00Z", "created_at": "2025-01-31T12:05:00Z" } ``` **Sentiment score values:** - Very Positive = 1.0 - Positive = 0.5 - Neutral = 0.0 - Negative = -0.5 - Very Negative = -1.0 **Filtering logic:** - Only returns sentiments where `hidden = false` and `analysis IS NOT NULL` - `brand_only=true` filters to `competitor_id IS NULL` - Multiple sentiments can exist per execution (one per brand + one per competitor) - The `topics` field is the closest equivalent to topic metadata in competitor tools such as Peec. In LLM Pulse, topic-like labeling lives primarily in collections/tags plus per-sentiment `topics`. --- ### GET /api/v1/reports/sentiment/topics The Sentiment page's Topics table: per topic, analyzed `mentions`, `positive` (very positive included), `neutral` and `negative` counts, their shares (`positive_pct`, `neutral_pct`, `negative_pct`, 0-100) and `net_score` ((positive - negative) / mentions x 100). MCP tool `get_sentiment_topics`. **Parameters:** `project_id` (required); `range` (default 28 days) or `from`/`to`; `model`, `collection_id`, `country_code`, `language_code`, `brand_kind`, `analysis`, `topic`, `query`; `brand` (empty for your brand, `all` for every brand, or a competitor id); `sort` (`mentions`, `name`, `positive`, `negative`, `neutral`, `net_score`), `sort_dir` (`desc`, `asc`), `page`, `per_page`, `output`. **Response:** ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 1, "from": "2026-09-17", "to": "2026-10-14", "brand": { "type": "project", "id": 123, "name": "Acme" }, "sort": "mentions", "sort_dir": "desc", "data": [ { "topic": "pricing", "mentions": 40, "positive": 22, "neutral": 10, "negative": 8, "positive_pct": 55.0, "neutral_pct": 25.0, "negative_pct": 20.0, "net_score": 35.0 } ], "request_id": "uuid" } ``` ### GET /api/v1/reports/sentiment/tags The Tags table: the topics counts per tag (`tag_id`, `tag`), for tags with at least one analyzed mention; a mention counts once for every tag its prompt carries. Same parameters as topics. MCP tool `get_sentiment_tags`. --- ### GET /api/v1/dimensions/sentiments Lists available sentiment categories (NOT sentiment records; for that, use /api/v1/sentiments). ```json { "project_id": 1, "sentiments": [ { "metric": "sentiment_very_positive", "key": "very_positive", "label": "Very Positive", "color": "#16a34a", "score": 1.0 }, { "metric": "sentiment_positive", "key": "positive", "label": "Positive", "color": "#86efac", "score": 0.5 }, { "metric": "sentiment_neutral", "key": "neutral", "label": "Neutral", "color": "#d1d5db", "score": 0.0 }, { "metric": "sentiment_negative", "key": "negative", "label": "Negative", "color": "#fca5a5", "score": -0.5 }, { "metric": "sentiment_very_negative", "key": "very_negative", "label": "Very Negative", "color": "#dc2626", "score": -1.0 } ] } ``` --- ## Sources & Citation Intelligence These endpoints expose the richer cited-page intelligence already available in the web app: grouped URL/domain/host views, cached page metadata, mention evidence inside cited pages, occurrence lists, and sanitized cached content. Page availability: cited URLs and citation metrics remain available. When no usable saved text exists, `page_cache.content_available` and `mentions_processed` are false, content and page metadata fields are null, and `page_mentions.content_gap_status` is `content_unavailable` (`missing_page_cache` when no row exists). Page mentions are per project: until the page's mention analysis completes for the requesting project, `brand_mentioned` and `competitor_mentioned` are null (never false), mention arrays are empty and `content_gap_status` is `mentions_not_processed` on a page with usable text. `page_cache.mentions_processed` is true exactly when `brand_mentioned` is not null. `error_message` is null; crawl diagnostics stay internal. `status_code` shows a usable snapshot's successful status or an observed 404/410. Other crawl failures are hidden. `last_crawled_at` dates the displayed saved copy and does not advance on failed refreshes. Domain/host aggregates count only usable saved copies in `crawled_urls_count`. Their brand/competitor mention counts cover only URLs analyzed for the project and are null when there are none. Google entity links: Google AI Mode and AI Overviews link some names to Google's entity viewer (`google.com/searchviewer/...`). These rows keep their `url` but report `google-entity.invalid` as their `domain` and `host`, so they group apart from real google.com pages, and they never count as owned or competitor citations. The app labels the group "Google (entity)". ### GET /api/v1/dimensions/sources Lists all extracted URLs from AI responses (not just brand URLs). **Parameters:** as the mention and citation listings, plus `source_type` (optional): `owned`, `competitor`, `third_party`. `owned` honors the project's URL match rule, and `competitor` honors each competitor's own rule. Exact-host rules exclude sibling subdomains. Path-prefix rules also require the case-sensitive saved path. Any other value, including a differently cased one, returns `ERR_INVALID_PARAM` (422). **Additional parameters:** `mention_filter` and `competitors`, the same matrix documented under `GET /api/v1/answers`. Here it applies to the brands named in the crawled CONTENT of each cited page, not in the AI answer, mirroring the Citations page. These filters require usable saved page content and mention analysis completed for this project. Pages with unavailable content or incomplete analysis are excluded, including from negative and content-gap filters. **Response per item:** ```json { "id": 5001, "prompt_execution_id": 1001, "domain": "reddit.com", "url": "https://reddit.com/r/technology/...", "url_sha256": "3f1a...64 hex chars...", "position": 2, "source_type": "third_party", "is_google_play_link": false, "is_app_store_link": false, "created_at": "2026-07-01T09:00:00+02:00" } ``` **source_type values:** - `owned`: URLs belonging to the project brand (`is_client = true`), with exact-host matching when enabled - `competitor`: URLs belonging to a competitor, with exact-host matching when enabled - `third_party`: URLs belonging to neither brand nor competitors ### GET /api/v1/citation_intelligence/groups Returns grouped citation intelligence by `url`, `domain`, or `host`. **Parameters:** - `project_id` (required) - `view` (optional, default: `url`): `url`, `domain`, or `host` (invalid values → `ERR_INVALID_PARAM`) - `page`, `per_page` (optional pagination) - `order` (optional): one of `group_key`, `total_responses`, `total_citations`, `citation_rate`, `avg_citation_position`, `first_seen_at`, `last_seen_at` - `direction` (optional): `asc` or `desc` - `model` (optional): one of `chatgpt`, `ai_mode`, `ai_overview`, `perplexity`, `gemini`, `naver_ai`, `baidu_ai`, `naver_ai_tab`, `qwen`, `doubao`, enabled for the API key's user (see AI model filter) - `collection_id`, `country_code`, `language_code`, `prompt`, `from`, `to` (optional filters) - `brand_kind` (optional): `brand`, `brand_other` or `non_brand`, the prompts' brand focus - `collection_ids` (optional, array): filter by several tags/collections at once (union); avoids one call per tag - `domains` (optional, array): restrict results to an exact list of domains (case-insensitive); avoids one call per domain - `query` (optional): text filter against the grouped key - `key` (optional): return only this group of the chosen view (a domain, a host or a cited URL as listed). Domains and hosts match in any case and without `www.`. With `view=url` the key is one raw cited URL, so variants of the same page (a tracking parameter, a trailing slash) stay separate rows; `GET /citation_intelligence/urls/:url_sha256` merges them, as the app's page for a URL does. No match returns `total: 0` and `data: []`, not an error - `include_series` (optional, needs `key`): adds `citation_series` to the group's row, in the shape `GET /citation_intelligence/urls/:url_sha256` returns; `total` equals the row's `total_responses`, and an answer citing several of the group's pages counts once. With `view=url` it covers that raw URL only. Without `key` it returns `ERR_INVALID_PARAM` - `source_type` (optional): `owned`, `competitor`, `third_party`, `social_media`, `own_domain`, `ugc`, `background` - `owned`/`competitor`/`third_party` match the response `source_type` field (based on `is_client`/`is_competitor` flags). Owned matching honors the project rule, while competitor matching honors each competitor's own domain, host, or path-prefix rule. - `social_media`/`own_domain`/`ugc`/`background` use classification lists - `sentiment` (optional): currently supports `negative` - `content_gap` (optional): `mentioned` or `gap` - Invalid enum values on `view`/`order`/`direction`/`model`/`source_type`/`sentiment`/`content_gap` return `ERR_INVALID_PARAM`. - No default date range: omit `from`/`to` to query all history. **Response highlights:** - grouped citation counts and citation rate include visible citations and background source references - `avg_citation_position` ignores rows with `position = 0` - per-model breakdown - first/last seen timestamps - for `view=url`: `url_sha256`, page-cache metadata, and page mention summary - for `view=domain|host`: aggregate URL/page-cache counts for the group ### GET /api/v1/citation_intelligence/mentions_by_domain For the responses where each given source domain is cited, returns the share of those responses that mention the brand vs each competitor. Brand + competitors sum to 100% per domain. Pass several domains to get the whole matrix in one call. **Parameters:** - `project_id` (required) - `domains` (required): source domains, comma-separated (`domains[]=` also works; max 50) - `model`, `collection_id`, `collection_ids`, `country_code`, `language_code`, `prompt`, `brand_kind`, `from`, `to` (optional filters). `brand_kind` accepts `brand`, `brand_other`, or `non_brand` and scopes the cited response universe to prompts of that type. - Empty `domains` returns `ERR_INVALID_PARAM`. **Response highlights:** - one row per domain: `responses_citing`, `total_mentions`, and an `actors` array (brand + each competitor with `mentions` and `share`) - shares are normalized so each domain's actors sum to 100%; mirrors the Share of Voice mention definition ### GET /api/v1/citation_intelligence/urls/:url_sha256 Returns URL-level detail for one cited page. **Parameters:** - `project_id` (required) - `url_sha256` (required path param, must be 64 hex chars) - same optional filters as `/citation_intelligence/groups`, `brand_kind` included, except `key` - `include_series` (optional, default `false`): adds `citation_series`. Without it the response is unchanged **Behavior notes:** - `ERR_NOT_FOUND` ("Cited URL not found") is only returned when the URL has never been cited by the project (unfiltered). - If the URL exists but filters return zero occurrences, the endpoint returns `200` with empty `stats` (counts = 0) so clients can distinguish "no data with this filter" from "URL doesn't exist". **Response highlights:** - URL/domain/host identifiers - total responses and citations for the URL - citation rate and average citation position (ignores rows with `position = 0`) - source-type counts (`owned` / `competitor` / `third_party`) - per-model counts - distinct raw URL variants - page-cache metadata - page mention evidence, including snippets and actor labels - with `include_series=true`, `citation_series`: the answers citing the URL under the same filters, computed like the charts on the source's page in the app. The numbers can still differ from the app: the API dates answers by `executed_at` (Europe/Madrid time, the column `from` and `to` filter) and the app by creation, so an answer near a period edge can land in another period or outside `from`/`to`; the API applies no date range without `from`/`to`, while the app always applies its selected period; and the API leaves out sources dismissed as competitor suggestions, which the app still counts. `total` equals `stats.total_responses`; `by_model` counts answers per AI model, largest first, and can include enabled models outside the seven the `model` filter accepts; `data` holds one `{ date, value }` point per `granularity` period (`day`, `week` or `month`, following the account's tracking frequency; a daily account gets Monday weeks when the filtered answers span more than 60 days). A period whose answers did not cite the URL shows `0`; a period with no answers has no point ### GET /api/v1/citation_intelligence/urls/:url_sha256/occurrences Returns paginated occurrences of a cited URL across prompt executions. **Parameters:** - `project_id` (required) - `url_sha256` (required path param, must be 64 hex chars) - same optional filters as `/citation_intelligence/groups`, except `brand_kind`, `key` and `include_series` - `page`, `per_page` (optional pagination) **Behavior notes:** - Returns `ERR_NOT_FOUND` only when the URL has never been cited by the project. If filters match nothing, returns `200` with `total: 0` and `data: []`. **Response highlights:** - `answer_id` / `prompt_execution_id` (currently identical: same execution, retained for forward compatibility) - `prompt_id` and `prompt_text` - `model` and `executed_at` - `citation_position` - `source_type` (`owned` / `competitor` / `third_party`): matches the `source_type` filter vocabulary - response excerpt plus `response_truncated` - fan-out queries when available ### GET /api/v1/citation_intelligence/urls/:url_sha256/content Returns sanitized cached page content for one cited URL. **Parameters:** - `project_id` (required) - `url_sha256` (required path param, must be 64 hex chars) **Behavior notes:** - Returns `ERR_NOT_FOUND` only when the URL has never been cited by the project. **Response highlights:** - page-cache metadata - mention evidence and snippets - full cached plain text - sanitized rendered HTML (scripts and unsafe markup removed) --- ## AI Model Insights These endpoints expose the aggregate parts of the web app’s AI Model Insights report. `ai_model_insights` endpoints use `executed_at` for prompt-execution data. Aggregate metrics sourced from `DailyPromptMetric` use its stored calendar `day`. Date windows must not have `from` after `to` and may not exceed 1,500 days; violations return `ERR_INVALID_PARAM`. **Actor shape** (used across all AI Model Insights matrices): ```json { "type": "project" | "competitor", "id": 107, "competitor_id": null | 667, "name": "LLM Pulse", "domain": "llmpulse.ai" } ``` - `type` = `"project"` for the tracked brand, `"competitor"` for everyone else. - `id` = project ID or competitor ID. - `competitor_id` is retained for back-compat: `null` for the project, the competitor ID otherwise. - `domain` is always bare (scheme-less, no trailing slash). It is `null` for the project when the project has no URL. ### GET /api/v1/reports/ai_model_insights/summary Returns the aggregate AI Model Insights summary. **Parameters:** - `project_id` (required) - `range` (optional, default: `28`) - `from`, `to` (optional ISO8601 range) - `granularity` (optional): `day`, `week`, or `month`. Invalid values → `ERR_INVALID_PARAM`. - `collection_id`, `country_code`, `language_code` (optional filters) - `prompt_type`, `brand_kind` (optional): Categorization filters: same values as `/metrics/timeseries`. Invalid values → `ERR_INVALID_PARAM`. The in-app AI Model Insights Overview tab defaults to non-brand prompts, so use `brand_kind=non_brand` to match its numbers and for fair brand-vs-competitor comparisons. - `competitors` (optional): CSV list of competitor IDs to include in actor matrices. Unknown IDs → `ERR_INVALID_PARAM`. **Response highlights:** - one row per AI model the account has enabled or that answered in the window, in the in-app column order - `share_of_total` is `null` when its section has nothing to share, `net_sentiment` when there is no sentiment, and a mentions, citations or sentiment market-share value when the model has no answer or sentiment behind it (0 is a real value); counts and weighted visibility scores stay `0` - only the ten models accepted by `/reports/ai_model_insights/position_distribution` have that drill-down - per-model mention counts and shares - per-model citation counts and shares - per-model brand net sentiment with raw positive/negative counts - per-model weighted visibility totals and shares - actor matrices for mentions, citations, sentiment, and weighted visibility (each actor uses the standard actor shape above) - raw numerators/denominators behind percentages ### GET /api/v1/reports/ai_model_insights/position_distribution Returns the position-distribution comparison used in the AI Model Insights report. **Parameters:** - `project_id` (required) - `range` (optional, default: `28`) - `from`, `to` (optional ISO8601 range) - `collection_id`, `country_code`, `language_code` (optional filters) - `prompt_type`, `brand_kind` (optional): Categorization filters: same values as `/metrics/timeseries`. Invalid values → `ERR_INVALID_PARAM`. Use `brand_kind=non_brand` for a fair head-to-head (the in-app default). - `granularity` (optional): `day`, `week`, or `month`. Invalid values → `ERR_INVALID_PARAM`. - `model` (optional): restrict the comparison to one of `chatgpt`, `ai_mode`, `ai_overview`, `perplexity`, `gemini`, `naver_ai`, `baidu_ai`, `naver_ai_tab`, `qwen`, `doubao`, whether or not the model is enabled for the API key's user (see AI model filter). Other values → `ERR_INVALID_PARAM`. - `brand1`, `brand2` (optional): competitor IDs for the comparison brands; omit `brand1` to compare the project brand. Unknown IDs → `ERR_INVALID_PARAM`. **Response highlights:** - one or two brand series, each using the standard actor shape - bucketed position totals (`Position 1`, `Position 2-3`, `Position 4-7`, `Position 8+`) - chart-ready time series per bucket - `max_stacked_value` for chart scaling ### GET /api/v1/reports/ai_model_insights/ai_overview_results Returns aggregate Google AI Overview result-availability data. **Parameters:** - `project_id` (required) - `range` (optional, default: `28`) - `from`, `to` (optional ISO8601 range, filters by `executed_at`) - `collection_id`, `country_code`, `language_code` (optional filters) - `prompt_type`, `brand_kind` (optional): Categorization filters: same values as `/metrics/timeseries`. Invalid values → `ERR_INVALID_PARAM`. - `granularity` (optional): `day`, `week`, or `month`. Invalid values → `ERR_INVALID_PARAM`. - `page`, `per_page` (optional pagination for the by-prompt table) **Response highlights:** - total AI Overview responses - responses with results (where `no_result = false`) - result rate - chart-ready trend data - paginated by-prompt result-rate table --- ## AI & Agent Traffic What AI sends to the site: `ai_traffic` covers humans arriving from AI assistants (measured by the connected web analytics provider), `agent_traffic` covers the AI crawlers hitting the origin server. Both REST endpoints require the Scale plan or above. Over MCP, `get_ai_traffic` is available from the Growth plan (like the AI Traffic page) and `get_agent_traffic` from Scale. The two `web_analytics` endpoints are different: instead of the AI referral numbers LLM Pulse stored, they query the connected web analytics provider live for any of its data (Growth plan or above, MCP `get_web_analytics_schema` and `query_web_analytics`). ### GET /api/v1/metrics/ai_traffic AI referral traffic for a project: human visits arriving from AI assistants (ChatGPT, Perplexity, Gemini, Claude, etc.), measured from the connected web analytics provider (Google Analytics 4, Adobe Analytics, PostHog, Plausible, Piano or Matomo). Sessions with a paid medium (such as `cpc`) are left out on Google Analytics 4 and Piano, the providers that report one. **Scale plan or above required**; lower tiers get `ERR_PLAN_REQUIRED`. Projects without a connected provider get `ERR_AI_TRAFFIC_NOT_CONNECTED`. **Parameters:** - `project_id` (required) - `range`, `from`, `to`: date range (defaults to last 30 days) - `source`: filter by a single AI source slug (e.g. `chatgpt`, `perplexity`, `gemini`, `claude`) - `granularity`: `day` (default), `week`, `month` **Response:** ```json { "project_id": 1, "provider": "google_analytics", "from": "2026-04-01", "to": "2026-04-27", "granularity": "day", "totals": { "users": 320, "sessions": 540, "conversions": 48, "conversion_rate": 8.89 }, "by_source": [ { "source": "chatgpt", "name": "ChatGPT", "users": 210, "sessions": 360, "conversions": 32 }, { "source": "perplexity", "name": "Perplexity", "users": 110, "sessions": 180, "conversions": 16 } ], "timeseries": { "chatgpt": { "2026-04-26": 32, "2026-04-25": 28 }, "perplexity": { "2026-04-26": 12 } }, "request_id": "..." } ``` --- ### GET /api/v1/web_analytics/schema How to query the web analytics provider connected to the project, live: which provider (Google Analytics 4, Adobe Analytics or Customer Journey Analytics, Matomo, PostHog, Plausible or Piano) and which property, the native query format it accepts, the allowed top-level fields, the rules the bridge enforces, a worked example and, where the provider offers it, its live field list (every GA4 dimension and metric including custom definitions, Adobe dimension and metric ids, Matomo report methods, recent PostHog event names, the Plausible catalog). Cached for an hour. **Growth plan or above.** Projects without a connected provider get `ERR_WEB_ANALYTICS_NOT_CONNECTED` (404). When the provider cannot list its fields right now, `fields` is null and `fields_unavailable` says so; the format and example still apply. MCP: `get_web_analytics_schema`. **Parameters:** - `project_id` (required) **Response:** ```json { "project_id": 1, "provider": "google_analytics", "property": "properties/123456789", "query_language": "GA4 Data API runReport request body (JSON, camelCase field names)", "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1beta/properties/runReport", "allowed_fields": ["dateRanges", "dimensions", "metrics", "dimensionFilter", "metricFilter", "offset", "limit", "metricAggregations", "orderBys"], "rules": ["Required: metrics, and dateRanges (unless cohortSpec is used).", "Do not send property: the connected GA4 property is always used."], "example": { "dateRanges": [{ "startDate": "28daysAgo", "endDate": "yesterday" }], "dimensions": [{ "name": "sessionDefaultChannelGroup" }], "metrics": [{ "name": "sessions" }], "limit": 20 }, "fields": { "dimensions": ["country", "date", "sessionSource"], "metrics": ["sessions", "totalUsers"], "custom_dimensions": [{ "api_name": "customEvent:plan", "ui_name": "Plan" }], "custom_metrics": [] }, "request_id": "..." } ``` --- ### POST /api/v1/web_analytics/query Runs a live, read-only query against the connected provider and returns columns and rows. The caller writes the query in the provider's own format: a GA4 Data API runReport body, an Adobe Analytics or Customer Journey Analytics report request, Matomo Reporting API parameters (only `get` methods of reporting modules run, never visitor logs or profiles), PostHog HogQL (SQL), a Plausible Stats API v2 query or a Piano getData body. **Growth plan or above**; a read-only API key works (no write scope needed). MCP: `query_web_analytics`. What the bridge enforces: - The project's connected property, site, report suite, data view or PostHog project is always used; any property field in the query is ignored. Nothing can be written. - Rows default to 100 and are capped at 5,000; page with the provider's own offset or page field. - Identical queries are answered from a 10-minute cache (`cached: true` in the response). - A project allows 20 uncached queries a minute and runs at most two at a time (four across the account). Every uncached query spends the customer's own provider API quota, which the AI Traffic sync also uses. - On PostHog, HogQL can read anything the connected key can read in that project, including persons and connected data warehouse tables. Team members need the AI Traffic read permission to use these endpoints. **Body (JSON):** - `project_id` (required) - `query` (required): the native query object; for PostHog the HogQL string or `{"query": "SELECT ..."}` **Errors:** - `ERR_WEB_ANALYTICS_NOT_CONNECTED` (404): no provider connected on the AI Traffic page - `ERR_WEB_ANALYTICS_INVALID_QUERY` (422): the query was refused before sending or rejected by the provider; the message is the provider's own validation text, which says what to change - `ERR_WEB_ANALYTICS_ACCESS_REVOKED` (403): the provider refused the stored credentials; reconnect it on the AI Traffic page - `ERR_WEB_ANALYTICS_UPSTREAM` (503): provider unavailable, provider quota exhausted, more than 20 uncached queries a minute, or too many running at once; wait for `Retry-After` seconds **Response:** ```json { "project_id": 1, "provider": "google_analytics", "property": "properties/123456789", "columns": [{ "name": "sessionDefaultChannelGroup", "kind": "dimension" }, { "name": "sessions", "kind": "metric" }], "rows": [["Organic Search", 1200], ["Direct", 480]], "row_count": 2, "total_rows": 2, "truncated": false, "notes": [], "meta": { "time_zone": "Europe/Madrid", "currency_code": "EUR" }, "fetched_at": "2026-10-07T10:00:00Z", "cached": false, "query": { "dateRanges": [{ "startDate": "28daysAgo", "endDate": "yesterday" }], "dimensions": [{ "name": "sessionDefaultChannelGroup" }], "metrics": [{ "name": "sessions" }], "limit": 100, "returnPropertyQuota": true }, "request_id": "..." } ``` --- ### GET /api/v1/metrics/agent_traffic Aggregated AI bot traffic for a project (server-side bot crawlers: GPTBot, PerplexityBot, ClaudeBot, etc.). **Scale plan or above required**; lower tiers get `ERR_PLAN_REQUIRED`. If the project has no agent-traffic source connected (Cloudflare, server-log drain, S3 logs, or imports), returns `ERR_AGENT_TRAFFIC_NOT_CONNECTED` (404) instead of empty data. **Parameters:** - `project_id` (required) - `range`, `from`, `to`: date range (defaults to last 30 days) - `bot`: filter by bot slug (e.g. `gptbot`, `claudebot`, `perplexitybot`) - `company`: filter by company (e.g. `openai`, `anthropic`, `google`) - `group_by`: `bot` (default) or `company` - `granularity`: `day` (default), `week`, `month` **Response:** ```json { "project_id": 1, "from": "2026-04-01", "to": "2026-04-27", "group_by": "bot", "granularity": "day", "totals": { "gptbot": 240, "claudebot": 88 }, "timeseries": { "gptbot": { "2026-04-26": 32, "2026-04-25": 28 }, "claudebot": { "2026-04-26": 12 } }, "request_id": "..." } ``` --- ### GET /api/v1/dimensions/agent_bots Returns the static catalog of AI bots that Agent Analytics can identify (slugs, display names, companies, categories, Cloudflare verified-bot category mapping, descriptions). Useful for rendering filter UIs that mirror our internal classification. Requires the Scale plan or above (returns `ERR_PLAN_REQUIRED` otherwise). The equivalent MCP tool `list_agent_bots` is available on the Scale plan or above. `project_id` is required by the published contract but ignored: the catalog is the same for every project. ```json { "bots": [ { "slug": "gptbot", "name": "GPTBot", "company": "openai", "category": "ai_crawler", "cf_verified_category": "AI Crawler", "description": "OpenAI ChatGPT training crawler" } ], "companies": ["openai", "anthropic", "google", "..."], "request_id": "uuid" } ``` ## Shopping & Ads Commercial surfaces inside AI answers: the product cards models return, the paid placements that run alongside them, and the local businesses they list for prompts with local intent. Shopping and ads need the **Scale plan or above**; lower tiers get `ERR_PLAN_REQUIRED`. Local businesses are available on every plan. The endpoints are named for what they measure (`shopping`, `ads`) rather than for the assistant that first returned it. The underlying storage has always carried the standard multi-model enum, so narrow with `model=` instead of reading the model out of the path. All three accept the standard listing filters (`model`, `collection_id`, `country_code`, `language_code`, `prompt`, `prompt_type`, `brand_kind`, `range` or `from`/`to`, `page`, `per_page`) plus `output` for flat/CSV, and both return a `totals` block matching the KPI cards in the app. ### GET /api/v1/dimensions/shopping Product cards returned inside AI answers. Parameters: `view` (`products` default, or `merchants`), `owned` (boolean, restrict to your own products), `query` (case-insensitive substring on the title), `order` + `direction`. - `view=products` orders by `appearances` (default), `price`, `rating` or `title`. - `view=merchants` orders by `appearances` (default), `products`, `avg_price`, `avg_rating` or `merchant`. A product is identified by its external product id, falling back to its title when the answer carries no usable one, so the same product merges across executions instead of splitting into one row per answer. ```json { "project_id": 123, "view": "products", "page": 1, "per_page": 20, "total": 42, "totals": { "products": 42, "your_products": 3, "merchants": 18, "avg_price": 84.5, "avg_price_currency": "USD", "avg_rating": 4.3, "executions_with_shopping": 96 }, "data": [ { "product_key": "sku-1", "title": "Pegasus 40", "domain": "nike.com", "url": "https://...", "merchants": "Nike + others", "currency": "USD", "currency_count": 1, "min_price": 120.0, "max_price": 130.0, "avg_rating": 4.6, "rating_votes": 812, "appearances": 12, "is_client": true, "best_rank": 2, "models": ["ai_mode", "chatgpt"], "last_seen_at": "2026-09-28T09:14:00Z" } ], "request_id": "uuid" } ``` `totals.avg_price` is computed inside ONE currency, the one most of the priced rows use, and `totals.avg_price_currency` names it. A project holding both pesos and dollars has no meaningful mean across them, so the block reports the dominant one rather than mixing. On `view=products`, `currency` names the money `max_price` is expressed in, and `currency_count` says how many currencies that product was priced in. A product sold in several markets carries one price per market, so when `currency_count` is above 1 the row reports its highest-priced listing and its currency, and `min_price` may be money of another kind. `view=merchants` returns rows of `{ merchant, appearances, products, currency, min_price, max_price, avg_price, avg_rating }`. `currency` names the money the price fields are expressed in. AI answers price each market in its own currency and carry no currency field of their own, so a merchant that sells in more than one reports the currency most of its prices use, and the range never mixes two kinds of money. It is null when no price on that merchant carried a currency we could resolve. Merchants are resolved from the seller domain first and from the card's free-text merchant name when the domain is blank, so multi-merchant cards are not dropped. `owned=true` narrows both views to your own products; on `view=merchants` that means the merchants selling them. The `totals` block stays account-wide either way, so it keeps working as the denominator. ### GET /api/v1/dimensions/ads Paid placements returned inside AI answers. Parameters: `view` (`advertisers` default, or `ads`), `owned` (boolean, `view=ads` only), `query` (substring on title, domain or snippet), `order` + `direction`. - `view=advertisers` orders by `ads` (default), `prompts`, `avg_position` or `domain`. `avg_position` and `domain` default to ascending; the others to descending. - `view=ads` orders by `recent` (default), `oldest` or `position`. The order already encodes a direction, so `direction` is ignored. Position 1 is the best slot, so a **lower** average position is better. ```json { "project_id": 123, "view": "advertisers", "page": 1, "per_page": 20, "total": 9, "totals": { "ads": 140, "advertisers": 9, "your_ads": 12, "your_share": 8.57, "avg_position": 3.4, "executions_with_ads": 88 }, "data": [ { "domain": "hubspot.com", "ads": 34, "executions": 30, "prompts": 22, "avg_position": 2.1, "best_position": 1 } ], "request_id": "uuid" } ``` `view=ads` returns rows of `{ id, model, title, snippet, url, domain, position, is_client, prompt_id, prompt_text, prompt_execution_id, executed_at }`. ### GET /api/v1/dimensions/local_businesses Local businesses (shops, restaurants, services) listed inside AI answers, one row per business. Available on every plan; team members need read access to Local Businesses. The MCP tool `list_local_businesses` returns the same payload. Parameters: `owned` (boolean, restrict to your own locations), `query` (case-insensitive substring on the name or address), `order` (`appearances` default, `business`, `rating`, `reviews`, `avg_position`, `prompts`) + `direction` (`desc` default). A business is its name at its address, so the same business merges across answers while two locations of a chain stay two rows. `avg_position` is its average rank in the answer's list (1 = first), and `reviews` is the highest review count any answer reported for it. ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 37, "totals": { "businesses": 37, "your_businesses": 2, "appearances": 410, "avg_rating": 4.4, "executions_with_local_businesses": 31 }, "data": [ { "business_key": "nike store gran via|gran via 31, madrid", "title": "Nike Store Gran Via", "address": "Gran Via 31, Madrid", "domain": "nike.com", "url": "https://...", "phone": "+34 910 000 000", "avg_rating": 4.5, "reviews": 3120, "avg_position": 1.4, "prompts": 6, "appearances": 18, "is_client": true, "competitor_id": null, "competitor_name": null } ], "request_id": "uuid" } ``` `owned=true` narrows the rows to your own locations; the `totals` block stays account-wide. ## Owned Media & Communities Which of your own channels and which community conversations AI answers cite. **Growth plan or above required**; lower tiers get `ERR_PLAN_REQUIRED`. The `/dimensions` endpoints default to the **last 30 days** when no window is given and accept the standard listing filters. ### GET /api/v1/dimensions/owned_media Owned-media citations for one platform. `provider` is **required** (`youtube`, `instagram`, `facebook`, `tiktok`, `linkedin`, `mobile_apps`); omitting it returns `ERR_INVALID_PARAM`. `view` depends on the provider: | provider | views | | --- | --- | | `youtube` | `videos` (default), `channels`, `own_citations`, `activity` | | `instagram`, `facebook`, `tiktok`, `linkedin` | `posts` (default), `profiles`, `own_citations`, `activity` | | `mobile_apps` | `apps` (with `store=google_play` default or `app_store`), `activity` | Every row on the platform is returned, each with a `yours` flag; `owned=true` keeps only your own. `provider=mobile_apps` returns at most the 500 most-cited apps, so `total` never exceeds 500. `view=activity` works with every provider. Each row has `date` (ISO date at the period start), nullable `entity_id`, `entity_name` and `entity_url`, boolean `yours` and integer `citations`. The activity counts use the selected date window. Periods without runs are omitted; a period with runs and no citation for that entity has a real zero. Entity details are current metadata, not historical snapshots. Mobile-app rows also have `store` and nullable integer `competitor_id`; `entity_name` currently contains the app ID, with no external lookup. `view=own_citations` returns the raw citations of the **connected profile only** and stays empty until a profile is connected in **Preferences > Project Settings > Social & Communities**. It is not a full citation feed for the platform. Video, post, channel and profile rows also carry `avg_position` (average position in the answers) and their image: `thumbnail_url` for videos and posts, `avatar_url` for channels and profiles. YouTube video rows add `video_id`, `channel_handle` and `channel_url`; channel rows add `key`, which `/dimensions/owned_media/citing_prompts` accepts as `profile`. Post rows add `content_type`; profile rows add `followers` and `url`. Reddit citation tables are at `/api/v1/dimensions/reddit`; its summary is at `/api/v1/dimensions/owned_media/summary?provider=reddit`. Team members need Social & Communities: profiles and apps, plus YouTube Intelligence for `youtube`. Also available as the MCP tool `list_owned_media`. ```json { "project_id": 123, "provider": "youtube", "view": "videos", "from": "2026-07-13T00:00:00Z", "to": "2026-08-12T23:59:59Z", "page": 1, "per_page": 20, "total": 57, "data": [ { "title": "Best CRM 2026", "url": "https://www.youtube.com/watch?v=...", "video_id": "...", "channel_name": "Acme", "channel_handle": "acme", "citations": 14, "avg_position": 2.4, "views": 92000, "published_at": "2026-05-02", "thumbnail_url": "https://...", "yours": true } ], "request_id": "uuid" } ``` ### GET /api/v1/dimensions/owned_media/summary One Owned Media tab's KPI cards, comparison and charts. `provider` is **required**: `youtube`, `instagram`, `facebook`, `tiktok`, `linkedin`, `mobile_apps`, `reddit`, or `overview` for every platform. Filters are unchanged from the listing: `model`, `collection_id`, `country_code`, `language_code`, `brand_kind`, `range`, `from`, `to`. In `kpis`, `total` counts every citation and `yours` counts citations on the account's own profiles and content, with `share_pct`; providers that split owned citations also return `your_profile` and `your_content`. `previous` holds the same KPIs for the equally long period before `from`, and `changes` gives the differences (percent for counts, percentage points for `share_pct` and `positive_pct`, `null` when there is nothing to compare). `weekly` remains the Monday-anchored weekly series. All providers return `activity`, with one row per actual project reporting period: `date` (period start), `citations`, `yours` and `other`. `yours` and `other` are null for `overview`. Periods without runs are omitted; a period with runs and no citation has zero. Activity counts use the selected date window. The `overview` response also gives each readable platform's activity under `platforms[].activity`, with `date` and `citations`. Charts also include `by_model` and `by_country`. Social and YouTube providers return `content_types` and `age_buckets`; `mobile_apps` adds per-store `stores`. For `provider=reddit`, `kpis` adds `unique_subreddits`, `unique_authors` and `positive_pct` (positive sentiment among rated citations); `share_pct` is the share of citations on owned subreddits. Reddit adds `positive`, `neutral` and `negative` counts to each `activity` row; they describe sentiment of the AI answers citing Reddit. `subreddit_activity` rows have `date`, `subreddit`, `is_others` and `citations`; each period includes the top five subreddits and an `Others` aggregate (`subreddit` is null and `is_others` is true). `positions` rows have `bucket`, `citations` and `share_pct` for `position_1`, `position_2_3`, `position_4_7` and `position_7_plus`. `brand_share` rows have `actor_id`, `actor_name`, `is_brand`, `citations` and `share_pct` for the tracked brand and competitors. Team members need Social & Communities: profiles and apps for the endpoint, plus Reddit Intelligence for `provider=reddit` or YouTube Intelligence for `provider=youtube`. MCP tool `get_owned_media_summary`. ### GET /api/v1/dimensions/owned_media/citing_prompts The answers behind one Social & Communities row: `provider` (**required**: `youtube`, `instagram`, `facebook`, `tiktok`, `linkedin`) plus exactly one of `url` (post or video) or `profile` (a handle, a profile or channel URL, or a channel `key`); both or neither is `ERR_INVALID_PARAM`. Returns the cited `item` (title, image, owner, whether it is yours, stats), `citation_count`, `prompt_count` and a page (`page`, `per_page`, `output`) of citing answers, newest first, with a plain-text `excerpt`. As it shows prompt and answer text, team members also need Prompts (and YouTube Intelligence for YouTube). MCP tool `list_owned_media_citing_prompts`. **Response per answer:** ```json { "answer_id": 9001, "prompt_id": 10, "prompt_text": "best CRM videos", "model": "chatgpt", "country_code": "US", "language_code": "en", "executed_at": "...", "excerpt": "...", "app_url": "https://..." } ``` ### GET /api/v1/dimensions/reddit Reddit content cited by AI answers. Parameters: `view` (`subreddits` default, `authors`, `threads`, `breakdowns`), `subreddit`, `author`, `status` (`open` or `archived`, threads only), `owned` (boolean), `brand` (`brand` or a competitor id, matched in the **scraped Reddit content**, not the AI answer), `order` + `direction`: subreddits sort by `citations`, `subreddit`, `unique_authors`, `positive_pct`, `negative_pct`; authors by `citations`, `author`; threads by `citations`, `subreddit`, `author`, `avg_position`, `upvotes`, `comments`, `sentiment`. `view=breakdowns` gives the **Social & Communities > Reddit > Sentiment and breakdowns** figures: rows of `breakdown` (`sentiment` of the citing answer, `model`, `country`), `key`, `count`, `pct`, plus `citations`. ```json { "project_id": 123, "view": "subreddits", "from": "2026-07-13T00:00:00Z", "to": "2026-08-12T23:59:59Z", "page": 1, "per_page": 20, "total": 23, "data": [ { "subreddit": "crm", "citations": 41, "unique_authors": 18, "positive": 22, "negative": 5, "neutral": 14, "positive_pct": 53.7, "negative_pct": 12.2, "yours": false, "url": "https://www.reddit.com/r/crm/" } ], "request_id": "uuid" } ``` ### GET /api/v1/projects/:id/owned_media The profiles whose citations count as yours (**Preferences > Project Settings > Social & Communities**). Per platform (YouTube, app stores, Instagram, Facebook, TikTok, LinkedIn, Reddit), `platforms` gives `connected`, `max_extra_profiles` and the `profiles` (main, extras and, on Reddit, claimed subreddits and usernames) with their `scrape_status`. `settings` holds the current value of every field `PATCH` accepts. MCP tool `get_owned_media_profiles`. **Response:** ```json { "project_id": 123, "platforms": [ { "platform": "mobile_apps", "connected": true, "max_extra_profiles": 10, "profiles": [ { "url": "https://apps.apple.com/...", "handle": "...", "kind": "app", "main": true, "store": "app_store", "name": "Acme", "avatar_url": "https://...", "scrape_status": "..." } ] } ], "settings": { "app_store_url": "https://apps.apple.com/...", "mobile_apps_extra_profile_urls": [] }, "request_id": "uuid" } ``` ### PATCH /api/v1/projects/:id/owned_media Sets or clears those profiles; send only the fields to change. URLs, cleared by `""` or `null`: `youtube_channel_url`, `app_store_url`, `google_play_url`, `instagram_profile_url`, `facebook_page_url`, `tiktok_profile_url`, `linkedin_company_url`. Lists replace the stored one (`[]` clears): `_extra_profile_urls` for `youtube`, `mobile_apps`, `instagram`, `facebook`, `tiktok`, `linkedin` (max 10 each), `reddit_subreddits` (max 10), `reddit_usernames` (max 25). URLs are validated and normalized like Project Settings; anything refused returns `ERR_INVALID_PARAM` and applies nothing. New profiles are scraped in the background for name and avatar (`profile_scrapes_queued`). Returns the `GET` payload plus `updated_fields`. Team members need Social & Communities: profiles and apps: Create, plus YouTube Intelligence: Create for the YouTube channel and Projects: Update for the extra profile and Reddit lists. MCP tool `update_owned_media_profiles`. ## Reputation & Studies Multi-model analyst reports. Both surfaces require **reputation monitoring** to be enabled on the account (it comes with Scale and above, or as an entitlement); otherwise every endpoint returns `ERR_PLAN_REQUIRED`. Scores are produced by several analyst models independently. Compare models rather than averaging them blindly, and use `model=` when you want a single view. ### GET /api/v1/reputation/reports Lists the monthly reputation reports for a project, newest first. Pending and failed reports are included on purpose: whether this month ran at all is often the question being asked. Parameters: `project_id` (required), `page`, `per_page`, `output`. ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 12, "data": [ { "id": "abc123", "status": "completed", "created_at": "2026-08-01T03:12:00Z", "processed_at": "2026-08-01T04:02:00Z", "available_models": ["chatgpt", "perplexity"], "missing_models": ["gemini", "deepseek", "grok", "claude"], "error_message": null } ], "request_id": "uuid" } ``` ### GET /api/v1/reputation/reports/:id One report's scores as flat rows: one row per (analyst model, brand, dimension, attribute). Parameters: `project_id` (required), `model` (one of `chatgpt`, `perplexity`, `gemini`, `deepseek`, `grok`, `claude`), `brand` (a name or a comma-separated list; matched exactly, not by substring), `dimension`, `page`, `per_page`, `output`. `total` counts the rows the filters produced. An unknown `model` returns `ERR_INVALID_PARAM` rather than an empty list. ```json { "project_id": 123, "report": { "id": "abc123", "status": "completed", "available_models": ["chatgpt"], "missing_models": ["..."] }, "page": 1, "per_page": 20, "total": 84, "data": [ { "brand": "My Brand", "is_project": true, "model": "chatgpt", "report_date": "2026-08-01", "dimension": "general_perception", "dimension_name": "General Perception of Reputation", "attribute": "reputation", "attribute_name": "Overall market perception and reputation", "score": 85, "reasoning": "Well regarded across trade press" } ], "request_id": "uuid" } ``` ### GET /api/v1/studies Lists the custom AI studies defined on the account: analyst reports over any set of subjects (brands, sectors, topics) and any set of dimensions. Studies belong to the **account**, not to a project. `project_id` is therefore an optional filter, and account-level studies (those with no project) are returned whichever project you filter by. A team member whose project access is restricted sees only the studies of the projects they can reach, the same set as in the app. Parameters: `project_id` (optional), `status` (`active` or `archived`), `page`, `per_page`, `output`. ```json { "page": 1, "per_page": 20, "total": 4, "data": [ { "id": 17, "title": "European tourism perception", "study_type": "geo", "cadence": "one_shot", "status": "active", "project_id": 123, "subjects_count": 2, "ai_models": ["chatgpt", "perplexity"], "output_language_code": "en", "created_at": "2026-06-02T09:00:00Z", "last_report_at": "2026-08-01T04:00:00Z" } ], "request_id": "uuid" } ``` ### GET /api/v1/studies/:id One study with its brief, the subjects it compares, the dimensions it scores them on, and its report history (most recent 24). Use the ids in `reports` with the endpoint below. ```json { "id": 17, "title": "European tourism perception", "study_type": "geo", "status": "active", "brief": "Compare perceived safety and value for money.", "subjects": ["Spain", "France"], "dimensions": ["custom_safety", "custom_value"], "reports": [ { "id": "rpt789", "status": "completed", "available_models": ["chatgpt"] } ], "request_id": "uuid" } ``` ### GET /api/v1/studies/:id/reports/:report_id One custom-study report's scores as flat rows, in the same shape the reputation report scores use: one row per (analyst model, subject, dimension, attribute). Parameters: `model`, `subject` (a name or comma-separated list, matched exactly), `dimension`, `page`, `per_page`, `output`. ### POST /api/v1/reputation/reports Starts this month's reputation report for a project, like the **Generate** button on the Reputation page. MCP tool `create_reputation_report`. Needs a `read_write` key; team members need Reputation: Create. **Request body (JSON):** `{ "project_id": 123, "recalculate": false }` | Parameter | Required | Description | | --- | --- | --- | | `project_id` | Yes | The project | | `recalculate` | No | `true` uses the month's one manual recalculation (the **Recalculate This Month** button) instead of returning the existing report. Default `false` | - Without `recalculate`: `201` with the new report (`status` `pending`). When the month already holds a report that did not fail, still running or finished, nothing new starts: `200` with `created: false` and that report. - With `recalculate: true`: a fresh run across every analyst model. `201` when it starts, `200` with `created: false` while a report is still running, and `ERR_LIMIT_REACHED` once the month holds two reports (the monthly report plus one recalculation). - `ERR_RATE_LIMITED` (429): another request is starting a report for the same project. Retry after a few seconds. Generation runs in the background. Poll `GET /api/v1/reputation/reports` until `status` is `completed`, then read the scores with `GET /api/v1/reputation/reports/:id`. A completed report can list models in `missing_models` while their analysts are still finishing; if they stay missing, a recalculation runs every model again. ```json { "project_id": 123, "created": true, "report": { "id": "abc123", "status": "pending", "created_at": "2026-11-05T10:40:00Z", "processed_at": null, "available_models": [], "missing_models": ["chatgpt", "perplexity", "gemini", "deepseek", "grok", "claude"], "error_message": null }, "request_id": "uuid" } ``` ## Search Console Google Search Console performance data (impressions, clicks, CTR, average position) for projects that have connected GSC properties (up to 10) in **Preferences > Project Settings > Data Connections**. **Growth plan or above required**; lower tiers get `ERR_PLAN_REQUIRED`. If the project has no connected property, every read returns `ERR_SEARCH_CONSOLE_NOT_CONNECTED` (404). MCP tools: `list_search_console_properties` and `get_search_console_` for each read below (e.g. `get_search_console_brand_split`). The `X-Search-Console-Backend` response header identifies `stored` or `live` reads. Stored reads use synced daily totals (overall, by country and by device) without contacting Google; they cannot answer `/queries`, `/pages`, `/rows`, the five reports, a `page`, `query` or `searchAppearance` breakdown or a narrowed request, and reject those with `ERR_INVALID_PARAM`. Live reads return `ERR_SEARCH_CONSOLE_ACCESS_REVOKED` (403) when Google revoked the connection's access (reconnect the property in Data Connections) and `ERR_SEARCH_CONSOLE_UPSTREAM` (503) when Google is unavailable or over quota: retry after `Retry-After` seconds (MCP tools: `retry_after`). Notes for every read but `/properties`: - `property`: omitted, the primary; one id (e.g. `sc-domain:example.com`), that one; both answer with `property`. A comma-separated list or `all` combines them, answering with `properties` (in the figures), `excluded_properties` (already counted by another selected one, e.g. a URL prefix under a domain; `covered_by`) and `property_errors` (refused by Google, left out; also the `X-Search-Console-Property-Errors` header). If Google refuses all, it fails like a single-property read. Unknown id: `ERR_INVALID_PARAM`. Combined `data_through` is the earliest date all reach. - `project_id` is required. Date range via `from` + `to` (`YYYY-MM-DD`) or `range` (days, today included); defaults to the last 30 days. The request window is capped at 487 days (Google's 16-month API window); `stored` retains up to 400 days of synced data and rejects an older start date with `ERR_INVALID_PARAM`, which does not change the 487-day request cap. - `ctr` is a 0..1 fraction (`0.0421` = 4.21%), as in the Search Console API; `position` is the impression-weighted average position (lower is better). - Summary and timeseries totals are Google's own figures for the request, `filters` included, matching Search Console for the same settings. `/queries`, `/pages` and `/rows` list Google's top rows for the range and query rows exclude anonymized queries, so their rows do not add up to those totals. To total a set of pages or queries (for example every URL containing `/blog/`), call `/search_console/summary` with that filter and no `dimension`; never add up rows. - Google publishes GSC data with a 2-3 day lag. Every response includes `data_through`, the latest date with data (with `output=csv`, the `X-Data-Through` header); missing recent rows are not zero traffic. - The summary `dimension=country` breakdown returns lowercase ISO alpha-3 codes as Google provides them (e.g. `usa`, `gbr`, plus the `zzz` unknown-country sentinel). `device` is lowercased the same way. `page` and `query` keep the casing Google returns, because a page URL is case sensitive. The summary's `limit` caps breakdown rows, sorted by impressions (default and maximum 1000); `/queries` and `/pages` paginate a full list. - Four narrowing parameters map one to one onto Google's Search Analytics query: - `search_type`: `web` (default), `image`, `video`, `news`, `discover`, `googleNews`. `discover` and `googleNews` carry no query dimension, so Google rejects `/search_console/queries` for them. - `filters`: an array of `{ dimension, operator, expression }` objects, sent as a single AND group. `dimension` is one of `country`, `device`, `page`, `query`, `searchAppearance`. `operator` is one of `contains` (default), `equals`, `notContains`, `notEquals`, `includingRegex`, `excludingRegex`; the two regex operators take RE2 syntax. At most 10 filters per request, each `expression` up to 500 characters. In a query string, send the whole list as one JSON value: `filters=[{"dimension":"page","operator":"contains","expression":"/blog/"}]` (URL-encoded). The older bracket form (`filters[][dimension]=page&...`) still works. - `data_state`: `final` (default) counts only finalized rows; `all` adds the most recent days, still being filled in. - `aggregation_type`: how Google counts impressions: `auto` (default, what Search Console shows), `byPage` or `byProperty`. Google rejects `byProperty` with a `page` dimension or filter. - A request Google itself refuses, such as an unsupported combination of search type and dimension, comes back as `ERR_INVALID_PARAM` carrying Google's reason. - For `/queries`, `/pages` and `/rows`, `total` counts the rows returned by one Google request, up to 25,000; `truncated: true` means that limit was reached (with `output=csv`, the `X-Truncated: true` header). Google ranks rows by clicks, so `start_row` moves that window down the ranking (`start_row=25000` for the next block). Sorting and pagination apply to the available set. ### GET /api/v1/search_console/properties The project's connected properties, primary first: the values `property` accepts. `type` is `domain` or `url_prefix`; `status` is `connected` or `reconnect_required`; an empty `data` means no connection. ```json { "project_id": 1, "max_properties": 10, "data": [ { "id": "sc-domain:example.com", "name": "sc-domain:example.com", "primary": true, "type": "domain", "status": "connected", "last_synced_at": "2026-04-30T06:10:00+02:00" } ], "request_id": "..." } ``` ### GET /api/v1/search_console/summary Totals for the range. Pass `dimension` to also get the breakdown aggregated over the range. `breakdown_truncated: true` means the breakdown left rows out, because of `limit` or Google's 25,000-row maximum. Besides the anonymized queries, `page` and `searchAppearance` rows are counted per page rather than per property, so breakdown rows can differ from the totals. **Parameters:** - `dimension`: optional breakdown, one of `country`, `device`, `page`, `query`, `searchAppearance`, `property` ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "totals": { "impressions": 152340, "clicks": 6410, "ctr": 0.0421, "position": 12.7 }, "dimension": "device", "breakdown": [ { "value": "mobile", "impressions": 98120, "clicks": 4010, "ctr": 0.0409, "position": 13.1 }, { "value": "desktop", "impressions": 50120, "clicks": 2280, "ctr": 0.0455, "position": 11.9 } ], "request_id": "..." } ``` ### GET /api/v1/search_console/timeseries Series bucketed by `granularity`: `day` (default), `week` or `month`. ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "granularity": "day", "data": [ { "date": "2026-04-01", "impressions": 5120, "clicks": 210, "ctr": 0.041, "position": 12.9 }, { "date": "2026-04-02", "impressions": 4980, "clicks": 198, "ctr": 0.0398, "position": 13.0 } ], "request_id": "..." } ``` ### GET /api/v1/search_console/queries Top search queries for the range, paginated. **Parameters:** - `sort`: `impressions` (default), `clicks`, `ctr`, `position` - `page` (default 1), `per_page` (default 20, max 100), `start_row` (default 0) ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "page": 1, "per_page": 20, "total": 4821, "sort": "impressions", "data": [ { "key": "example brand reviews", "impressions": 8120, "clicks": 540, "ctr": 0.0665, "position": 4.2 } ], "request_id": "..." } ``` ### GET /api/v1/search_console/pages Top landing pages, as `/search_console/queries` but each row's `key` is a page URL. A URL with a fragment (`/post/#section`, a table-of-contents jump link) is merged into its base URL; the query string stays. ### GET /api/v1/search_console/rows Rows grouped by up to three dimensions, for example which queries bring traffic to which pages (`dimensions=page,query`) or each page day by day (`dimensions=date,page`). Each requested dimension is its own field in the row. A `page` value with a fragment is merged into its base URL. **Parameters:** - `dimensions` (required): comma-separated, 1 to 3 of `date`, `country`, `device`, `page`, `query`, `searchAppearance`, `property` - Every other parameter as in `/search_console/queries` ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "page": 1, "per_page": 20, "total": 25000, "sort": "impressions", "truncated": true, "dimensions": ["page", "query"], "data": [ { "page": "https://example.com/hotels", "query": "example hotels", "impressions": 3120, "clicks": 210, "ctr": 0.0673, "position": 3.8 } ], "request_id": "..." } ``` ### GET /api/v1/search_console/opportunities Queries at average position 4 to 20 (`min_position`, `max_position`) with 100+ impressions (`min_impressions`), ranked by `potential_clicks` = `impressions x top_ctr - clicks` (`top_ctr`: CTR of the property's top-3 queries). ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "min_impressions": 100, "min_position": 4.0, "max_position": 20.0, "top_ctr": 0.1812, "page": 1, "per_page": 20, "total": 214, "data": [ { "query": "best crm for agencies", "impressions": 6400, "clicks": 96, "ctr": 0.015, "position": 6.3, "potential_clicks": 1064 } ], "request_id": "..." } ``` ### GET /api/v1/search_console/cannibalization Queries (`min_impressions`, default 100) split between two or more pages that each take at least `min_share` of the impressions (default 0.1); flat/CSV rows are per page (`page_url`). Jump links of one page (`/post/#section`) are merged into the base URL first, so a page never competes with itself. ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "min_impressions": 100, "min_share": 0.1, "page": 1, "per_page": 20, "total": 12, "data": [ { "query": "crm pricing", "impressions": 3000, "clicks": 90, "ctr": 0.03, "position": 7.1, "pages": [ { "page": "https://example.com/pricing", "share": 0.6, "impressions": 1800, "clicks": 70, "ctr": 0.0389, "position": 5.2 }, { "page": "https://example.com/blog/crm-cost", "share": 0.4, "impressions": 1200, "clicks": 20, "ctr": 0.0167, "position": 9.9 } ] } ], "request_id": "..." } ``` ### GET /api/v1/search_console/decay Pages (with `dimension=query`, queries) losing the most clicks against the previous window of equal length, from `min_clicks` earlier clicks (default 10), up to `compared_through`, Google's last published day. When `truncated`, keys missing from the current window are skipped. Page URLs with a fragment (`/post/#section`) are merged into their base URL. ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "dimension": "page", "compared_through": "2026-04-28", "previous_from": "2026-03-04", "previous_to": "2026-03-31", "min_clicks": 10, "page": 1, "per_page": 20, "total": 38, "data": [ { "key": "https://example.com/guide", "clicks": 120, "clicks_previous": 410, "clicks_change": -290, "clicks_change_pct": -70.7, "impressions": 9100, "impressions_previous": 15200, "position": 8.4, "position_previous": 4.1 } ], "request_id": "..." } ``` ### GET /api/v1/search_console/brand_split Impressions and clicks of queries naming the brand (`brand_terms` as whole words, ignoring case and accents) and of the rest; `unclassified` is anonymized queries. No `output`. ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "brand_terms": ["example", "example app", "example.com"], "totals": { "impressions": 152340, "clicks": 6410, "ctr": 0.0421, "position": 12.7 }, "branded": { "impressions": 30200, "clicks": 4100, "ctr": 0.1358, "position": 2.1 }, "non_branded": { "impressions": 98400, "clicks": 1900, "ctr": 0.0193, "position": 15.8 }, "unclassified": { "impressions": 23740, "clicks": 410 }, "request_id": "..." } ``` ### GET /api/v1/search_console/ai_visibility_gaps Top queries (`min_impressions`, default 100) matched to a prompt with the same text or, failing that, to a prompt whose AI answers ran that same search in the window, ignoring case, accents, spacing and edge punctuation in both, with its `prompt_id`, `match_type` (`prompt`, `fan_out` or null), `responses` and `brand_visibility`. When several prompts ran a search, the one with the most answers running it wins, then the oldest. Only some models report their searches, mainly ChatGPT, and they are usually much longer than a Google query, so `fan_out` matches are few. `unmatched_only=true` keeps only unmatched ones. Members need Overview read access, and without Query Fan-Out read access they get only the text matches. ```json { "project_id": 1, "property": { "id": "sc-domain:example.com", "name": "sc-domain:example.com" }, "from": "2026-04-01", "to": "2026-04-30", "data_through": "2026-04-28", "min_impressions": 100, "unmatched_only": false, "matched_count": 3, "page": 1, "per_page": 20, "total": 180, "data": [ { "query": "best crm for agencies", "impressions": 6400, "clicks": 96, "ctr": 0.015, "position": 6.3, "prompt_id": 812, "responses": 40, "brand_visibility": 42.5, "match_type": "prompt" }, { "query": "crm pricing comparison", "impressions": 3200, "clicks": 51, "ctr": 0.016, "position": 7.1, "prompt_id": 815, "responses": 40, "brand_visibility": 25.0, "match_type": "fan_out" }, { "query": "crm with whatsapp", "impressions": 2100, "clicks": 40, "ctr": 0.019, "position": 8.8, "prompt_id": null, "responses": null, "brand_visibility": null, "match_type": null } ], "request_id": "..." } ``` --- ## Custom Reports The reports built in the app's Custom Reports section. Scale plan and above (`ERR_PLAN_REQUIRED` below). Recipient addresses, the shared-link token and the password are never returned. ### GET /api/v1/custom_reports The project's reports, newest first (`project_id` required; `page`, `per_page`, `output`): date range (`rolling` or `previous_month`), schedule, recipient count, publishing, shared-link and portal state, widgets and last send. MCP tool `list_custom_reports`. **Response:** ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 1, "data": [ { "id": 42, "name": "Monthly visibility", "date_range": { "type": "rolling", "range_days": 28 }, "schedule": { "enabled": true, "day_of_week": 1, "hour": 9, "timezone": "Europe/Madrid" }, "recipients_count": 3, "published": true, "public_link_active": true, "password_protected": false, "portal_only": false, "widget_count": 1, "widgets": [ { "key": "visibility_kpis", "label": "Visibility", "kind": "kpi_grid" } ], "last_sent_at": "...", "created_at": "...", "updated_at": "..." } ], "request_id": "uuid" } ``` ### GET /api/v1/custom_reports/:id Read-only: one report's settings (date range with today's `from`, `to` and `label`, filters, schedule, previous-period comparison, block layout) and every widget computed now, as its page, shared link and PDF show it. A widget's `data` holds `series` (timeseries), `slices` (donut), `bars` (bar), `values` and `changes` (kpi_grid) or `rows` (table); with its data source not connected, `available: false` and `data: null`. MCP tool `get_custom_report`. **Response (excerpt):** ```json { "project_id": 123, "id": 42, "date_range": { "type": "rolling", "range_days": 28, "from": "2026-09-17", "to": "2026-10-14", "label": "..." }, "filters": { "models": ["chatgpt"], "collection_ids": [5], "brand_kind": null, "competitor_ids": [7] }, "compare_previous": true, "blocks": [ { "type": "widget", "key": "visibility_kpis", "text": null } ], "widgets": [ { "key": "visibility_kpis", "label": "Visibility", "kind": "kpi_grid", "width": "full", "available": true, "data": { "values": {}, "changes": {} } } ], "request_id": "uuid" } ``` ### POST /api/v1/custom_reports/:id/send Emails the report to its recipients now, like **Send now** (body: `project_id`). It must be published and have recipients (else `ERR_INVALID_PARAM`); each report can be sent once every 10 minutes (`429 ERR_RATE_LIMITED` with `Retry-After`). A report made in a white-label portal, or a request on a portal host, gets `ERR_INTEGRATION_UNAVAILABLE`. Team members need Custom Reports: Update. MCP tool `send_custom_report`. **Response (202):** ```json { "project_id": 123, "id": 42, "status": "queued", "recipients_count": 3, "request_id": "uuid" } ``` --- ## Recommendations These endpoints expose the same recommendation runs that power the in-app recommendations experience: read them, launch a new run, and complete, archive or restore an item. ### GET /api/v1/recommendations Lists recommendation runs for a project. **Parameters:** - `project_id` (required) - `recommendation_type` (optional): `ai_visibility`, `social_community`, `brand_building`, `sentiment_reputation` (Scale or above; without it those runs are not listed and answer `ERR_NOT_FOUND`). Invalid values → `ERR_INVALID_PARAM`. - `status` (optional): `pending`, `processing`, `completed`, `failed`. Invalid values → `ERR_INVALID_PARAM`. - `page`, `per_page` (pagination) **Response per item:** ```json { "id": 1101, "project_id": 1, "recommendation_type": "brand_building", "status": "completed", "error_message": null, "generated_at": "2025-01-31T12:15:00Z", "created_at": "2025-01-31T12:00:00Z", "updated_at": "2025-01-31T12:15:00Z", "total_recommendations": 3, "high_priority_count": 1, "summary": { "total_recommendations": 3, "high_priority_count": 1 }, "context": { "domain": "mybrand.com" } } ``` ### GET /api/v1/recommendations/:id Returns one recommendation run with its items and report data. **Parameters:** - `project_id` (required) - `id` (required path param) - `item_status` (optional): `active`, `completed`, `archived`. Invalid values → `ERR_INVALID_PARAM`. - `resolve_source_refs` (optional, default: `true`): when `true`, each item includes resolved source references from the stored report indexes **Response highlights:** - top-level recommendation metadata, summary, context (the run's domain, type, language, date and what it analyzed; the generator's own diagnostics are left out, in `report_data.context` too), and raw `report_data` - `item_counts` grouped by `active`, `completed`, and `archived` - `items` array with title, priority, action steps, metadata, and source references - `resolved_source_refs` for each item when enabled ### POST /api/v1/recommendations Launch a new recommendations generation for a project (same engine as the in-app Recommendations page). The generation runs as a background job (1-3 minutes); poll `GET /api/v1/recommendations/:id` until `status` is `completed`. **Request body (JSON):** ```json { "project_id": 123, "recommendation_type": "ai_visibility" } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `recommendation_type` | No | One of `ai_visibility` (default), `social_community`, `brand_building`, `sentiment_reputation` | **Response (201):** ```json { "project_id": 123, "recommendation": { "id": 42, "recommendation_type": "ai_visibility", "status": "pending", "created_at": "..." }, "request_id": "uuid" } ``` **Notes:** - Consumes the project weekly recommendation-item budget (shared across all types). When it is exhausted, returns `ERR_LIMIT_REACHED` with the reset time. - `sentiment_reputation` requires the Scale plan or above (`ERR_PLAN_REQUIRED` otherwise). - If a generation of the same type is already pending or processing, returns `ERR_LIMIT_REACHED` instead of stacking a duplicate run. - Also available as the MCP tool `launch_recommendations`. ### PATCH /api/v1/recommendations/:id/items/:item_id Sets one item's `status` (required, with `project_id`): `completed`, `archived` or back to `active`, like the Recommendations page buttons. With `archived`, an optional `reason` (`not_relevant`, `too_complex`, or `competitor` on an item with `metadata.domain`) is returned as `metadata.archive_reason`; one that does not apply is `ERR_INVALID_PARAM`. Returns the `item` as `GET /recommendations/:id` lists it; `ERR_NOT_FOUND` for a run or item outside the project. Team members need Recommendations: Create. MCP tool `update_recommendation_item`. **Response:** ```json { "project_id": 123, "item": { ... }, "request_id": "uuid" } ``` --- ## GEO Writer GEO Writer tasks are processed asynchronously: create one, then poll it until `status` is `completed`. ### POST /api/v1/intelligence_tasks Create a GEO Writer task. The task is processed asynchronously in the background. **Request body (JSON), prompt-based mode:** ```json { "project_id": 123, "task_type": "create", "prompt_id": 456, "user_instructions": "Focus on enterprise features and include competitor comparison", "output_language_code": "en" } ``` **Request body (JSON), agentic mode (no prompt):** ```json { "project_id": 123, "task_type": "brief", "custom_topic": "AI visibility tools for agencies", "user_instructions": "Target mid-size marketing agencies", "output_language_code": "en" } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `task_type` | Yes | One of: `brief`, `create`, `update`, `pr_insights`, `custom`, `product_listing` | | `prompt_id` | No | Prompt ID to base the task on. Omit for agentic mode | | `custom_topic` | No | Topic for agentic mode (required if no prompt_id and no user_instructions) | | `user_instructions` | No | Custom instructions to refine the output | | `output_language_code` | No | Output language (default: project language) | | `existing_content` | No | Existing content to optimize (for `update` type) | | `existing_content_url` | No | URL of existing content (for `update` type) | | `product` | For `product_listing` | The store product: `title` (required), `external_id`, `description_html`, `seo_title`, `seo_description`, `url`, `product_type`, `images` (up to 20 of `id` and `alt`) | | `prompt_ids` | No | `product_listing` only: up to 20 project prompts the copy should answer | **Response (201):** ```json { "id": 789, "public_id": "abc123def", "project_id": 123, "task_type": "create", "title": "Create: best CRM software 2026", "status": "pending", "prompt_id": 456, "prompt_text": "best CRM software 2026", "agentic_mode": false, "user_instructions": "Focus on enterprise features...", "output_language_code": "en", "estimated_time": "3-5 minutes", "created_at": "2026-04-08T10:00:00Z", "request_id": "uuid" } ``` **Notes:** - Returns `ERR_QUOTA_EXCEEDED` if the monthly task limit is reached - Tasks are processed asynchronously (2-5 minutes). Poll `GET /intelligence_tasks/:id` for status - Task types: `brief` (content brief), `create` (write article), `update` (optimize existing), `pr_insights` (media opportunities), `custom` (custom analysis), `product_listing` (ready-to-apply product page copy for a store product, API only) - A completed `product_listing` task returns `result_data` with `title`, `summary`, `description_html` (only `p`, `ul`, `ol`, `li`, `strong`, `em`, `h3` and `br`), `faq` (`question`, `answer`), `seo_title`, `seo_description`, `image_alts` (`image_id`, `alt`), `changes` (`field`, `reason`) and `labels`. Edit and revert it like any other task ### GET /api/v1/intelligence_tasks List GEO Writer tasks for a project. **Parameters:** | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `task_type` | No | Filter by type (brief, create, update, pr_insights, custom, product_listing) | | `status` | No | `pending`, `processing`, `review`, `completed`, `in_progress` or `blocked` (discarded tasks are never listed) | | `page` | No | Page number (default: 1) | | `per_page` | No | Results per page (default: 20, max: 100) | **Response:** ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 5, "data": [ { "id": 789, "public_id": "abc123def", "task_type": "create", "title": "Enterprise CRM Comparison Guide", "status": "completed", "prompt_id": 456, "prompt_text": "best CRM software 2026", "word_count": 2450, "manually_edited_at": null, "created_at": "2026-04-08T10:00:00Z", "processed_at": "2026-04-08T10:03:00Z", "result_version": "1775642580" } ], "request_id": "uuid" } ``` ### GET /api/v1/intelligence_tasks/:id Get a single GEO Writer task with full details and result data (when completed). **Parameters:** `project_id` (required), `:id` (task ID in URL) **Response:** ```json { "id": 789, "public_id": "abc123def", "project_id": 123, "task_type": "create", "title": "Enterprise CRM Comparison Guide", "status": "completed", "prompt_id": 456, "prompt_text": "best CRM software 2026", "agentic_mode": false, "custom_topic": null, "user_instructions": "Focus on enterprise features...", "output_language_code": "en", "word_count": 2450, "result_data": { "...": "full generated content as JSON" }, "error_message": null, "manually_edited_at": null, "edited_by_user_id": null, "created_at": "2026-04-08T10:00:00Z", "processed_at": "2026-04-08T10:03:00Z", "result_version": "1775642580", "request_id": "uuid" } ``` **Notes:** - `result_data` is `null` until status is `completed` - `error_message` is `null` unless status is `blocked` (failed) - Accepts task ID (numeric) or public_id (string token) - `manually_edited_at` and `edited_by_user_id` are `null` until the content is edited by hand (see `PATCH /api/v1/intelligence_tasks/:id`) - `result_version` is the opaque token to send back with an edit: `"0"` until the task first completes, then it changes on each generation or regeneration, never on a manual edit or a revert - `cms_drafts`: WordPress drafts sent from the task (`POST .../send_to_cms`), absent on white-label portal hosts ### PATCH /api/v1/intelligence_tasks/:id Edit the text of a completed GEO Writer task in place. Only string fields that already exist in `result_data` can change; sections cannot be added or removed. The first edit keeps a copy of the generated output so it can be restored with `POST /api/v1/intelligence_tasks/:id/revert`. **Request body (JSON):** ```json { "project_id": 123, "result_version": "1775642580", "edits": { "title": "How to measure AI visibility in 2026", "sections.0.content": "AI visibility is the share of AI answers that mention your brand." } } ``` **Parameters:** | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `:id` | Yes | Task ID (numeric) or public_id, in the URL | | `edits` | Yes | Object mapping dotted `result_data` paths to replacement text | | `result_version` | No | The task's `result_version` from your last read (see Notes) | **Path format:** keys walk `result_data` with dots and zero-based array indexes: `title`, `sections.0.content`, `key_points.2`, `draft.0.title`. Read the task first to see which paths exist. Fields such as `labels`, `confidence`, `sources_used` and `editor_notes` are not editable. **Response:** the full task (same shape as `GET /api/v1/intelligence_tasks/:id`) plus `changed_paths`, the list of paths whose text actually changed. ```json { "id": 789, "public_id": "abc123def", "project_id": 123, "task_type": "create", "title": "How to measure AI visibility in 2026", "status": "completed", "word_count": 2438, "result_data": { "...": "the edited content as JSON" }, "manually_edited_at": "2026-09-09T12:00:00Z", "edited_by_user_id": 42, "changed_paths": ["title", "sections.0.content"], "request_id": "uuid" } ``` **Notes:** - Team members need edit access to GEO Writer - The task must be `completed`. A path that does not resolve to text, a blank `title`, a value over 20,000 characters or an empty `edits` object returns `422 ERR_INVALID_PARAM` and nothing is written - Values identical to the stored text are ignored, so re-sending every editable text path unchanged is safe (a path outside the editable text is still rejected); `changed_paths` is empty when nothing changed - `word_count` is recomputed after every edit. Regenerating the task from the app replaces the edited content with a fresh generation - With `result_version`, an edit to a task regenerated since you read it returns `409 ERR_STALE_CONTENT`, nothing is written and `error.meta.result_version` holds the current token: read the task again and redo the edits. Without it, edits apply to the current output - `edited_by_user_id` is `null` when the edit was made from an embedded portal - On a `product_listing` task, `description_html` keeps only `p`, `ul`, `ol`, `li`, `strong`, `em`, `h3` and `br`: other markup and every attribute are stripped, not refused, so read the stored value from the response. A revert restores the generated description cleaned the same way - Fires the `intelligence_task.updated` webhook when at least one path changed ### POST /api/v1/intelligence_tasks/:id/revert Discard every manual edit on a task and restore the output as it was generated. **Parameters:** `project_id` (required), `:id` (task ID or public_id in URL) **Response:** the restored task (same shape as `GET /api/v1/intelligence_tasks/:id`) with `manually_edited_at` and `edited_by_user_id` back to `null`. **Notes:** - Team members need edit access to GEO Writer - Returns `422 ERR_INVALID_PARAM` when the task has no manual edits to revert - On a `product_listing` task, `description_html` comes back with only `p`, `ul`, `ol`, `li`, `strong`, `em`, `h3` and `br` and no attributes, cleaned like an edit - Fires the `intelligence_task.updated` webhook, with `manually_edited_at` back to `null` ### GET /api/v1/cms/content Posts or pages of the project's connected WordPress site, newest change first, read live. MCP: `list_cms_content`. **Parameters:** `project_id` (required), `type` (`post` or `page`), `status` (`publish`, `future`, `draft`, `pending`, `private` or `any`), `search`, `page`, `per_page` (max 50) ```json { "project_id": 123, "site": { "platform": "wordpress", "site_url": "https://blog.example.com", "host": "blog.example.com", "status": "connected" }, "type": "post", "status": "publish", "page": 1, "per_page": 20, "total": 31, "total_pages": 2, "data": [ { "id": 101, "type": "post", "status": "publish", "slug": "pick-running-shoes", "title": "How to pick running shoes", "url": "https://blog.example.com/pick-running-shoes/", "modified_at": "2026-11-02T10:00:00Z" } ], "request_id": "uuid" } ``` **Notes:** - `title` and `excerpt` are plain text: escape before display. `total`/`total_pages` may be `null` - `404 ERR_CMS_NOT_CONNECTED`, `403 ERR_CMS_ACCESS_REVOKED` and `422 ERR_CMS_REJECTED` (not retryable) carry `meta.connect_url`; `503 ERR_CMS_UPSTREAM`: site unreachable; `429 ERR_RATE_LIMITED`. Members need WordPress read access ### GET /api/v1/cms/content/:id One post or page by its WordPress id, with content. MCP: `get_cms_content`. **Parameters:** `project_id` (required), `type` (`post` or `page`) ```json { "project_id": 123, "site": { "platform": "wordpress", "site_url": "https://blog.example.com", "host": "blog.example.com", "status": "connected" }, "data": { "id": 101, "type": "post", "status": "publish", "slug": "pick-running-shoes", "title": "How to pick running shoes", "url": "https://blog.example.com/pick-running-shoes/", "modified_at": "2026-11-02T10:00:00Z", "excerpt": "A short answer.", "content_html": "

Fit first

Measure both feet.

", "content_truncated": false }, "request_id": "uuid" } ``` **Notes:** - `content_html` keeps headings, paragraphs, lists, tables, quotes, code and links, cut at 200,000 characters (`content_truncated`). `404 ERR_NOT_FOUND` for an unknown id ### POST /api/v1/intelligence_tasks/:id/send_to_cms Send a completed `create` or `update` task to the connected WordPress site as a new draft. MCP: `send_intelligence_task_to_cms`. **Parameters:** `project_id` (required) **Response:** `202` while the draft is queued (`200` when this version is already a draft): ```json { "project_id": 123, "created": true, "publication": { "id": 55, "platform": "wordpress", "site_url": "https://blog.example.com", "status": "queued", "title": "How to pick running shoes", "slug": "how-to-pick-running-shoes-k3x9q2", "source_url": null, "remote_id": null, "remote_status": null, "remote_url": null, "edit_url": null, "error_code": null, "created_at": "2026-11-03T10:00:00Z", "sent_at": null }, "request_id": "uuid" } ``` **Notes:** - An update's `source_url` names the page it revises. Sent in the background: the task's `cms_drafts` (10 newest) gives `status` (`queued`, `sending`, `unknown`, `drafted`, `failed`), `edit_url` and `error_code` - Resending a version returns its publication (`created: false`). `422 ERR_INVALID_PARAM` unless the task is a completed article or update; `422 ERR_LIMIT_REACHED` past 50 drafts per site in 24 hours. Members need WordPress send access --- ## Technical GEO Reports Runs the full technical GEO analysis bundle for a URL, then lets clients poll and read each completed report. Each report inside the bundle runs as its own background job. The llms.txt files of a completed report can be edited with `PATCH /api/v1/technical_geo_reports/:id/content` and restored to the generated version with `POST /api/v1/technical_geo_reports/:id/revert_content`. ### GET /api/v1/technical_geo_reports List reports of one technical GEO type for a project, newest first. Use `agent_readiness` for the AI or Agent Readiness report. **Parameters:** | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `report_type` | Yes | One of: `crawlability`, `schema`, `content_readiness`, `discoverability`, `site_structure`, `robots_txt`, `agent_readiness`, `llms_txt`, `ai_visibility` | | `status` | No | Status filter; valid values depend on the report type | | `batch_id` | No | Batch ID returned by `POST /technical_geo_reports` | | `page` | No | Page number, default 1 | | `per_page` | No | Results per page, default 20, maximum 100 | The response contains report summaries with `id`, `report_type`, `batch_id`, target URL/domain, `country_code`, `output_language_code`, status, `result_available`, `overall_score` when available, and timestamps. `output_language_code` is the ISO 639-1 language the llms.txt files were requested in: a string for `llms_txt` reports created with a language, `null` for an `llms_txt` report left on the website's own language (the app option, or `auto` through the API and MCP) and for the other report types. Use the `id` and `report_type` with the detail endpoint. Each summary also carries `app_url`, the link that opens the report in the app. ### GET /api/v1/technical_geo_reports/:id Get the current status and result of one technical GEO report. **Parameters:** `project_id` (required), `report_type` (required), `:id` (report ID in URL) **Response:** ```json { "id": 101, "report_type": "agent_readiness", "project_id": 123, "batch_id": 42, "domain": "example.com", "status": "completed", "result_available": true, "overall_score": 62, "result_data": { "overall_score": 62, "grade": "C", "dimension_scores": {}, "checks": [], "recommendations": [] }, "error_message": null, "poll_after_seconds": null, "app_url": "https://llmpulse.ai/app/tools/agent_readiness_reports/?project_id=123", "request_id": "uuid" } ``` While a report is running, `result_data` is `null`, `result_available` is `false`, and `poll_after_seconds` is `15`. A failed report returns its `error_message`. Completed llms.txt reports return `llms_txt_content`, `llms_full_txt_content`, crawl metadata, and generation statistics inside `result_data`, plus the edit state of the two files: `manually_edited_at` (ISO 8601 timestamp, `null` while the files are the generated ones), `content_version` (changes on every edit or restore; send it back with an edit), `original_llms_txt_content` and `original_llms_full_txt_content` (the generated files, `null` until the first edit). When `manually_edited_at` is set, `llms_txt_content` and `llms_full_txt_content` hold the manual edits, made in the app or through `PATCH /api/v1/technical_geo_reports/:id/content`. The `metadata` object of an llms.txt result also carries `output_language_code`, the language the files were written in, and `output_language_source`: `selected` when the report asked for a language, `detected` when it was detected from the site, `null` otherwise. Files built only from the pages of the report's domain carry `source_scope: "own_domain"` and `allowed_domains` (the domain and its `*.` subdomains) in the same object, plus `dropped_links` and `dropped_citations`, the links and sources from other websites that were removed; reports created before that restriction have no `source_scope`. Completed robots.txt reports include `content_signals`, one entry per `Content-Signal` line with its `line` number, the `agents` of its User-agent group, its `path` (null for a site-wide line) and its declared `signals`; Agent Readiness reports carry the same entries as `content_signal_rules`. ### POST /api/v1/technical_geo_reports Run the full technical GEO analysis bundle (crawlability, schema, content readiness, discoverability, site structure, robots.txt, agent readiness, llms.txt, AI visibility) for a URL + country. Each successfully created report uses one daily Technical GEO unit; a report that is not created uses none. The bundle starts only when at least nine units remain. The standard allowance is 20 units/day per account, and some accounts have a higher allowance. **Request body (JSON):** ```json { "project_id": 123, "url": "https://example.com/pricing", "country_code": "US", "output_language_code": "es" } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `url` | Yes | URL to analyse | | `country_code` | No | ISO country code (defaults to the project country) | | `output_language_code` | No | ISO 639-1 code of the language the llms.txt files are written in, for example `es`, or `auto` (case-insensitive) to keep the language detected on the website. Defaults to the project language, else `en`. Only the llms.txt report of the bundle uses it; the other reports are not affected. An unsupported code returns `422 ERR_INVALID_PARAM` | **Response (201):** ```json { "project_id": 123, "url": "https://example.com/pricing", "country_code": "US", "output_language_code": "es", "batch_id": 42, "created_reports": ["crawlability", "schema", "content_readiness", "discoverability", "site_structure", "robots_txt", "agent_readiness", "llms_txt", "ai_visibility"], "report_ids": { "crawlability": 101, "schema": 102 }, "app_urls": { "crawlability": "https://llmpulse.ai/app/tools/crawlability_reports/?project_id=123", "schema": "https://llmpulse.ai/app/tools/schema_reports/?project_id=123" }, "failed_reports": [], "next_endpoint": "/api/v1/technical_geo_reports/{report_id}?project_id={project_id}&report_type={report_type}", "poll_after_seconds": 15, "request_id": "uuid" } ``` **Notes:** - Each report runs in a separate background job. Poll the detail endpoint with each entry in `report_ids`; do not create another bundle to check progress. - `app_urls` links each created report to its page in the app, keyed like `report_ids`. The page shows progress until the report completes. - A long-running, data-collection and OpenAI-heavy action: expect 3-10 minutes to full completion. - With `output_language_code: "auto"` the response echoes `"auto"`, while the list and detail endpoints show `null` for that llms.txt report (the website's own language). ### PATCH /api/v1/technical_geo_reports/:id/content Edit the llms.txt and llms-full.txt files of a completed llms.txt report in place, without regenerating it. Each file you send replaces the whole stored file. The first edit keeps a copy of the generated files so they can be restored with `POST /api/v1/technical_geo_reports/:id/revert_content`. **Request body (JSON):** ```json { "project_id": 123, "report_type": "llms_txt", "content_version": "1790589840654321", "edits": { "llms_txt": "# example.com\n\n> Reviewed summary of the site\n\n## Docs\n- [Getting started](https://example.com/docs): Setup guide\n" } } ``` **Parameters:** | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `:id` | Yes | Report ID (numeric), in the URL | | `report_type` | Yes | Must be `llms_txt`: only llms.txt reports have editable files | | `content_version` | Yes | `result_data.content_version` of the report as you last read it | | `edits` | Yes | Object with `llms_txt` and/or `llms_full_txt`, each the full replacement text of that file | **Response:** the full report (same shape as `GET /api/v1/technical_geo_reports/:id` for an llms.txt report) plus `changed_files`, the list of files whose text actually changed. ```json { "id": 108, "report_type": "llms_txt", "project_id": 123, "batch_id": 42, "url": null, "domain": "example.com", "country_code": "US", "output_language_code": null, "status": "completed", "result_available": true, "overall_score": null, "created_at": "2026-09-28T10:00:00Z", "updated_at": "2026-09-29T12:00:00Z", "result_data": { "llms_txt_content": "# example.com\n\n> Reviewed summary of the site\n...", "llms_full_txt_content": "# example.com\n...", "manually_edited_at": "2026-09-29T12:00:00Z", "content_version": "1790683200123456", "original_llms_txt_content": "# example.com\n\n> Generated summary\n...", "original_llms_full_txt_content": "# example.com\n...", "crawl_data": { "...": "crawl metadata" }, "metadata": { "...": "generation metadata" }, "pages_crawled": 12, "generation_time_ms": 41000, "openai_tokens_used": 18000 }, "error_message": null, "poll_after_seconds": null, "app_url": "https://llmpulse.ai/app/tools/llms_txt_reports/?project_id=123", "changed_files": ["llms_txt"], "request_id": "uuid" } ``` **Notes:** - Team members need the GEO Audits create permission (the one that runs reports), otherwise `403 ERR_INSUFFICIENT_PERMISSION` - `content_version` protects against overwriting a newer version: when the report changed since you read it (another edit, a restore, a regeneration), the edit returns `422 ERR_INVALID_PARAM` and nothing is written. Read the report again and resend. The response carries the new `content_version` to use for the next edit - The report must be `completed`. A missing `content_version`, an empty file, a file over 200,000 characters, a value that is not text, a key other than `llms_txt` / `llms_full_txt`, an empty `edits` object or a `report_type` other than `llms_txt` returns `422 ERR_INVALID_PARAM` and nothing is written. An unknown report ID returns `404 ERR_NOT_FOUND` - Text is stored with Unix line endings, trimmed and ending in one newline. A file identical to the stored one after that clean-up is ignored, so re-sending an unchanged file is safe; `changed_files` is empty when nothing changed - The report page, both downloads, the PDF export and this API return the edited text. Running the report again creates a fresh report with no edits ### POST /api/v1/technical_geo_reports/:id/revert_content Discard every manual edit on an llms.txt report and restore the two files exactly as they were generated. **Parameters:** `project_id` (required), `report_type` (required, must be `llms_txt`), `:id` (report ID in URL) **Response:** the restored report (same shape as `GET /api/v1/technical_geo_reports/:id`) with `manually_edited_at`, `original_llms_txt_content` and `original_llms_full_txt_content` back to `null` and a new `content_version`. **Notes:** - Team members need the GEO Audits create permission - Returns `422 ERR_INVALID_PARAM` when the report has no manual edits to revert --- ## GEO Audits Keep a technical GEO check on a domain or URL and follow it over time. Each audit runs one audit type (`agent_readiness`, `robots_txt`, `crawlability`, `schema`, `content_readiness`, `discoverability`, `site_structure`) once, weekly or monthly, and keeps every run with its score, findings and issues. Weekly and monthly audits are available only for `agent_readiness` and `robots_txt`; the other types run once and return a score without findings or issues. Limits: - Manual runs (a create, or Run now from the app, API or MCP): 6 per audit per rolling hour and 200 per account per day. Scheduled runs do not count. Over a limit returns `ERR_LIMIT_REACHED`. - Active recurring (weekly or monthly) audits per account: Starter 25, Growth 60, Scale 150, Scale+ 300, Scale++ 500. Creating, resuming or making an audit recurring over the cap returns `ERR_LIMIT_REACHED`; pause or archive one to free a slot. - An audit is paused automatically after three runs in a row could not reach the site (`paused_reason: "unreachable"`), or when it comes due while the account has more active recurring audits than its plan allows (`"quota"`). A hand pause is `"user"`. Audit ids are strings. Runs are numbered per audit (`sequence`, from 1). Team members need the matching GEO Audits permission (create, update or delete) to write. Audits, runs and alerts carry `app_url`. ### GET /api/v1/geo_audits List the project's audits, most recently updated first, with the latest run, `open_issues`, `open_critical_issues` and `next_run_at`. Archived audits are left out unless `status=archived`. Also available as the MCP tool `list_geo_audits`. **Parameters:** `project_id` (required), `audit_type`, `status` (`active`, `paused`, `archived`), `cadence` (`once`, `weekly`, `monthly`), `page`, `per_page` (max 100). Each audit has `id`, `audit_type`, `target`, `cadence`, `status`, `paused_reason`, `schedule` (`day`, `hour`, `timezone`; `null` for one-off audits), `email_alerts`, `recurring_available` (whether the type can run weekly or monthly), `checks_tracked` (whether runs produce findings and issues) and `latest_run`. ### POST /api/v1/geo_audits Create one audit per entry of `audit_types` and start the first run of each at once (it counts against the manual run limits). Also available as the MCP tool `create_geo_audit`. **Request body (JSON):** ```json { "project_id": 123, "target": "example.com", "audit_types": ["agent_readiness", "robots_txt"], "cadence": "weekly" } ``` `target` is the domain or page URL. `cadence` is `once` (default), `weekly` or `monthly`; a recurring cadence with another type returns `422 ERR_INVALID_PARAM`. Creating an audit that was archived restores it with its history. **Response (201):** `{ "project_id": 123, "data": [ ...one audit per type... ], "request_id": "uuid" }`. ### GET /api/v1/geo_audits/:id One audit, same shape as a list row. Also available as the MCP tool `get_geo_audit`. ### PATCH /api/v1/geo_audits/:id Change `cadence`, `schedule_day` (weekly 0 Sunday to 6, monthly 1 to 28), `schedule_hour` (0 to 23 in the audit time zone), `email_alerts` (boolean) or `status` (`paused` stops scheduled runs, `active` resumes them, `archived` is the same as DELETE). Setting `archived` also needs the delete permission for team members, otherwise `403 ERR_INSUFFICIENT_PERMISSION`. Send `project_id` in the body. Returns the updated audit. Also available as the MCP tool `update_geo_audit`. ### DELETE /api/v1/geo_audits/:id Archive the audit: it stops running and leaves the list. Creating the same audit again restores it with its history. **Response:** ```json { "id": "...", "archived": true, "project_id": 123, "request_id": "uuid" } ``` Also available as the MCP tool `delete_geo_audit`. ### GET /api/v1/geo_audits/:id/comparison Compare two completed runs check by check; defaults to the latest completed run against the one before it. **Parameters:** `project_id` (required), `from_run`, `to_run` (run numbers). Returns `from_run`, `to_run`, `comparable` (false when the checks or settings changed between the runs), `score_delta`, `metric_deltas`, `counts` and `changes` (each with `check_key`, `check_title`, `subject`, `severity`, `from_status`, `to_status` and `change`: `new`, `fixed`, `changed`, `appeared`, `disappeared` or `unchanged`). `404 ERR_NOT_FOUND` when the audit has no completed run yet. Also available as the MCP tool `compare_geo_audit_runs`. ### GET /api/v1/geo_audits/:geo_audit_id/runs The audit's runs, newest first: `sequence`, `status` (`queued`, `running`, `completed`, `failed`, `unreachable`), `trigger` (`scheduled`, `manual`, `api`, `mcp`), `score`, `grade`, `score_delta`, `new_issues`, `fixed_issues`, `regressed_issues`, `error`, timestamps. **Parameters:** `project_id` (required), `page`, `per_page` (max 100), `output` (`flat` or `csv`). Also available as the MCP tool `list_geo_audit_runs`. ### POST /api/v1/geo_audits/:geo_audit_id/runs Run the audit now. Returns the new run (201) with status `queued`; poll `GET /api/v1/geo_audits/:geo_audit_id/runs/:sequence` until it is `completed`, `failed` or `unreachable`. Subject to the manual run limits above. Also available as the MCP tool `run_geo_audit`. ### GET /api/v1/geo_audits/:geo_audit_id/runs/:sequence One run with its `metrics` and full `result_data`, the report in the shape of the matching Technical GEO report type (`null` until the run completes). Also available as the MCP tool `get_geo_audit_run`. ### GET /api/v1/geo_audits/:geo_audit_id/runs/:sequence/findings The run's findings, most severe first: `check_key`, `check_title`, `subject_key` / `subject` (`site` for site-wide checks, a bot for robots.txt bot checks), `status` (`pass`, `warn`, `fail`, `info`, `not_applicable`, `unknown`), `severity` and `evidence`. **Parameters:** `project_id` (required), `page`, `per_page` (max 100), `output` (`flat` or `csv`). Also available as the MCP tool `list_geo_audit_findings`. ### GET /api/v1/geo_audits/:geo_audit_id/issues The audit's issues across runs, most severe first: `id`, `check_key`, `check_title`, `subject`, `severity`, `state` (`open`, `fixed`, `gone`), `badge` (`new`, `persisting`, `regressed`, `fixed`, `gone`), `accepted`, `accepted_at`, `regression_count`, `evidence`. **Parameters:** `project_id` (required), `state` (`open` leaves out accepted issues, or `accepted`, `fixed`, `gone`; default all), `page`, `per_page` (max 100). Also available as the MCP tool `list_geo_audit_issues`. ### PATCH /api/v1/geo_audits/:geo_audit_id/issues/:id Accept an issue (`{ "project_id": 123, "accepted": true }`) or reopen it (`accepted: false`). An accepted issue stays listed but leaves the open count; the acceptance lapses on its own when the issue's evidence changes. Returns the issue. Also available as the MCP tool `update_geo_audit_issue`. ### GET /api/v1/geo_alerts Alerts the project's audits raised, newest first. **Parameters:** `project_id` (required), `audit_id` (optional), `page`, `per_page` (max 100). Each alert has `audit_id`, `audit_type`, `target`, `run_sequence`, `severity`, `created_at`, `app_url` and `events`, each with `kind` (`new_critical`, `regression`, `recovered`, `score_drop`, `unreachable`, `paused`), `check_key`, `subject_key`, `severity` and a readable `message`. Also available as the MCP tool `list_geo_alerts`. --- ## Annotations Mark a date on the project timeline (a campaign launch, a site migration) so charts show what happened when. Available on every plan. ### POST /api/v1/annotations Mark a date in the project timeseries with a title + description. Available on every plan. **Request body (JSON):** ```json { "project_id": 123, "title": "Launched PR campaign", "annotation_date": "2026-05-19", "description": "Outreach to tech press", "color": "#2563eb", "annotation_category_id": 4 } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id` | Yes | Project ID | | `title` | Yes | Annotation headline | | `annotation_date` | No | ISO YYYY-MM-DD (defaults to today) | | `description` | No | Optional longer description | | `color` | No | Hex color (e.g. `#2563eb`) | | `annotation_category_id` | No | Must belong to the project | **Response (201):** ```json { "project_id": 123, "annotation": { "id": 7, "title": "Launched PR campaign", "annotation_date": "2026-05-19", "description": "Outreach to tech press", "color": "#2563eb", "annotation_category_id": 4 }, "request_id": "uuid" } ``` ### GET /api/v1/annotations List the project's timeline annotations, newest first. Rows can come from manual notes, project automations, or platform-wide LLM Pulse events. The `origin` field distinguishes them, and `editable` says whether the API key's user may modify the row. Available on every plan. **Parameters:** `project_id` (required), `from` / `to` (optional, YYYY-MM-DD), `annotation_category_id` (optional), `page`, `per_page` (max 100). **Response:** ```json { "project_id": 123, "page": 1, "per_page": 20, "total": 4, "data": [ { "id": 7, "title": "...", "description": "...", "annotation_date": "2026-05-19", "color": "#2563eb", "category": "user", "origin": "manual", "annotation_category": { "id": 4, "name": "Campaigns" }, "editable": true, "created_at": "..." } ], "request_id": "uuid" } ``` `origin` is `manual`, `automation`, or `platform`. Also available as the MCP tool `list_annotations`. ### PATCH /api/v1/annotations/:id Update an annotation's `title`, `description`, `annotation_date` (YYYY-MM-DD), `color`, and/or `annotation_category_id`. Available on every plan. Only user-created annotations belonging to the API key's own user can be updated (`ERR_INSUFFICIENT_PERMISSION` otherwise; system annotations are never editable). **Response:** ```json { "project_id": 123, "annotation": { ...same shape as GET rows... }, "request_id": "uuid" } ``` Also available as the MCP tool `update_annotation`. ### DELETE /api/v1/annotations/:id Delete an annotation. Available on every plan. The same ownership rule as PATCH applies. **Response:** ```json { "project_id": 123, "deleted": true, "id": 7, "title": "...", "request_id": "uuid" } ``` Also available as the MCP tool `delete_annotation`. ## Team Same rules as User Menu > Team Members, also as MCP tools. Reading needs the owner, a co-owner or the Team Members permission. Revoking and removing need the owner or a co-owner, who cannot act on the owner, another co-owner or themselves. ### GET /api/v1/team_members Owner first, then members who joined, with access, projects, status and last sign-in. Paginated. Also available as the MCP tool `list_team_members`. ### GET /api/v1/team_invitations Pending invitations with their access, `invited_at` and `expires_at`. Also available as the MCP tool `list_team_invitations`. ### POST /api/v1/team_invitations Sends the invitation email. Body: `email`, `project_ids` or `all_projects: true`, optional `permission_role` (`full_access` by default, `view_only`, `custom` with `permissions`, `account_role` with `account_role_id`), `account_admin` and `billing_access` (owner only). An invitation sent by a member allowed to invite, or by a co-owner without Full access, copies that sender's own access, so they must leave `permission_role`, `account_role_id` and `permissions` out; sending them, or `account_admin`/`billing_access` from anyone but the owner, returns `ERR_INSUFFICIENT_PERMISSION`. A registered or already invited address gets `ERR_INVALID_PARAM`; too many invitations in a day, revoked ones included, `ERR_LIMIT_REACHED`. Returns the invitation and `email_sent`. Also available as the MCP tool `invite_team_member`. ### DELETE /api/v1/team_invitations/:id Revokes a pending invitation. Also available as the MCP tool `revoke_team_invitation`. ### DELETE /api/v1/team_members/:id Removes a member: their access stops at once and their user is deleted shortly after. Also available as the MCP tool `remove_team_member`. ## API Keys Same keys as User Menu > API Keys, with no MCP tools. Every endpoint needs an account-wide `read_write` key: a key limited to projects gets `ERR_KEY_PROJECT_SCOPED`, a read key `ERR_INSUFFICIENT_SCOPE`. A team member needs the API Keys permission and only sees and revokes their own keys. ### GET /api/v1/api_keys Your keys, newest first, revoked ones included: `name`, the visible `prefix`, `scope` (`read` or `read_write`), `project_scoped` and `project_ids`, `created_at`, `last_used_at`, `revoked_at`. Never the secret. Paginated. Also works below the Scale plan. ### POST /api/v1/api_keys Creates a key limited to the projects in `project_ids` (required, at least one) and owned by the calling key's user, for example one key per customer project. Body: `name` (required, up to 100 characters), `project_ids`, optional `scope` (`read` by default, or `read_write`). The secret `token` is returned only in this response. It never creates an account-wide key (create one in the app). A project the caller cannot access answers `ERR_PROJECT_NOT_FOUND` and nothing is created; past 500 active keys, `ERR_LIMIT_REACHED` until one is revoked. Scale plan or above. ### DELETE /api/v1/api_keys/:id Revokes one of your keys at once; revoking it again changes nothing. Another user's key answers `ERR_NOT_FOUND`. Also works below the Scale plan. ## Store Integrations The endpoints behind the LLM Pulse app for Shopify. They need an API key (Scale plan or above). Accounts with a white-label portal (full or subdomain) or an embed get `ERR_INTEGRATION_UNAVAILABLE` (403) on every one of them; the restriction follows the account owner, so team members inherit it. `platform` accepts `shopify`. ### GET /api/v1/store_connection Whether the account can use a store app, and which project a store belongs to. Takes no `project_id`. **Parameters:** `platform` (required), `domain` (required, the store domain, with or without scheme). **Response:** ```json { "platform": "shopify", "domain": "acme-store.com", "project": { "id": 90, "name": "Acme", "domain": "acme-store.com", "country_code": "ES", "language_code": "es" }, "ambiguous": false, "candidates": [ { "id": 90, "name": "Acme", "domain": "acme-store.com" } ], "account": { "plan": "scaleplus" }, "request_id": "uuid" } ``` `project` is the live project whose domain equals the store domain, else one whose domain is a parent or subdomain of it, else `null`. When several live projects match equally (for example one project per market on the same domain), `project` is `null` and `ambiguous` is `true`, so the app asks which one to use. `candidates` lists every live project of the account, for a picker. Pitch projects are never matched or listed. ### GET /api/v1/ai_orders The AI-referred orders a store app pushed for a project. Team members need read access to AI Traffic. Also available as the MCP tool `get_ai_orders`. **Parameters:** `project_id` (required), `platform` (default `shopify`), `from` / `to` (YYYY-MM-DD; default: the 90 days ending today; at most 400 days). **Response:** ```json { "project_id": 90, "platform": "shopify", "currency": "EUR", "from": "2026-07-06", "to": "2026-10-03", "totals": { "orders": 41, "revenue": "1834.20" }, "by_source": [ { "source": "chatgpt", "name": "ChatGPT", "orders": 30, "revenue": "1400.00" } ], "series": [ { "day": "2026-10-01", "orders": 3, "revenue": "120.50" } ], "request_id": "uuid" } ``` Revenue values are decimal strings. `currency` is `null` when the window holds no stored order. `series` lists only days with orders. ### GET /api/v1/catalog_prompt_suggestions Buyer prompts suggested from a store catalog, oldest first. Team members need read access to Prompts. **Parameters:** `project_id` (required), `status` (`pending`, `accepted` or `rejected`), `product_external_id`, `page`, `per_page` (default 50, max 100). **Response:** ```json { "project_id": 90, "page": 1, "per_page": 50, "total": 12, "data": [ { "id": 1, "prompt": "best vegan omega 3", "status": "pending", "source": "catalog", "country_code": "ES", "language_code": "es", "product": { "external_id": "gid://shopify/Product/1", "handle": "omega-3", "title": "Omega 3 Ultra" }, "prompt_id": null, "accepted_at": null, "created_at": "..." } ], "request_id": "uuid" } ``` `prompt_id` and `accepted_at` are set once the suggestion is accepted. ### PUT /api/v1/ai_orders Replace the daily AI-referred orders and revenue of a window. Team members need update access to AI Traffic. A pitch project takes no store data: `ERR_INVALID_PARAM`. **Request body (JSON):** ```json { "project_id": 90, "platform": "shopify", "currency": "EUR", "from": "2026-07-06", "to": "2026-10-03", "days": [ { "day": "2026-10-01", "referrer": "chatgpt.com", "orders": 3, "revenue": "120.50" } ] } ``` | Parameter | Required | Description | |-----------|----------|-------------| | `project_id`, `platform` | Yes | Project and store platform | | `currency` | Yes | ISO 4217 code | | `from`, `to` | Yes | YYYY-MM-DD, at most 400 days | | `days` | Yes | Up to 400 entries of `day` (inside the window), `referrer`, `orders` (integer, 0 or more) and `revenue` (decimal, 0 or more) | `referrer` is the raw referring host or `utm_source` of the order's first visit. LLM Pulse classifies it and ignores anything that is not an AI assistant; entries for the same day and assistant are summed. Every stored row of that project and platform inside the window is replaced, so pushing the same window twice gives the same result. Rows are kept per project and platform, not per store, so connect one store per project. **Response:** ```json { "project_id": 90, "platform": "shopify", "stored": 2, "ignored": 1, "request_id": "uuid" } ``` ### POST /api/v1/catalog_prompt_suggestions Write buyer prompts for up to 20 catalog products and save them as pending suggestions in the project's Suggested prompts queue. Team members need create access to Prompts. **Request body (JSON):** ```json { "project_id": 90, "platform": "shopify", "country_code": "ES", "language_code": "es", "products": [ { "external_id": "gid://shopify/Product/1", "handle": "omega-3", "title": "Omega 3 Ultra", "product_type": "Supplement", "vendor": "Acme", "tags": ["vegan"], "collections": ["Bestsellers"], "url": "https://acme-store.com/products/omega-3" } ] } ``` Each product needs `external_id` and `title`. `country_code` and `language_code` default to the project's; a `country_code` or `language_code` the app does not offer returns `ERR_INVALID_PARAM`. **Response (201):** ```json { "project_id": 90, "created": 12, "skipped": 3, "data": [ ], "request_id": "uuid" } ``` `data` holds only the new suggestions; `skipped` counts generated prompts the project already had as a suggestion, from any source or status. **Errors:** `ERR_QUOTA_EXCEEDED` when the hourly prompt-suggestion allowance (shared with the app) is used up; `ERR_GENERATION_FAILED` (502) when generation failed, safe to retry. ### POST /api/v1/catalog_prompt_suggestions/accept Track pending suggestions as prompts. Each becomes a prompt tagged with a collection named after its product (untagged when the team member cannot create tags). Team members need create access to Prompts. **Request body (JSON):** `{ "project_id": 90, "ids": [1, 2] }` (up to 100 ids, all in one country and language). **Response:** ```json { "project_id": 90, "accepted": [ { "suggestion_id": 1, "prompt_id": 501, "collection_id": 33 } ], "skipped": [ { "suggestion_id": 2, "reason": "accepted" } ], "prompts_available": 120, "request_id": "uuid" } ``` `prompts_available` is `null` when unlimited. When the new prompts would exceed the plan, the call returns `ERR_LIMIT_REACHED` and accepts nothing. A suggestion whose country or language the app does not offer returns `ERR_INVALID_PARAM` and accepts nothing. ### POST /api/v1/catalog_prompt_suggestions/reject Mark pending suggestions as rejected. Team members need update access to Prompts. **Request body (JSON):** `{ "project_id": 90, "ids": [3] }` (up to 100 ids). **Response:** ```json { "project_id": 90, "rejected": 1, "request_id": "uuid" } ``` ## Webhooks Webhooks send external systems (Zapier, Make, n8n, custom backends) a signed HTTP POST whenever something happens in a project, with no polling. Subscribing needs the **Scale plan or above** (like API keys); listing and deleting work on every plan. Creating and deleting need a **writable** API key. Below Scale, subscriptions are kept but deliver nothing (no failed delivery counted, none disabled); deliveries resume back on Scale or above, and events from that period are not resent. **Event types:** | Event type | Fires when | |---|---| | `mention.created` | The brand is mentioned in a new AI answer | | `competitor_mention.created` | A tracked competitor is mentioned in a new AI answer | | `citation.created` | The brand's domain is cited as a source in a new AI answer | | `prompt_execution.completed` | A prompt finishes executing against an AI model and is analyzed | | `sentiment.negative_detected` | A negative or very negative brand sentiment is detected | | `recommendation.completed` | A recommendations report finishes generating | | `intelligence_task.completed` | A GEO Writer task finishes | | `intelligence_task.updated` | The text of a completed GEO Writer task is edited by hand or reverted to the AI version | | `geo_audit_run.completed` | A GEO audit run finishes | | `geo_audit_alert.triggered` | A scheduled GEO audit run raises an alert | | `tracking_run.completed` | A tracking run of the project has finished | **Tracking runs.** A run is one batch of a project's answers: the scheduled run of a tracking period, or a later batch (new prompts, a newly enabled model, prompts held for the execution allowance). `tracking_run.completed` fires once per run, when every answer is final (answered or failed), its sentiment is done and no answer has joined for an hour or the period has ended. A run still missing answers or sentiment 24 hours on fires with `status: timed_out`. To read its data, query the project from `period_start` to `period_end`; `data` also gives the answer counts and step times: ```json { "event": "tracking_run.completed", "occurred_at": "2026-01-12T08:20:00Z", "project_id": 1, "subscription_id": 42, "data": { "id": 7, "tracking_frequency": "weekly", "period_start": "2026-01-12", "period_end": "2026-01-18", "status": "completed", "started_at": "2026-01-11T23:00:12Z", "last_execution_at": "2026-01-11T23:48:20Z", "data_ready_at": "2026-01-12T05:40:00Z", "sentiment_ready_at": "2026-01-12T08:20:00Z", "completed_at": "2026-01-12T08:20:00Z", "executions_count": 350, "succeeded_count": 342, "failed_count": 8, "pending_count": 0 } } ``` **Delivery format:** each event is an HTTP POST with a JSON body: ```json { "event": "mention.created", "occurred_at": "2026-01-15T10:00:00Z", "project_id": 1, "subscription_id": 42, "data": { "id": 10, "prompt_id": 5, "prompt_text": "best ai tools", "prompt_execution_id": 99, "model": "chatgpt", "position": 2, "keywords": ["Brand"], "created_at": "2026-01-15T10:00:00Z" } } ``` Headers: `X-LLMPulse-Event` (event type), `X-LLMPulse-Delivery` (unique delivery id), `X-LLMPulse-Signature` (`sha256=`, HMAC-SHA256 of the raw body computed with the subscription secret). Verify the signature to authenticate deliveries. A 2xx response acknowledges the delivery; anything else is retried with exponential backoff (5 attempts). Subscriptions are auto-disabled after 20 consecutive failed deliveries. The target URL must be a public HTTPS URL (private IPs, localhost and internal hostnames are rejected). Each account (the owner and its team members together) can have up to 100 active subscriptions. The limit can be raised for enterprise accounts on request. ### POST /api/v1/webhooks Create a subscription. Idempotent: re-posting the same project + event + URL returns the existing subscription, unless the API key or OAuth connection that created it was revoked, or that API key no longer covers the project; then it is replaced by a new subscription with a new secret. **Body:** `project_id` (required), `event_type` (required, one of the table above), `target_url` (required, public HTTPS URL) **Response (201):** ```json { "id": 42, "project_id": 1, "event_type": "mention.created", "target_url": "https://hooks.zapier.com/hooks/standard/1/a", "secret": "whsec_...", "disabled": false, "failure_count": 0, "last_delivered_at": null, "created_at": "2026-06-11T10:00:00Z", "request_id": "uuid" } ``` The `secret` is only returned by this endpoint: when it creates the subscription, and on a re-post only to the API key or OAuth connection that created it. Any other API key or OAuth connection gets the subscription without `secret`. A subscription created over an MCP OAuth connection before API 1.58.0 has no recorded creator, so it never returns `secret` again. Store it to verify delivery signatures; to get a new one, delete the subscription and create it again. ### GET /api/v1/webhooks List active subscriptions for the account. **Parameters:** `project_id` (optional filter), `page`, `per_page` (max 100). Response is the standard paginated envelope (`page`, `per_page`, `total`, `data`); items match the create response without `secret`. A read-only API key (and, in the MCP `list_webhook_subscriptions` tool, an OAuth connection without `mcp:write`) gets `target_url` cut to its scheme, host and any non-default port plus `/…` (for example `https://hook.eu1.make.com/…`), because the full URL can let anyone post to the receiver. `disabled` is `true` when the API key or OAuth connection that created the subscription was revoked, or when that API key is limited to some projects and no longer covers the subscription's project: it receives no more events. Delete it, or create it again with the same project, event and URL to get a new subscription and secret. ### DELETE /api/v1/webhooks/:id Delete a subscription. **Response:** ```json { "deleted": true, "id": 42, "request_id": "uuid" } ``` Returns `ERR_NOT_FOUND` for subscriptions that do not belong to the account. ### GET /api/v1/webhooks/sample/:event_type Returns up to 3 example event payloads for the given event type, built from the project's most recent real data (or a static sample if the project has no data yet). Used by integration editors (e.g. the Zapier sample loader). **Parameters:** `project_id` (required). Also available as the MCP tool `get_webhook_sample`. **Response:** ```json { "event_type": "mention.created", "data": [ { "event": ..., "occurred_at": ..., "project_id": ..., "subscription_id": 0, "data": { ... } } ], "request_id": "uuid" } ``` --- ## MCP ### POST /api/v1/mcp (and GET for the SSE handshake) Single JSON-RPC 2.0 entry point that implements the Model Context Protocol. AI clients (ChatGPT, Claude, Gemini, Cursor, Windsurf, Zed, custom MCP integrations) call this with `tools/list`, `tools/call` and resource methods to access the same data exposed by the REST API. JSON-RPC requests return a JSON-RPC response with HTTP 200. Accepted notifications, including `notifications/initialized`, return HTTP 202 with an empty body as required by the Streamable HTTP transport. **Availability:** - **OAuth 2.1**: available on **every LLM Pulse plan** and during eligible trials. No API key required. The client discovers the flow via `GET /.well-known/oauth-authorization-server` (RFC 8414) and `GET /.well-known/oauth-protected-resource` (RFC 9728). Dynamic Client Registration is supported at `POST /oauth/register` (RFC 7591) with PKCE-S256. - **Bearer-token API key** (`Authorization: Bearer YOUR_API_KEY`): available on **Scale plan and above**. Intended for headless integrations (Zapier, n8n, CI scripts). A key created on the canonical app starts with `llmpulse_`; a key created inside a white-label portal carries that portal's own prefix instead, and both authenticate the same way. - Also accepts `?api_key=…` query-string for legacy MCP clients that cannot send Authorization headers. Treat as higher risk because URLs are more likely to be logged. **Per-tool plan gating:** Tools declare `requires_plan` (e.g., `:growth`, `:scale`) and are filtered out of `tools/list` for users without access. A direct call to a gated tool returns an error result (`isError: true`) with `code: "ERR_PLAN_REQUIRED"` and an `error` text naming the required plan. Connecting via OAuth itself is free; only the tools you can call depend on your plan. **Tool errors:** a failing `tools/call` still answers HTTP 200, with `result.isError: true` and a single text part holding a JSON object: `{"error": "", "code": "ERR_*"}`. Every tool error carries `code`, the same code the REST endpoint returns for that state. Missing or invalid arguments, including values the tool's input schema rejects, are `ERR_INVALID_PARAM`; an unknown project is `ERR_PROJECT_NOT_FOUND` on every tool; another missing record is `ERR_NOT_FOUND` (`ERR_DRAFT_NOT_FOUND` for drafts). A refused tool answers `ERR_PLAN_REQUIRED`, `ERR_INSUFFICIENT_SCOPE` (OAuth scope or read-only key), `ERR_INSUFFICIENT_PERMISSION` (team-member permissions), `ERR_KEY_PROJECT_SCOPED` or `ERR_INTEGRATION_UNAVAILABLE`. Branch on `code`; the `error` text is stable but written for people. **OAuth scopes:** `mcp:read` (default) grants access to read-only tools. `mcp:write` is required for writable tools, the ones that create, change, delete or launch something (for example `create_prompts`, `update_intelligence_task_content` or `launch_recommendations`). Call `tools/list` after connecting to see the tools available to the token. A token issued with only `mcp:read` cannot invoke writable tools: `tools/list` hides them and a direct `tools/call` returns an error. Likewise, a token without `mcp:read` cannot use read-only tools, even when it carries `mcp:write`. The JWT `aud` claim must match the advertised MCP resource URL, the request-host base URL, the authorization-server issuer, or that issuer with `/api/v1/mcp`. When no resource indicator is supplied, the issuer is used; any other audience is rejected at `/api/v1/mcp`. **Discovery endpoints (read-only, public):** - `GET /.well-known/oauth-authorization-server`: OAuth 2.1 server metadata - `GET /.well-known/oauth-protected-resource`: Resource metadata advertised by the MCP server - `GET /oauth/jwks.json`: RS256 public keys for verifying issued JWT access tokens **OAuth endpoints:** - `POST /oauth/register`: Dynamic Client Registration (returns `client_id` + metadata) - `GET /oauth/authorize`: Consent page (PKCE-S256 required, `scope=mcp:read mcp:write`) - `POST /oauth/token`: `authorization_code` and `refresh_token` grants. JWT access tokens and the reusable refresh token share a fixed one-year authorization deadline. Refresh responses return the same refresh token for compatibility with clients that replace their stored token set. Users must authorize the connection again once a year. **Setup guide:** `https://llmpulse.ai/app/api_keys/mcp`: open on every plan. **Struggling to connect?** MCP and OAuth support is still uneven across clients, so connections sometimes fail. On the Scale plan and above the easiest fallback is to give your AI assistant a Bearer API key plus a link to these API docs. It can then query every REST endpoint directly over plain HTTP, with no MCP client setup at all. **Available tools:** see `integrations.md` for the full list, or call `tools/list` after connecting. The server returns only the tools your plan can use. **Guided analyses (MCP prompts):** the server also implements the MCP prompts primitive (`prompts/list`, `prompts/get`) with a set of user-invoked playbooks: full visibility audit, competitor gap, citation opportunities, reputation review, visibility change investigation, and content briefs. Clients with prompt support surface them as slash commands. The guided analyses are available on every plan; clients without MCP prompt support can still run the same analyses by asking directly and using the available data tools. ### GET /api/v1/mcp/server-card Public MCP Server Card describing this server: its name, version, the streamable HTTP endpoint, the protocol versions it speaks, and the Authorization header a client has to send. Requires no authentication, because it is the document a client reads before it has a credential. Served as `application/mcp-server-card+json` with permissive CORS and an `ETag`, so a browser-based MCP client can fetch it cross-origin and revalidate with `If-None-Match`. The card never contains a credential. The `Authorization` entry is a template (`Bearer {token}`) marked `isSecret`, and the token itself comes from OAuth 2.1 or an API key as described above. **Discovery:** the card is advertised in the Agentic Resource Discovery catalog at `https://llmpulse.ai/.well-known/ai-catalog.json`, as an entry typed `application/mcp-server-card+json` whose `url` is this path. It is deliberately NOT served at `/.well-known/mcp/server-card.json`: the MCP specification rules that location out, because a single server's card is application-level metadata while `.well-known` is reserved for site-wide metadata. **Response:** ```json { "$schema": "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json", "name": "ai.llmpulse/llm-pulse", "version": "1.0.0", "description": "Brand visibility, share of voice and citation analytics for answers from AI assistants.", "title": "LLM Pulse", "websiteUrl": "https://llmpulse.ai", "remotes": [ { "type": "streamable-http", "url": "https://api.llmpulse.ai/api/v1/mcp", "headers": [ { "name": "Authorization", "description": "OAuth 2.1 access token, or an API key on Scale and above.", "isRequired": true, "isSecret": true, "value": "Bearer {token}" } ], "supportedProtocolVersions": ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"] } ] } ``` --- ## MCP tools (live) Tools registered in `Mcp::LlmPulseServer::TOOLS` at the time this document was generated. The MCP server filters `tools/list` per user plan; tools that fail a plan check return `ERR_PLAN_REQUIRED`. Tip: if your MCP client struggles to connect (MCP/OAuth support is still uneven across clients), an easy fallback on the Scale plan or above is to hand your AI assistant a Bearer API key plus a link to these docs. It can then call every REST endpoint directly over plain HTTP, no MCP client setup required. - `accept_suggested_prompts` - `ask_support` - `assign_prompt_tags` - `compare_geo_audit_runs` - `create_annotation` - `create_collection` - `create_competitor` - `create_geo_audit` - `create_intelligence_task` - `create_project` - `create_prompts` - `create_reputation_report` - `create_technical_geo_report` - `create_webhook_subscription` - `delete_annotation` - `delete_collection` - `delete_competitor` - `delete_geo_audit` - `delete_project` - `delete_prompt` - `delete_webhook_subscription` - `finalize_project_draft` - `generate_prompt_suggestions` - `get_account_usage` - `get_agent_traffic` - `get_ai_model_position_distribution` - `get_ai_model_summary` - `get_ai_orders` - `get_ai_overview_results` - `get_ai_traffic` - `get_answer` - `get_cited_url_content` - `get_cited_url_details` - `get_cms_content` - `get_competitor_details` - `get_custom_report` - `get_geo_audit` - `get_geo_audit_run` - `get_intelligence_task` - `get_mentions_by_citing_domain` - `get_owned_media_profiles` - `get_owned_media_summary` - `get_project_details` - `get_project_draft` - `get_prompt_generation` - `get_prompt_summary` - `get_recommendation` - `get_reputation_report` - `get_search_console_ai_visibility_gaps` - `get_search_console_brand_split` - `get_search_console_cannibalization` - `get_search_console_decay` - `get_search_console_opportunities` - `get_search_console_pages` - `get_search_console_queries` - `get_search_console_rows` - `get_search_console_summary` - `get_search_console_timeseries` - `get_sentiment_tags` - `get_sentiment_topics` - `get_sov` - `get_study` - `get_study_report` - `get_summary` - `get_technical_geo_report` - `get_timeseries` - `get_top_sources` - `get_web_analytics_schema` - `get_webhook_sample` - `import_prompts` - `invite_team_member` - `launch_recommendations` - `list_ads` - `list_agent_bots` - `list_all_citations` - `list_all_mentions` - `list_annotations` - `list_answers` - `list_citation_groups` - `list_citations` - `list_cited_url_occurrences` - `list_cms_content` - `list_collections` - `list_competitor_citations` - `list_competitor_mentions` - `list_competitor_suggestions` - `list_competitors` - `list_custom_reports` - `list_detailed_sentiments` - `list_geo_alerts` - `list_geo_audit_findings` - `list_geo_audit_issues` - `list_geo_audit_runs` - `list_geo_audits` - `list_intelligence_tasks` - `list_local_businesses` - `list_locales` - `list_mentions` - `list_models` - `list_owned_media` - `list_owned_media_citing_prompts` - `list_projects` - `list_prompt_executions` - `list_prompts` - `list_query_fan_outs` - `list_recommendations` - `list_reddit_citations` - `list_reputation_reports` - `list_search_console_properties` - `list_sentiments` - `list_shopping_products` - `list_sources` - `list_studies` - `list_suggested_prompts` - `list_tags` - `list_team_invitations` - `list_team_members` - `list_technical_geo_reports` - `list_webhook_subscriptions` - `query_web_analytics` - `reject_suggested_prompts` - `remove_prompt_tags` - `remove_team_member` - `revert_intelligence_task_content` - `revert_technical_geo_report_content` - `revoke_team_invitation` - `run_geo_audit` - `send_custom_report` - `send_feedback` - `send_intelligence_task_to_cms` - `start_project_draft` - `update_annotation` - `update_collection` - `update_competitor` - `update_geo_audit` - `update_geo_audit_issue` - `update_intelligence_task_content` - `update_owned_media_profiles` - `update_project` - `update_project_draft` - `update_prompt_categorization` - `update_recommendation_item` - `update_technical_geo_report_content`