**Service** **InventoryService** [PublisherQueryLanguageService](https://developers.google.com/ad-manager/api/reference/v202605/PublisherQueryLanguageService.AdUnitHierarchyError) **Inheritance** [ApiError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.ApiError) ▼ [AdSenseAccountError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AdSenseAccountError) [AdUnitCodeError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AdUnitCodeError) **AdUnitHierarchyError** [ApiVersionError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.ApiVersionError) [AuthenticationError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AuthenticationError) [CollectionSizeError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.CollectionSizeError) [CommonError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.CommonError) [CompanyError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.CompanyError) [CreativeWrapperError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.CreativeWrapperError) [CrossSellError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.CrossSellError) [EntityChildrenLimitReachedE...](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.EntityChildrenLimitReachedError "EntityChildrenLimitReachedError") [EntityLimitReachedError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.EntityLimitReachedError) [FeatureError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.FeatureError) [FrequencyCapError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.FrequencyCapError) [InternalApiError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.InternalApiError) [InvalidColorError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.InvalidColorError) [InvalidUrlError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.InvalidUrlError) [InventoryUnitError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.InventoryUnitError) [InventoryUnitRefreshRateError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.InventoryUnitRefreshRateError) [InventoryUnitSizesError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.InventoryUnitSizesError) [LabelEntityAssociationError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.LabelEntityAssociationError) [NotNullError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.NotNullError) [NullError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.NullError) [ParseError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.ParseError) [PermissionError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.PermissionError) [PublisherQueryLanguageConte...](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.PublisherQueryLanguageContextError "PublisherQueryLanguageContextError") [PublisherQueryLanguageSynta...](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.PublisherQueryLanguageSyntaxError "PublisherQueryLanguageSyntaxError") [QuotaError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.QuotaError) [RangeError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.RangeError) [RegExError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.RegExError) [RequiredCollectionError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.RequiredCollectionError) [RequiredError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.RequiredError) [RequiredNumberError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.RequiredNumberError) [ServerError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.ServerError) [StatementError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.StatementError) [StringFormatError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.StringFormatError) [StringLengthError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.StringLengthError) [TeamError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.TeamError) [TypeError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.TypeError) [UniqueError](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.UniqueError)

Caused by creating an [AdUnit](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AdUnit) object with an invalid hierarchy.

*** ** * ** ***

Namespace
:
    `https://www.google.com/apis/ads/publisher/v202605`

| ## Field ||
|---|---|
| **`ApiError` (inherited)** ||
| ### `fieldPath` | ` xsd:string` The OGNL field path to identify cause of error. |
| ### `fieldPathElements` | ` https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.FieldPathElement[]` A parsed copy of the field path. For example, the field path "operations\[1\].operand" corresponds to this list: {FieldPathElement(field = "operations", index = 1), FieldPathElement(field = "operand", index = null)}. |
| ### `trigger` | ` xsd:string` The data that caused the error. |
| ### `errorString` | ` xsd:string` A simple string representation of the error and reason. |
| **`AdUnitHierarchyError`** ||
| ### `reason` | ` https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AdUnitHierarchyError.Reason ` *** ** * ** *** **Enumerations** `INVALID_DEPTH` :   The depth of the [AdUnit](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AdUnit) in the inventory hierarchy is greater than is allowed. The maximum allowed depth is two below the effective root ad unit for Ad Manager 360 accounts and is one level below the effective root ad unit for Ad Manager accounts. `INVALID_PARENT` :   The only valid [AdUnit.parentId](https://developers.google.com/ad-manager/api/reference/v202605/InventoryService.AdUnit#parentId) for an Ad Manager account is the [Network.effectiveRootAdUnitId](https://developers.google.com/ad-manager/api/reference/v202605/NetworkService.Network#effectiveRootAdUnitId), Ad Manager 360 accounts can specify an ad unit hierarchy with more than two levels. `UNKNOWN` :   The value returned if the actual value is not exposed by the requested API version. <br /> |