> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enfuce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hierarchy API

> Card hierarchy defines a tree-structure that separates card space in non-intersecting groups. Such groups can be further used for ruleset attachments via Spend Control API.

Key Points:

* Only one card-hierarchy can be active at the same time. Only active hierarchy is taken into account when evaluating Spend Control rules.
* Whenever you create a card-hierarchy, a root group (`type: ROOT`) is created with the same name and id.
* You cannot create a detached group, so whenever you create a group, you should specify a parentId.
* Cards (and only cards, not other subgroups) can be attached only to a group with `type: CARD`. If you want to create a group that will be split further into subgroups, use `type: INTERMEDIATE`
* You can move a card or a group from one group to another
* You can delete a group, but only if it does not contain any cards or subgroups. If you want to delete a group with cards or subgroups, you should specify a query parameter `recursive=true`
* If you want to migrate to a completely different hierarchy, you should create a new inactive hierarchy, add all cards to it, and then activate it.

<Frame>
  <img src="https://mintcdn.com/enfucefinancialservicesltd-mtje7p526we/MiSOf9sxkRTfiVub/images/card-hierarchies.png?fit=max&auto=format&n=MiSOf9sxkRTfiVub&q=85&s=9674f08d43f065e58114d8b9101e0fef" width="1661" height="962" data-path="images/card-hierarchies.png" />
</Frame>

### Disclaimer

This feature is sold separately. Please contact our sales department for more information.

<CardGroup cols={2}>
  <Card title="Download OpenAPI specification" href="https://enfuce-public-resources.s3.eu-central-1.amazonaws.com/public/api/cia/external/hierarchy/hierarchy.json" />
</CardGroup>

For any questions, contact us:

* [Enfuce Support Portal](https://enfuce.atlassian.net/servicedesk/customer/portal/6)
* [Enfuce website](https://enfuce.com)

<CardGroup cols={2}>
  <Card title="Card Hierarchy Management" icon="arrow-right" href="/payment/api/card-hierarchy-management" horizontal />

  <Card title="Card Hierarchy Group Management" icon="arrow-right" href="/payment/api/card-hierarchy-group-management" horizontal />

  <Card title="Card Management in Card Hierarchy Groups" icon="arrow-right" href="/payment/api/card-management-in-card-hierarchy-groups" horizontal />
</CardGroup>
