Skip to content
Support

Count feedback records per taxonomy node

client.taxonomy.runs.retrieveRecordCounts(stringrunID, RunRetrieveRecordCountsParams { tenant_id } query, RequestOptionsoptions?): RunRetrieveRecordCountsResponse { counts }
GET/v1/taxonomy/runs/{run_id}/record-counts

Returns the feedback-record count for every visible node in a taxonomy run. Each count is a subtree total, so a topic (branch) reports the sum of its subtopics and the root reports the run total. Tenant-scoped; returns 404 if the run does not belong to the tenant.

ParametersExpand Collapse
runID: string
formatuuid
query: RunRetrieveRecordCountsParams { tenant_id }
tenant_id: string

Tenant that owns the run.

minLength1
maxLength255
ReturnsExpand Collapse
RunRetrieveRecordCountsResponse { counts }
counts: Array<Count>

Per-node feedback-record counts, one entry per visible node.

node_id: string

Taxonomy node ID.

formatuuid
record_count: number

Number of feedback records in the node's subtree.

formatint64

Count feedback records per taxonomy node

import FormbricksHub from '@formbricks/hub';

const client = new FormbricksHub({
  apiKey: process.env['HUB_API_KEY'], // This is the default and can be omitted
});

const response = await client.taxonomy.runs.retrieveRecordCounts(
  '019f177f-9aa3-705e-8195-cea2aa187268',
  { tenant_id: 'org-123' },
);

console.log(response.counts);
{
  "counts": [
    {
      "node_id": "019f177f-9aa3-705e-8195-cea2aa187268",
      "record_count": 42
    }
  ]
}
Returns Examples
{
  "counts": [
    {
      "node_id": "019f177f-9aa3-705e-8195-cea2aa187268",
      "record_count": 42
    }
  ]
}