---
title: "Get the root of a hierarchy"
method: GET
path: "/hierarchies/{instance_id}/{dimension_name}"
---

# Get the root of a hierarchy

`GET /hierarchies/{instance_id}/{dimension_name}`

## Request

- Base URL: `/v1` (relative, and the document’s source URL is not known)
- URL: `/v1/hierarchies/{instance_id}/{dimension_name}`
- Auth: none declared

Get the root of the hierarchy for the given dimension name

## Response `200`

The hierarchy root was found and returned

- HierarchyResponse: The top-level node of a hierarchy
  - `children` NodeRef[]: The children of the top-level node of this hierarchy
    - `has_data` boolean: True if the instance has an observation for this code
    - `label` string: The label for this child node
    - `links` Links: A list of links related to this node
      - `code` Link: A link to a given resource
        - `id` string
        - `href` string
      - `self` SelfLink: A link to the given resource
        - `href` string: A url to this resource
    - `no_of_children` integer: The number of child nodes that this node has
  - `has_data` boolean: True if the instance has an observation for this code
  - `label` string: A label for this node
  - `links` Links: A list of links related to this node
    - `code` Link: A link to a given resource
      - `id` string
      - `href` string
    - `self` SelfLink: A link to the given resource
      - `href` string: A url to this resource
  - `no_of_children` integer: The number of child nodes that this node has

## Other responses

- `404`: Instance or dimension name not found
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/hierarchy-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/hierarchy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/hierarchy-api/revisions/d4d59ae75363?raw)
