> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IAttributeHierarchiesService

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/workspace/attributeHierarchies/index.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Service for handle workspace attribute hierarchies

**Signature:**

```typescript
export interface IAttributeHierarchiesService 
```

## Methods

| Method | Description |
| --- | --- |
| [createAttributeHierarchy(title, attributes)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributehierarchiesservice/index.md#iattributehierarchiesservicecreateattributehierarchy) | **_(ALPHA)_** Creates attribute hierarchy |
| [deleteAttributeHierarchy(attributeHierarchyId)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributehierarchiesservice/index.md#iattributehierarchiesservicedeleteattributehierarchy) | **_(ALPHA)_** Deletes attribute hierarchy |
| [getDateHierarchyTemplates()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributehierarchiesservice/index.md#iattributehierarchiesservicegetdatehierarchytemplates) | **_(ALPHA)_** Gets hierarchy template for date dataset |
| [getValidDescendants(attributes)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributehierarchiesservice/index.md#iattributehierarchiesservicegetvaliddescendants) | **_(ALPHA)_** Gets valid descendants for given attributes |
| [updateAttributeHierarchy(catalogAttributeHierarchy)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iattributehierarchiesservice/index.md#iattributehierarchiesserviceupdateattributehierarchy) | **_(ALPHA)_** Updates attribute hierarchy |

## Method details

### IAttributeHierarchiesService.createAttributeHierarchy()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Creates attribute hierarchy

**Signature:**

```typescript
createAttributeHierarchy(title: string, attributes: ObjRef[]): Promise<ICatalogAttributeHierarchy>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| title | string |  |
| attributes | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md)[] |  |

**Returns:**

Promise&lt;[ICatalogAttributeHierarchy](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icatalogattributehierarchy/index.md)&gt;

### IAttributeHierarchiesService.deleteAttributeHierarchy()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Deletes attribute hierarchy

**Signature:**

```typescript
deleteAttributeHierarchy(attributeHierarchyId: string): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| attributeHierarchyId | string |  |

**Returns:**

Promise&lt;void&gt;

### IAttributeHierarchiesService.getDateHierarchyTemplates()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Gets hierarchy template for date dataset

**Signature:**

```typescript
getDateHierarchyTemplates(): Promise<IDateHierarchyTemplate[]>;
```
**Returns:**

Promise&lt;[IDateHierarchyTemplate](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.idatehierarchytemplate/index.md)[]&gt;

### IAttributeHierarchiesService.getValidDescendants()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Gets valid descendants for given attributes

**Signature:**

```typescript
getValidDescendants(attributes: ObjRef[]): Promise<ObjRef[]>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| attributes | [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md)[] |  |

**Returns:**

Promise&lt;[ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md)[]&gt;

### IAttributeHierarchiesService.updateAttributeHierarchy()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Updates attribute hierarchy

**Signature:**

```typescript
updateAttributeHierarchy(catalogAttributeHierarchy: ICatalogAttributeHierarchy): Promise<ICatalogAttributeHierarchy>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| catalogAttributeHierarchy | [ICatalogAttributeHierarchy](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icatalogattributehierarchy/index.md) |  |

**Returns:**

Promise&lt;[ICatalogAttributeHierarchy](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.icatalogattributehierarchy/index.md)&gt;
