---
title: "API: getCustomFieldHierarchy"
slug: "api-getcustomfieldhierarchy"
updated: 2022-08-23T16:36:13Z
published: 2022-08-23T16:36:13Z
canonical: "support.smarteru.com/api-getcustomfieldhierarchy"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.
# API: getCustomFieldHierarchy
- SmarterU requires all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
- If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
- Tags are required unless specified.
## **Des****cription**
The getCustomFieldHierarchy method retrieves details about the levels and values for a [custom user field's hierarchy](/v1/docs/account-custom-user-fields#adding-levels-and-values-to-a-hierarchical-custom-user-fields).
## **Who** **Has Access**
[Administrators and owners](/v1/docs/user-profile-information#access-level) have access to the getCustomFieldHierarchy method.
## **AP****I Call XML Package**
```markup
getCustomFieldHierarchy
- OR -
```
## **Cu****stomField Tag Group**
The CustomField tag group is a container for the custom user field filters.
```markup
- OR -
```
The CustomField tag contains one of the following.
### **ID**
The custom user field's system-generated identifier. This is the ID returned by the [listCustomFields](/v1/docs/api-listcustomfields) method. This is mutually exclusive with the Name tag.
### **Na****me**
The [custom user field's name](/v1/docs/account-custom-user-fields#name). This is mutually exclusive with the ID tag.
## **API Respo****nse XML Package**
The API response XML package will always include a Result, Info, and [Errors](/v1/docs/api-getcustomfieldhierarchy#error-codes) tag.
```markup
![CDATA[]]
![CDATA]]
![CDATA[]]
![CDATA[]]
```
The custom user field is contained in a CustomField tag and may contain the following.
### ID
The custom user field's system-generated identifier.
### Name
The custom user field's name.
### Levels
The Levels tag is a container for the [hierarchical custom user field's](/v1/docs/account-custom-user-fields#data-type) levels. Each level is contained in a Level tag and may contain the following.
| Tag | Description |
| --- | --- |
| **LevelID** | The custom user field level's system-generated identifier. |
| **Name** | The custom user field level's name. |
| **Values** | The Values tag is a container for the values assigned to the level. Each value is contained in a Value tag and contains the following: - ValueID - The value's system-generated identifier. - ParentValueID - The system-generated identifier for the value's parent. This tag will be blank if the value does not have a parent (i.e., it's the top value). - Value - The value's name. |
### Example API Response XML Package
```markup
Success
1824
1825
17
4162
1827
19
17
4163
4162
4164
4162
```
## **Error Codes**
| Error Code | Message |
| --- | --- |
| GCFH:01 | The ID provided is not valid. |
| GCFH:02 | The name provided is not valid. |
| GCFH:03 | The required permissions are not met to call the getCustomFieldHierarchy method. |
| GCFH:04 | The custom hierarchy field requested does not exist. |
## Related
- [Account: Custom User Fields](/account-custom-user-fields.md)
- [API: listCustomFields](/api-listcustomfields.md)