{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-v2/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Get Corporate Hierarchy"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"get-corporate-hierarchy","__idx":0},"children":["Get Corporate Hierarchy"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Most companies you look up aren't standalone. They belong to a corporate family with a global headquarters, parent entities, and subsidiaries. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /companies/hierarchy"]}," returns that structure so you can tell a subsidiary from the parent company that owns it, or find every entity under a group HQ."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-hierarchy-tiers","__idx":1},"children":["The Hierarchy Tiers"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HG organizes a corporate family into four tiers:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/company-hierarchy.bdfff792f52470374b112b8977694d9a3aac606dc8c948ad4ac8990f9639b06d.cfa4363d.svg","alt":"Company hierarchy framework showing Global HQ, Corporate Parent, Domestic Parent, and Subsidiary tiers for Microsoft and Alphabet"},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tier"},"children":["Tier"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Global HQ"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The top of the corporate family, the ultimate parent entity worldwide"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Corporate parent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A parent entity below global HQ, typically owning a specific business unit or acquisition"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Domestic parent"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The parent entity within a specific country, relevant for multinational groups where a local entity sits between the corporate parent and in-country subsidiaries"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Subsidiary / site"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A company or site that rolls up to one of the parent tiers above"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A company can be more than one tier at once. Microsoft Corporation is both the Global HQ and (in the US) effectively its own domestic/corporate parent, since it has no entity above it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoint","__idx":2},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"POST /data-api/v2/companies/hierarchy\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request","__idx":3},"children":["Request"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Identify the company by HG ID or domain, then choose a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mode"]}," to control how much of the tree comes back."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"hierarchy\": {\n    \"id\": \"1698C53EBC888758570396E0334965C1\"\n  },\n  \"mode\": \"full\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hierarchy.id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes*"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HG company ID"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hierarchy.domain"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes*"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Company domain"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["full"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["children"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parents"]}," (see below)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tree"]}," (default, nested) or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list"]}," (flat)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selected_fields"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fields to return per node, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filters"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["object"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["countries"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["regions"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tiers"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["max_tier"]},", see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#filtering"},"children":["Filtering"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sort"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sort directives, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#sorting"},"children":["Sorting"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["*Either ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hierarchy.id"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hierarchy.domain"]}," is required, not both."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"traversal-modes","__idx":4},"children":["Traversal Modes"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["full"]}]},": returns the entire tree rooted at the Global HQ, regardless of which company you matched. Every node in the corporate family comes back."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["children"]}]},": returns the subtree rooted at the company you matched, including all its subsidiaries and their descendants. Use this to see what rolls up under a specific entity."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parents"]}]},": returns only the ancestor chain from the Global HQ down to the matched company, with no siblings or cousins. Use this to find what a specific subsidiary belongs to."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"response","__idx":5},"children":["Response"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"hierarchy\": {\n    \"id\": \"1698C53EBC888758570396E0334965C1\",\n    \"name\": \"Walmart Inc.\",\n    \"company_level\": \"Group HQ\",\n    \"parent_id\": null,\n    \"selected\": false,\n    \"children\": []\n  },\n  \"count\": 110\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["count"]}," is the total number of entities in the returned hierarchy, capped at 1,200 rows. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selected"]}," marks the node matching your original ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hierarchy.id"]},"/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain"]}," lookup, useful when you requested ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mode: full"]}," and need to find your starting point in a larger tree."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]}," is each node's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["immediate"]}," parent, not the Global HQ. In ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format: list"]},", every node carries its own ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]},", so you can reconstruct the full tree client-side by linking each company to the node whose ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," matches its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]},". That's the same way the diagram above was built."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Need more than the tree?"]}," The hierarchy response only returns the fields you select, no firmographics, technographics, or spend. To get the full profile for any company in the tree, take its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," and pass it to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/v2/guides/enrichment"},"children":["Enrich Companies"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"https://api.hginsights.com/data-api/v2/companies/enrich\" \\\n  -H \"Authorization: Bearer $HG_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"companies\": {\n      \"ids\": [\"1698C53EBC888758570396E0334965C1\"]\n    },\n    \"fields\": [\"firmographics\", \"technographics\", \"spend\"]\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"fields","__idx":6},"children":["Fields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By default, each node includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_normalized"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company_level"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]},". Override with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["selected_fields"]}," to get more:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"hierarchy\": {\"domain\": \"walmart.com\"},\n  \"mode\": \"full\",\n  \"selected_fields\": [\n    \"id\", \"name\", \"domain\", \"company_level\",\n    \"global_hq_id\", \"global_hq_name\",\n    \"corporate_parent_id\", \"corporate_parent_name\",\n    \"domestic_parent_id\", \"domestic_parent_name\",\n    \"revenue_total\", \"employees_total\", \"country_code\"\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Full list: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domain_normalized"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company_level"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["global_hq_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["global_hq_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["corporate_parent_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["corporate_parent_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domestic_parent_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domestic_parent_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["parent_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country_code"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["country_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["city_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["state_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revenue_total"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revenue_band"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["employees_total"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["employees_band"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["industry_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["naics_code"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["naics_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sic_codes"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sic_names"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"filtering","__idx":7},"children":["Filtering"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["countries"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["regions"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tiers"]}," all require ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format: list"]},". They return a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 FILTER_NOT_VALID_FOR_TREE"]}," error if used with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format: tree"]}," (including the default). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["max_tier"]}," works with either format and is the one way to limit tree depth."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"hierarchy\": {\"id\": \"1698C53EBC888758570396E0334965C1\"},\n  \"mode\": \"full\",\n  \"format\": \"list\",\n  \"filters\": {\n    \"countries\": [\"BR\"],\n    \"regions\": [\"EMEA\"],\n    \"tiers\": [\"corporate_parent\", \"domestic_parent\"],\n    \"max_tier\": \"subsidiary\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"colgroup","attributes":{},"children":[{"$$mdtype":"Tag","name":"col","attributes":{"style":{"width":"18%"}},"children":[]},{"$$mdtype":"Tag","name":"col","attributes":{"style":{"width":"82%"}},"children":[]}]},{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{},"children":["Filter"]},{"$$mdtype":"Tag","name":"th","attributes":{},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["countries"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ISO 3166-1 alpha-2 country codes. Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format: list"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["regions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AMER"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EMEA"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["APAC"]},", OR'd with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["countries"]},". Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format: list"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tiers"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Restrict to specific tiers: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["group_hq"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["corporate_parent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domestic_parent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subsidiary"]},". Requires ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["format: list"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["max_tier"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Restrict to companies at or above this tier (same four values). Works with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tree"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list"]},", use it to cap how deep a tree goes."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Naming note:"]}," the hierarchy endpoint's own tier values (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["group_hq"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["corporate_parent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["domestic_parent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subsidiary"]},") use different casing than the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["company_level"]}," filter on ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/v2/guides/find-companies"},"children":["Company Search"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GLOBAL_HEADQUARTER"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CORPORATE_PARENT"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DOMESTIC_PARENT"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ALL_ENTITIES"]},"). They refer to the same concepts, just don't copy-paste one filter's values into the other endpoint."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sorting","__idx":8},"children":["Sorting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sort by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["revenue_total"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["employees_total"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name"]},", with control over null placement:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"hierarchy\": {\"id\": \"1698C53EBC888758570396E0334965C1\"},\n  \"mode\": \"full\",\n  \"format\": \"list\",\n  \"sort\": [\n    {\"field\": \"revenue_total\", \"order\": \"desc\", \"nulls\": \"last\"}\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"preview-credit-cost","__idx":9},"children":["Preview Credit Cost"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/companies/hierarchy"]}," consumes credits based on data returned. Preview the cost first with the same request body:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"POST /data-api/v2/companies/hierarchy/estimate\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/v2/guides/credits-and-usage#estimating-cost-before-you-call"},"children":["Credits and Usage"]}," for the general estimate response shape."]}]},"headings":[{"value":"Get Corporate Hierarchy","id":"get-corporate-hierarchy","depth":1},{"value":"The Hierarchy Tiers","id":"the-hierarchy-tiers","depth":2},{"value":"Endpoint","id":"endpoint","depth":2},{"value":"Request","id":"request","depth":2},{"value":"Traversal Modes","id":"traversal-modes","depth":3},{"value":"Response","id":"response","depth":2},{"value":"Fields","id":"fields","depth":2},{"value":"Filtering","id":"filtering","depth":2},{"value":"Sorting","id":"sorting","depth":2},{"value":"Preview Credit Cost","id":"preview-credit-cost","depth":2}],"frontmatter":{"seo":{"title":"Get Corporate Hierarchy"}},"lastModified":"2026-10-09T20:11:57.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/v2/guides/hierarchy","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}