Skip to Content
Heuristic documentation

The product hierarchy: the category tree, where each feature sits, and its latest grouping

GET
/v1/products/{productId}/hierarchy

Start here to see how a product is organised; to find a category, feature or topic by name, use search instead. A category holds either subcategories or features, never both (2 to 8 when the AI groups them). The read pages over one list: the categories depth-first (parents first; the top level by position, below it A to Z; parentId null at the top), then the features by category, A to Z, unplaced ones (categoryId null) last; follow meta.nextCursor until it is null. If the tree changes between pages, the next page answers 409 conflict: read again from the first page. view: compact answers ids, titles, places and each category's featureCount (features in it and below it). view: full (the default) adds descriptions, who set each value and positions (order added). Each feature carries its source documentation page. The full view also answers build: the latest grouping, after a knowledge base read or a rebuild: queued, completed or failed; it completes once its features are named in their categories, and categoriesUnnamed counts the categories whose features could not be named yet. categoryId reads only that category's branch: the category itself first, every category below it, and their features. version is a fingerprint of the tree, on every page: send it as expectedVersion with a change, so that a change planned from this read is refused if the tree changed since. To restructure, use apply_hierarchy_changes.

Authorization

headerAuthorizationBearer <token>

An OAuth access token for the person who allowed your tool: register a client, then the authorization code flow with PKCE (S256). Send it as Authorization: Bearer <token> on every route that needs a signed-in person. Calls with a token are limited per person, across all their apps, to 120 calls a minute and 10,000 a UTC day; calls that start AI runs or knowledge base reads (creating an organization, starting a knowledge base read, rebuilding categories, retrying topics or rechecking) also to 10 a minute and 200 a UTC day. Over a limit a call answers 429 rate_limited with Retry-After and details.retryAfter in seconds, and changes nothing.

Path Parameters

productId*string

A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 validation_error.

Formatuuid

Query Parameters

view?string

compact: ids, titles, places and feature counts. full (the default): every field.

Default"full"
Value in"full""compact"
categoryId?string

A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 validation_error.

Formatuuid
limit?integer

How many items a page holds, 1 to 1000 (50 in the full view, 300 in the compact view when left out). A larger page may be cut off by your client.

Range1 <= value <= 1000
cursor?string

The previous page's meta.nextCursor, with the same view and categoryId; left out: the first page.

Response Body

One page of the tree

application/json
  1. response
data*|
meta*
Example Request
curl -X GET 'https://staging.heuristic.app/v1/products/497f6eca-6276-4993-bfeb-53cbbbba6f08/hierarchy' \  -H 'Authorization: Bearer <access token>'
Example Response
{  "data": {    "categories": [      {        "id": "string",        "parentId": "string",        "title": "string",        "description": "string",        "origin": "ai",        "titleOrigin": "ai",        "descriptionOrigin": "ai",        "placementOrigin": "ai",        "position": 0      }    ],    "features": [      {        "id": "string",        "title": "string",        "description": "string",        "categoryId": "string",        "position": 0,        "source": {          "pageId": "string",          "url": "string",          "title": "string",          "removedAt": "string"        },        "origin": "ai",        "titleOrigin": "ai",        "descriptionOrigin": "ai",        "categoryOrigin": "ai",        "addedByLatestRead": true      }    ],    "build": {      "id": "string",      "kind": "run",      "status": "queued",      "categoriesUnnamed": 0,      "failure": {        "code": "string",        "message": "string"      },      "createdAt": "string",      "finishedAt": "string"    },    "edited": true,    "rebuildAvailableAt": "string",    "version": "string",    "view": "full"  },  "meta": {    "nextCursor": "string"  }}