# REST API reference

> Read reports and answers, capture answers and run scheduled collection with a project key: endpoints, filters, paging, the answer CSV, errors, rate limits and versions.

https://knwn.app/docs/rest-api
Updated 26 November 2026 · 9 min read

## Version and base address

The REST API is the one the KNWN app uses. Every project endpoint starts with `https://knwn.app/api/projects/<project-id>`. You find the project ID in the app’s address bar or with `GET /api/workspace` when signed in.

This page describes version 1. Every response carries the header `KNWN-API-Version: 1`. You may send the same header to say which version your integration was written for; any other value is refused with `unsupported_version`.

### Versioning policy

- Within version 1 we only add: new endpoints, new optional parameters, new fields in a response, new CSV columns after the existing ones, and new error codes. Write integrations that ignore what they don’t know.
- Removing or renaming a field, changing its meaning or type, or reordering CSV columns needs a new version. We announce it on this page at least 90 days before version 1 changes, and version 1 keeps working in that time.
- A change that fixes a value contradicting this page, such as a filter that was ignored, can ship without a new version. It is listed here with its date.

### Changes in version 1

| Date | Change |
| --- | --- |
| 2026-11-19 | Unknown filter values are refused with `invalid_parameter` instead of being ignored. Reports echo `appliedFilters`. Answer lists page over a fixed snapshot with `asOf` and `nextCursor`, and a page past the end is empty. The answer CSV starts with a byte-order mark, its time column is named `Captured at (UTC)`, and ID, day and brand columns follow the existing ones. Capture refuses a reused `requestId` with different values. Every error has a `code`. Project keys are limited to 120 requests a minute. |
| 2026-11-20 | Reports add `comparison.settingsChanges`, `brandsStopped` and `brandsStarted`, a `not_comparable` direction across a brand settings change, `market` and `comparison.marketDropped` under a market filter, `engines[].channels` for an engine that used more than one channel, `brands[].partial`, `prompts[].earlier` and `earlierVersions`, and `former` on a domain the brand no longer uses but still owns in saved answers. Answer lists add `marketExcluded` and `dayZone`; the CSV adds Day time zone and Collection channel columns. Changes also pair answers only in the same market, language, persona and purpose. Adding a competitor with an existing domain is refused (`competitor_exists`, or `competitor_archived` with `existingId`) instead of renaming an archived one. |
| 2026-11-19 | Days follow the project’s reporting time zone, UTC unless the owner sets one. Reports and answer lists return it as `timeZone`, and the CSV’s Day column names it in its header, for example `Day (Europe/London)`. Signed-in owners set it with `PATCH /api/projects/<project-id>` and `{ "timeZone": "Europe/London" }`; an unknown zone is refused with 400 `invalid_time_zone`. |
| 2026-11-24 | Prompts add `thinking`: the thinking level asked of each API model the prompt tracks, such as `{ "claude_sonnet": "high" }`. Levels are `off`, `minimal`, `low`, `medium` and `high`, as each model offers them; a model without a saved level uses its provider’s default, and a level the model doesn’t offer runs at that default. Browser captures have no thinking level. |

## Authentication and scopes

Project owners create keys in Team & developer access. Send a key as `Authorization: Bearer knwn_…`. A key works for one project and acts with its owner’s access. It expires after at most 365 days, and stops at once when it is revoked, when the owner chooses Revoke all keys, or when the account is disabled. Read, capture and schedule keys also stop working while the owner’s plan leaves the REST API out (Pro): calls get 402 `rest_api_not_in_plan`, Developer access marks them Not active on your plan, and they work again on Growth or Scale. MCP keys keep working.

| Scope | Allows |
| --- | --- |
| `read` | `GET` on `report`, `answers`, `prompts`, `brands`, `scans`, `usage`, `credits`, and these `suite` reports: `perception`, `page-inventory`, `volumes`, `brand-insights`, `competitor-comparison`, `shopping-product`, `social-report`, `source-report`, `scheduler` |
| `capture` | `POST /answers`: save an answer you collected yourself |
| `schedule` | `POST /suite/tick`: run the project’s due collection and workflows, using tracking credits |

A key is refused with HTTP 401 and a code that says why: `invalid_credential` (unknown or revoked), `key_expired`, or `wrong_project` (a key for another project). An operation outside the key’s scope is 403 `scope_denied`. MCP keys and OAuth connections use the MCP server instead; see MCP connections.

## Endpoints

| Request | Returns |
| --- | --- |
| `GET /report` | The headline report for the period: `count`, `metrics`, `brands`, `engines`, `topics`, `prompts`, `domains`, `pages`, `trend`, `range`, `timeZone` and `appliedFilters`, with `comparison`, `outcomes`, `failed`, `imported`, `branding`, `markers` and `provenance` (see below), `market` when a market filter left answers out, and `earlierVersions` for edited questions |
| `GET /report/brands`, `/report/sources`, `/report/fanouts` | Report tables with `columns`, `rows`, `totalCount`, and paging by `limit` and `offset` |
| `GET /report/answers` | Answers matching `brand` (repeatable), `absent`, `gapOnly`, `cites` or `sentiment`, with positions and brands named in order; `limit` 1–100 |
| `GET /report/traffic` | AI crawler visits and AI referrals from imported request logs by `groupBy` platform, path, day or kind, with `verified` and `mismatched` crawler requests |
| `GET /answers` | Answers newest first, 30 a page, with `status` (`complete`, `failed`, `counted` for the answers the figures count, or one outcome: `refused`, `no_surface`, `truncated`), `prompt` (a prompt ID), `q` (text in the question), and `outcome` (`counted`, `mentioned`, `absent`, `refused`, `no_surface` or `truncated`). `cohort` (`matched` or `unmatched`) lists the current answers with or without a match in the previous period. `marketExcluded` counts answers left out by a market filter, by engine, and `dayZone` names the reporting zone used when an answer was counted. `breakdown` counts the matching answers by what became of them: `counted` (with `noSurface` among them), `refused`, `failed` and `pending` |
| `GET /answers/<answer-id>` | One answer with its text, citations, mentions and evidence |
| `GET /answers/export` | The answers as CSV (see below) |
| `POST /answers` | Capture an answer (see below) |
| `GET /prompts`, `GET /brands` | Tracked questions and competitors |
| `GET /scans`, `GET /scans/<scan-id>` | Collection history (paged with `cursor`) and one collection with its answers |
| `GET /usage`, `GET /credits` | The project’s usage and tracking credits |
| `POST /suite/tick` | Due scheduled collection and workflows (schedule keys) |

Besides the figures, `GET /report` returns what they rest on:

- `comparison`: how the period was compared with the previous one. `matched` and `matchedPrevious` count the matched answers, `new` and `dropped` those without a match, `failed` and `failedPrevious` the failed ones; with `imported`, `brandsAdded`, `brandsRemoved`, model `switches` and `analysisVersions`. `changed` is true when the report says the sample changed, and `metrics` holds each change with its `direction`.
- `outcomes`: answers the model refused (`refused`), left out of the figures, and searches that showed no AI answer (`no_surface`), counted in the figures as answers that name no brand. `failed` counts the answers that could not be collected.
- `coverage`: counted, `noSurface`, refused, failed and requested answers for the period, per engine and per prompt, the engines with no counted answer (`missing`) and whether fewer than 90% were collected (`low`). `evidence`: the first and newest capture day, overall and per engine, and how many days had answers.
- `imported`: answers pasted or sent through `POST /answers` in the period (`count`), and whether the figures count them (`counted`).
- `branding`: answers and visibility for questions that name a tracked brand (`branded`) and for the others (`unbranded`).
- `markers`: days on the trend where an engine’s answers switched model or collection channel, or where a newer version of KNWN’s analysis begins.
- `provenance`: for each engine, the collection channels its answers came from in each period (`current`, `previous`), with their first day.

## Filters

Reports and answer lists take the same filters as the app. Leave a filter out, or send it empty, for all values.

| Parameter | Values |
| --- | --- |
| `days` | 7, 14, 30, 60 or 90; default 30, ending today |
| `start`, `end` | Both together, as `YYYY-MM-DD`: a past range of 1 to 90 days. They replace `days`. |
| `engine`, `engines` | An engine ID such as `chatgpt`; `engines` may repeat |
| `country`, `language`, `purpose`, `method` | A market code such as `US`, a language code, a purpose, or `api`, `browser` or `imported` |
| `branding` | `branded` (prompts that name a tracked brand) or `unbranded` |
| `topic`, `tag`, `persona`, `topics`, `tags`, `excludeTags` | Exact text; repeat a plural parameter to pass several values |
| `where` | A filter expression, as in MCP: `engine in (chatgpt, claude) and not tag = branded` |

An unknown value is refused with HTTP 400 `invalid_parameter`, and the message lists the allowed values. It is never ignored. Reports and answer lists return `appliedFilters`, the filters they used.

Days (`YYYY-MM-DD`) are days in the project’s reporting time zone, which reports and answer lists return as `timeZone` (an IANA name such as `Europe/London`; `UTC` unless the owner set one). `days=7` ends on today in that zone, and `end` may be at most today there. AI crawler and referral days in `/report/traffic` are UTC days. Times are ISO 8601 in UTC. Metrics are percentages from 0 to 100 at full precision, `null` when there is nothing to measure; changes are percentage points (positions: places) against the preceding period of the same length, `null` when not comparable. Changes compare matched answers and carry a `direction` (`up`, `down` or `none` for no clear change) in `comparison.metrics`; `metrics.citationCoverageChange` is the owned-citation change (`citationsChange`, the raw link-count difference, is kept for compatibility). Report figures count every answer in the period, so `truncated` and `priorTruncated` are false; answer lists still stop at 7,500 rows.

## Paging answers

An answer list is read from one snapshot. The first page returns `asOf`, the moment it was read, and `nextCursor` when more answers follow. Send `cursor=<nextCursor>` for the next page: it continues the same snapshot, so answers collected while you page are never repeated and never push rows onto the next page. They appear when you start again from the first page.

```http
GET https://knwn.app/api/projects/<project-id>/answers?days=7
GET https://knwn.app/api/projects/<project-id>/answers?cursor=eyJhc09mIjoi…
```

- `page` still works. With `asOf` from the first page it reads the same snapshot. A page past the end returns an empty `rows` list.
- `total` counts the answers in the snapshot. An answer deleted or sent for retry while you page leaves it.
- `/report/answers` and MCP `list_answers` page the same way. Collection history and the activity log use their own `cursor`; report tables use `limit` and `offset`.

## Capture an answer

`POST /answers` with a capture key saves an answer you collected elsewhere. It is labelled as imported and counts in reports like any other answer.

```json
{
  "requestId": "batch-2026-11-19-0001",
  "promptId": "<prompt-id>",
  "engine": "chatgpt",
  "answer": "…the full answer text…",
  "capturedAt": "2026-11-19T08:30:00Z",
  "citations": ["https://example.com/guide"],
  "model": "gpt-6.1-terra"
}
```

`requestId` names one answer: 12 to 80 letters, digits or hyphens. Sending it again with the same values returns the saved answer’s `id` and `replayed: true` with HTTP 200, so retrying after a timeout is safe. Sending it with different values is refused with 409 `request_id_reused`, and so is a `requestId` whose answer has since been deleted: use a new `requestId` for each answer. `capturedAt` must be in the past; without it the time of the request is used.

## The answer CSV

`GET /answers/export` (Answer feed → Export CSV) takes the same filters and `status`. It is UTF-8 with a byte-order mark, so Excel shows every language correctly. It holds each matching answer once, as at the moment the export started (header `X-Export-As-Of`). Failed answers are included, with their Status and Error. Reports count complete answers and searches without an AI Overview (Outcome `complete` or `no_surface`); the Result column says in words whether each row is counted. Above 7,500 rows the export is refused with a 400: choose a shorter range or more filters.

Columns, in this order: Captured at (UTC), Prompt, Topic, Tags, Country, Engine, Collection method, Model, Status, Brand mentioned, Brand position, Brand sentiment, Cited URLs, Answer, Error, Language, Persona, Purpose, Provider, Fanout queries, Retrieved URLs, Shopping cards, Sponsored placements, Brand order, Brand order method, Outcome, Analysis version, Market applied, Answer ID, Scan ID, Prompt ID, Engine ID, Provider ID, Day (<reporting time zone>), Tracked brands, Brands mentioned (in order), Result, Day time zone, Collection channel. Then two columns for each brand: “<name> (<domain>) mentioned” and “<name> (<domain>) position”, your brand first, then competitors. Last, the same four in every row: Period start, Period end, Filters (the filters beyond the dates, such as `engine=chatgpt; language=en`), and Exported as of (UTC).

The file is named for its brand, period and scope: `knwn-answers-<domain>-<start>_to_<end>.csv`, with `-completed` or `-failed` for a status, `-outcome-…` or `-cohort-…` for an outcome or cohort, `-search-…` or `-prompt-…` for a search or prompt, and `-filtered` when other filters apply. In a customer portal its name starts with the portal’s address.

- Columns keep their order. New ones are only added at the end, so importers that read columns by position keep working. Up to 2026-11-19 the first column was named Captured at.
- Tracked brands are the brands each answer was scored against when it was captured. A brand’s own columns are empty when the answer failed or was refused, or the brand wasn’t tracked then; for a search without an AI Overview they say the brand was not mentioned. With them you can recompute share of voice, competitor visibility and position.
- Answer ID, Scan ID, Prompt ID and Engine ID match the IDs in the API, so rows can be joined to it.
- Captured at (UTC) is the moment the answer was captured, in UTC. Day is the day it counts for in the project’s reporting time zone, and the header names that zone: Day (UTC), or for example Day (Europe/London). A catch-up answer’s Day is the missed day it stands in for.

## Errors

Every error is JSON with `error`, a sentence saying what went wrong and what to do, and `code`, which doesn’t change. Usage limits add `retryAt`; account states add `action`.

```json
{
  "error": "Unknown engine: chatgtp. Use one of: chatgpt, claude, gemini, …",
  "code": "invalid_parameter"
}
```

| Status | Codes |
| --- | --- |
| 400 | `invalid_parameter`, `invalid_time_zone`, `unsupported_version` |
| 401 | `unauthenticated` (no credential), `invalid_credential`, `key_expired`, `wrong_project` |
| 402 | Account states such as `trial_expired` or `subscription_inactive`, with `action`; `plan_paused` for a brand or question over the plan’s limit; `rest_api_not_in_plan` for a read, capture or schedule key while the owner’s plan leaves the REST API out |
| 403 | `scope_denied`, `forbidden`, `workspace_mfa_required` (the project’s owner requires two-step verification: turn it on in Account security) |
| 404 | `not_found` |
| 405 | `method_not_allowed`: the endpoint takes another method |
| 409 | `conflict`, `request_id_reused`, `reconnect_required` (a Google, WordPress or personal model connection was refused; reconnect it in the app), `send_in_progress`, `brand_limit`, `prompt_limit`, `revision_conflict`, `prompt_exists`, `competitor_exists` and `competitor_archived` (a competitor with that domain is already tracked, or archived, with its `existingId`), `competitor_limit`, `name_in_use` (a name or alias already counts for another tracked brand), `key_rejected` and `retry_credit_window` (a retry of failed answers that can’t run as asked), `account_held` (collection is paused for the account), `deletion_pending` (the account is scheduled for deletion: its owner chooses in the app whether to keep it), `same_domain` (creating a project for a domain you already track: the answer names that `project`; send `"separate": true` to create another) |
| 413, 415 | `too_large`, `unsupported_media_type` |
| 422 | `unprocessable`: the request was valid, but the page or service it reads returned nothing usable |
| 429 | `rate_limited` with `Retry-After`, or a usage limit code with `retryAt` |
| 500, 502, 503 | `internal_error`, `upstream_failed`, `send_uncertain` (WordPress did not confirm; send again to check), `unavailable` |

An empty result is not an error: it is HTTP 200 with `count: 0` or an empty `rows` list, and metrics are `null`.

Signed-in saves of a project, prompt, competitor or brand profile may send the `revision` they read. If the item changed since, the save is refused with 409 `revision_conflict` and the current values in `current`. Adding a question already tracked with other settings, or paused, is refused with 409 `prompt_exists` and the tracked prompt’s `existingId`. A list with invalid rows saves nothing and names each one in `rows`, as `{ row, message }`, counting rows from 1.

## Rate limits

Each project key can make 120 requests per minute. Minutes are fixed clock minutes, counted across every KNWN server. Over the limit, KNWN answers with HTTP 429, `code: "rate_limited"`, a `Retry-After` header in seconds, and `retryAt`, when the next minute starts. Requests from the signed-in app are not counted against a key. MCP connections have their own limit of 300 requests per minute.

Usage limits are separate: collection spends tracking credits and follows your plan’s allowances, exactly as in the app. Reading reports and answers never uses credits.
