# A category's topics, from every feature below it, with their feedback values (/api/feedback/list_category_topics)

`GET /v1/products/{productId}/categories/{categoryId}/topics`

Operation name: `list_category_topics`

Every live feature at any depth below the category: the topics with at least one grouped insight, by customers, then insights, then name, each with its `feature` (the same name under two features is two topics). Each topic's values follow `get_feedback_counts`' rule for that topic alone; `total` is the scope's row there (each customer once), so the topics can add up to more than `total`. `topicCount`: the topics on every page; read on with `meta.nextCursor` (a ranking moves as feedback arrives, so a later page can repeat or skip a topic). `customerStatus` and `period` as in `list_feature_topics`. `scope.category` names the category and its parents (`path`, top first); a deleted category is not found. Send `meta.feedbackVersion` as `expectedVersion` with a feedback change planned from this read.

## Authentication

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.

Or: An API key, sent as `Authorization: Bearer ha_…` (keys made before the rename to Heuristic start `fsa_` and keep working). Keys are created only in the Heuristic web app and shown once. A personal key (Settings → Personal → My API keys) acts as its person in one of their organizations, with exactly their access there, checked on every call; its calls count toward the person's limits on calls through apps and agents, as described for OAuth tokens, and it can't change the person's account (their profile, organizations, invitations or connected apps). An organization key (Settings → Organization → API keys, created by Admins) acts for the organization, not a person: it can see and change every product and its feedback as an Admin can, but not people, product access, CRM connections or the organization's settings, and it can't delete a product; each organization key has its own limits, with the same numbers. Either kind is Full access or Read only (a change with a read-only key answers 403 `read_only_key`), reaches only its own organization (others answer 404), works on /v1 only, not on the MCP server, and can't create keys or manage the organization's API keys. Other refused calls answer 403 `api_key_not_allowed`. A wrong, expired or revoked key, or a disabled member's personal key, answers 401 `unauthorized`. A full-access key sends feedback: a personal key as its person, to the products they own; an organization key to any product of its organization; the record's `sentBy` names the key.

## Path parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `productId` | path | string | yes | A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 `validation_error`. |
| `categoryId` | path | string | yes | A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 `validation_error`. |

## Query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `customerStatus` | query | string | no | Only customers with this status count: `customer` or `prospect`. Left out: customers and prospects, and customers with no status. A customer's status is taken the way its ARR is: a company's own (the record's, else its contact's company); a contact counted alone, the status of their most recent record that carried one; a record counted alone, its own. `withoutStatus` says how many counted customers have no status, whatever this is. |
| `period` | query | string | no | Only feedback given in this period counts, by the date it was given: `30d` and `90d` are the last 30 or 90 days, `12m` the last 12 calendar months (UTC), all measured back from the moment of the request; feedback dated later counts too. Left out: all time. Counts, ARR, `insights`, which topics are listed and `withoutStatus` follow it; `trend`, `trendByType`, `change`, `changeByType` and `meta` do not (they keep the reporting unit's own windows). |
| `customerKind` | query | string | no | With `customerId`, only the topics where that customer has a grouped insight (under `customerStatus` and `period`); each topic's figures, `total`, `topicCount` and `meta` stay the whole scope's, not the customer's: the customer's `kind` as the customers reads answer it (`company`, `contact` or `record`), and `customerId` its `id`. The two go together; a customer with nothing here answers an empty page. |
| `customerId` | query | string | no | A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 `validation_error`. |
| `type` | query | string | no | Only insights of this type count, trends and changes included. Left out: every type. |
| `sentiment` | query | string | no | Only insights with this sentiment count, trends and changes included. Left out: every sentiment. |
| `source` | query | string | no | Only feedback from this source counts (an id from `meta.sources`), trends and changes included. A Heuristic id: a uuid, in any case (it is read in lower case). Anything else answers 400 `validation_error`. |
| `view` | query | string | no | `growing`, `new` or `shrinking`: only topics in that change state over `window` (New is never Growing), largest rise, largest fall or most customers first unless `sort` is given. Default `all`. |
| `sort` | query | string | no | `customers`: most customers first, then most insights, then name (the default under `view: all`). `arr`: most ARR first. `change`: fastest growing first, by the rise `change.latest` minus `change.before`, then the percent (new ones first). Ties follow the default order. |
| `from` | query | string | no | With `to`: only feedback given from this UTC day (YYYY-MM-DD, inclusive) counts, as `period` narrows (not with `period`); copy a `series` entry's `from` and `to` to read that period. |
| `to` | query | string | no | With `from`: the last UTC day (YYYY-MM-DD, inclusive) whose feedback counts; later feedback does not. |
| `limit` | query | integer | no | How many topics a page holds, 1 to 50 (50 when left out). |
| `cursor` | query | string | no | The previous page's `meta.nextCursor`, with the same other inputs; left out: the first page. |

## Responses

### 200

One page of topics

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string"
        },
        "ratesAsOf": {
          "type": [
            "string",
            "null"
          ]
        },
        "unconverted": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "noArr": {
          "type": "boolean",
          "description": "True when none of the customers counted here, under the filters given, has ARR in any currency: ARR values are then 0 for want of ARR, not because there is no revenue. Report it as \"no ARR yet\", and that ARR comes from a CRM connection's ARR field (`set_arr_field`) or from `arr` or `mrr` sent with `send_feedback`."
        },
        "unit": {
          "type": "string",
          "enum": [
            "week",
            "month",
            "quarter"
          ]
        },
        "periods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "window": {
          "type": "object",
          "properties": {
            "latest": {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                }
              },
              "required": [
                "from",
                "to"
              ]
            },
            "before": {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                }
              },
              "required": [
                "from",
                "to"
              ]
            }
          },
          "required": [
            "latest",
            "before"
          ]
        },
        "total": {
          "type": "object",
          "properties": {
            "counts": {
              "type": "object",
              "properties": {
                "total": {
                  "type": "integer"
                },
                "feature_request": {
                  "type": "integer"
                },
                "bug": {
                  "type": "integer"
                },
                "praise": {
                  "type": "integer"
                },
                "complaint": {
                  "type": "integer"
                },
                "question": {
                  "type": "integer"
                }
              },
              "required": [
                "total",
                "feature_request",
                "bug",
                "praise",
                "complaint",
                "question"
              ]
            },
            "arr": {
              "type": "object",
              "properties": {
                "total": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{2}$"
                },
                "feature_request": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{2}$"
                },
                "bug": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{2}$"
                },
                "praise": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{2}$"
                },
                "complaint": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{2}$"
                },
                "question": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{2}$"
                }
              },
              "required": [
                "total",
                "feature_request",
                "bug",
                "praise",
                "complaint",
                "question"
              ]
            },
            "trend": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "trendByType": {
              "type": "object",
              "properties": {
                "feature_request": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "bug": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "praise": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "complaint": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "question": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                }
              },
              "required": [
                "feature_request",
                "bug",
                "praise",
                "complaint",
                "question"
              ]
            },
            "change": {
              "type": "object",
              "properties": {
                "before": {
                  "type": "integer"
                },
                "latest": {
                  "type": "integer"
                }
              },
              "required": [
                "before",
                "latest"
              ]
            },
            "changeByType": {
              "type": "object",
              "properties": {
                "feature_request": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                },
                "bug": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                },
                "praise": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                },
                "complaint": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                },
                "question": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                }
              },
              "required": [
                "feature_request",
                "bug",
                "praise",
                "complaint",
                "question"
              ]
            }
          },
          "required": [
            "counts",
            "arr",
            "trend",
            "trendByType",
            "change",
            "changeByType"
          ]
        },
        "topicCount": {
          "type": "integer"
        },
        "views": {
          "type": "object",
          "properties": {
            "all": {
              "type": "object",
              "properties": {
                "topics": {
                  "type": "integer"
                },
                "customers": {
                  "type": "integer"
                }
              },
              "required": [
                "topics",
                "customers"
              ]
            },
            "growing": {
              "type": "object",
              "properties": {
                "topics": {
                  "type": "integer"
                },
                "customers": {
                  "type": "integer"
                }
              },
              "required": [
                "topics",
                "customers"
              ]
            },
            "new": {
              "type": "object",
              "properties": {
                "topics": {
                  "type": "integer"
                },
                "customers": {
                  "type": "integer"
                }
              },
              "required": [
                "topics",
                "customers"
              ]
            },
            "shrinking": {
              "type": "object",
              "properties": {
                "topics": {
                  "type": "integer"
                },
                "customers": {
                  "type": "integer"
                }
              },
              "required": [
                "topics",
                "customers"
              ]
            }
          },
          "required": [
            "all",
            "growing",
            "new",
            "shrinking"
          ]
        },
        "tiles": {
          "type": "object",
          "properties": {
            "customers": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer"
                },
                "change": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                }
              },
              "required": [
                "count",
                "change"
              ]
            },
            "arr": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "change": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                },
                "before": {
                  "type": "string"
                },
                "latest": {
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "currency",
                "change",
                "before",
                "latest"
              ]
            },
            "insights": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer"
                },
                "change": {
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "integer"
                    },
                    "latest": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "before",
                    "latest"
                  ]
                }
              },
              "required": [
                "count",
                "change"
              ]
            }
          },
          "required": [
            "customers",
            "arr",
            "insights"
          ]
        },
        "series": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string"
              },
              "to": {
                "type": "string"
              },
              "customers": {
                "type": "integer"
              },
              "arr": {
                "type": "string"
              },
              "current": {
                "type": "boolean"
              },
              "expected": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "customers": {
                    "type": "integer"
                  },
                  "arr": {
                    "type": "string"
                  }
                },
                "required": [
                  "customers",
                  "arr"
                ]
              }
            },
            "required": [
              "from",
              "to",
              "customers",
              "arr",
              "current"
            ]
          }
        },
        "withoutStatus": {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 0
            },
            "feature_request": {
              "type": "integer",
              "minimum": 0
            },
            "bug": {
              "type": "integer",
              "minimum": 0
            },
            "praise": {
              "type": "integer",
              "minimum": 0
            },
            "complaint": {
              "type": "integer",
              "minimum": 0
            },
            "question": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "total",
            "feature_request",
            "bug",
            "praise",
            "complaint",
            "question"
          ]
        },
        "scope": {
          "type": "object",
          "properties": {
            "category": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "path": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "title"
                    ]
                  }
                }
              },
              "required": [
                "id",
                "title",
                "description",
                "path"
              ]
            }
          },
          "required": [
            "category"
          ]
        },
        "topics": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "counts": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "integer"
                  },
                  "feature_request": {
                    "type": "integer"
                  },
                  "bug": {
                    "type": "integer"
                  },
                  "praise": {
                    "type": "integer"
                  },
                  "complaint": {
                    "type": "integer"
                  },
                  "question": {
                    "type": "integer"
                  }
                },
                "required": [
                  "total",
                  "feature_request",
                  "bug",
                  "praise",
                  "complaint",
                  "question"
                ]
              },
              "arr": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d{2}$"
                  },
                  "feature_request": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d{2}$"
                  },
                  "bug": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d{2}$"
                  },
                  "praise": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d{2}$"
                  },
                  "complaint": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d{2}$"
                  },
                  "question": {
                    "type": "string",
                    "pattern": "^\\d+\\.\\d{2}$"
                  }
                },
                "required": [
                  "total",
                  "feature_request",
                  "bug",
                  "praise",
                  "complaint",
                  "question"
                ]
              },
              "trend": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "trendByType": {
                "type": "object",
                "properties": {
                  "feature_request": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "bug": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "praise": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "complaint": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "question": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                },
                "required": [
                  "feature_request",
                  "bug",
                  "praise",
                  "complaint",
                  "question"
                ]
              },
              "change": {
                "type": "object",
                "properties": {
                  "before": {
                    "type": "integer"
                  },
                  "latest": {
                    "type": "integer"
                  }
                },
                "required": [
                  "before",
                  "latest"
                ]
              },
              "changeByType": {
                "type": "object",
                "properties": {
                  "feature_request": {
                    "type": "object",
                    "properties": {
                      "before": {
                        "type": "integer"
                      },
                      "latest": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "before",
                      "latest"
                    ]
                  },
                  "bug": {
                    "type": "object",
                    "properties": {
                      "before": {
                        "type": "integer"
                      },
                      "latest": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "before",
                      "latest"
                    ]
                  },
                  "praise": {
                    "type": "object",
                    "properties": {
                      "before": {
                        "type": "integer"
                      },
                      "latest": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "before",
                      "latest"
                    ]
                  },
                  "complaint": {
                    "type": "object",
                    "properties": {
                      "before": {
                        "type": "integer"
                      },
                      "latest": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "before",
                      "latest"
                    ]
                  },
                  "question": {
                    "type": "object",
                    "properties": {
                      "before": {
                        "type": "integer"
                      },
                      "latest": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "before",
                      "latest"
                    ]
                  }
                },
                "required": [
                  "feature_request",
                  "bug",
                  "praise",
                  "complaint",
                  "question"
                ]
              },
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "insights": {
                "type": "integer"
              },
              "edited": {
                "type": "boolean"
              },
              "insightsByType": {
                "type": "object",
                "properties": {
                  "feature_request": {
                    "type": "integer"
                  },
                  "bug": {
                    "type": "integer"
                  },
                  "praise": {
                    "type": "integer"
                  },
                  "complaint": {
                    "type": "integer"
                  },
                  "question": {
                    "type": "integer"
                  }
                },
                "required": [
                  "feature_request",
                  "bug",
                  "praise",
                  "complaint",
                  "question"
                ]
              },
              "latestAt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "feature": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title"
                ]
              }
            },
            "required": [
              "counts",
              "arr",
              "trend",
              "trendByType",
              "change",
              "changeByType",
              "id",
              "name",
              "insights",
              "edited",
              "insightsByType",
              "latestAt",
              "feature"
            ]
          }
        }
      },
      "required": [
        "currency",
        "ratesAsOf",
        "unconverted",
        "noArr",
        "unit",
        "periods",
        "window",
        "total",
        "topicCount",
        "views",
        "tiles",
        "series",
        "withoutStatus",
        "scope",
        "topics"
      ]
    },
    "meta": {
      "type": "object",
      "properties": {
        "counting": {
          "type": "boolean"
        },
        "uncounted": {
          "type": "boolean"
        },
        "hasRecords": {
          "type": "boolean"
        },
        "countingRecords": {
          "type": "integer",
          "minimum": 0
        },
        "uncountedRecords": {
          "type": "integer",
          "minimum": 0
        },
        "nextCursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "endpoint",
                  "crm",
                  "sign_in"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "kind"
            ]
          }
        },
        "feedbackVersion": {
          "type": "string",
          "description": "The feedback's version (see `apply_feedback_changes`)."
        }
      },
      "required": [
        "counting",
        "uncounted",
        "hasRecords",
        "countingRecords",
        "uncountedRecords",
        "nextCursor",
        "feedbackVersion"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ]
}
```

### 400

Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 401

Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

### 404

Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

## Example request

```bash
curl "https://staging.heuristic.app/v1/products/{productId}/categories/{categoryId}/topics" \
  -H "Authorization: Bearer <access token>"
```
