Skip to content
Support

Get a taxonomy run's tree

GET/v1/taxonomy/runs/{run_id}/tree

Returns the run and its taxonomy tree (visible nodes only; soft-removed nodes are excluded). Tenant-scoped; returns 404 if the run does not belong to the tenant.

Path ParametersExpand Collapse
run_id: string
formatuuid
Query ParametersExpand Collapse
tenant_id: string

Tenant that owns the run.

minLength1
maxLength255
ReturnsExpand Collapse
root: Node { id, created_at, label, 13 more }

A node in a taxonomy tree. Non-root nodes have a parent; leaf nodes reference the cluster they summarize.

id: string
formatuuid
created_at: string
formatdate-time
label: string
level: number

Depth in the tree; the root is level 0.

formatint64
node_type: "root" or "branch" or "leaf"

Position of a node within the taxonomy tree.

Accepts one of the following:
"root"
"branch"
"leaf"
run_id: string
formatuuid
sort_order: number
formatint64
updated_at: string
formatdate-time
children: optional array of Node { id, created_at, label, 13 more }

Child nodes, present when the tree is returned hierarchically.

cluster_id: optional string

Cluster this node summarizes; typically present on leaf nodes.

formatuuid
description: optional string
metadata: optional map[unknown]
original_label: optional string

Label as originally generated, before any rename.

parent_id: optional string

Parent node ID; absent for the root node.

formatuuid
removed_at: optional string

Set when the node has been soft-removed.

formatdate-time
removed_by: optional string

Actor that soft-removed the node.

run: Run { id, cluster_count, created_at, 16 more }

A persisted taxonomy generation run.

id: string
formatuuid
cluster_count: number
formatint64
created_at: string
formatdate-time
embedding_count: number
formatint64
field_id: string
node_count: number
formatint64
record_count: number
formatint64
source_id: string

Empty string is the canonical "no source" bucket.

source_type: string
status: "pending" or "running" or "succeeded" or 2 more

Lifecycle state of a taxonomy run. Allowed transitions are pending -> running|failed|canceled and running -> succeeded|failed|canceled.

Accepts one of the following:
"pending"
"running"
"succeeded"
"failed"
"canceled"
tenant_id: string
updated_at: string
formatdate-time
error: optional string

Sanitized failure message; present on failed runs.

error_code: optional "insufficient_data" or "service_unavailable" or "generation_failed" or 2 more

Machine-readable reason a taxonomy run failed or a prerequisite was not met.

Accepts one of the following:
"insufficient_data"
"service_unavailable"
"generation_failed"
"invalid_output"
"internal_error"
field_label: optional string

Human-readable field label; absent when unknown.

finished_at: optional string
formatdate-time
metrics: optional map[unknown]

Opaque run metrics recorded by the taxonomy service.

params: optional map[unknown]

Opaque run parameters recorded by Hub.

started_at: optional string
formatdate-time

Get a taxonomy run's tree

curl http://localhost:8080/v1/taxonomy/runs/$RUN_ID/tree \
    -H "Authorization: Bearer $HUB_API_KEY"
{
  "root": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "label": "label",
    "level": 0,
    "node_type": "root",
    "run_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "sort_order": 0,
    "updated_at": "2019-12-27T18:11:19.117Z",
    "children": [],
    "cluster_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "description": "description",
    "metadata": {
      "foo": "bar"
    },
    "original_label": "original_label",
    "parent_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "removed_at": "2019-12-27T18:11:19.117Z",
    "removed_by": "removed_by"
  },
  "run": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "cluster_count": 0,
    "created_at": "2019-12-27T18:11:19.117Z",
    "embedding_count": 0,
    "field_id": "field_id",
    "node_count": 0,
    "record_count": 0,
    "source_id": "source_id",
    "source_type": "source_type",
    "status": "pending",
    "tenant_id": "tenant_id",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "error": "error",
    "error_code": "insufficient_data",
    "field_label": "field_label",
    "finished_at": "2019-12-27T18:11:19.117Z",
    "metrics": {
      "foo": "bar"
    },
    "params": {
      "foo": "bar"
    },
    "started_at": "2019-12-27T18:11:19.117Z"
  }
}
Returns Examples
{
  "root": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "label": "label",
    "level": 0,
    "node_type": "root",
    "run_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "sort_order": 0,
    "updated_at": "2019-12-27T18:11:19.117Z",
    "children": [],
    "cluster_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "description": "description",
    "metadata": {
      "foo": "bar"
    },
    "original_label": "original_label",
    "parent_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "removed_at": "2019-12-27T18:11:19.117Z",
    "removed_by": "removed_by"
  },
  "run": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "cluster_count": 0,
    "created_at": "2019-12-27T18:11:19.117Z",
    "embedding_count": 0,
    "field_id": "field_id",
    "node_count": 0,
    "record_count": 0,
    "source_id": "source_id",
    "source_type": "source_type",
    "status": "pending",
    "tenant_id": "tenant_id",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "error": "error",
    "error_code": "insufficient_data",
    "field_label": "field_label",
    "finished_at": "2019-12-27T18:11:19.117Z",
    "metrics": {
      "foo": "bar"
    },
    "params": {
      "foo": "bar"
    },
    "started_at": "2019-12-27T18:11:19.117Z"
  }
}