> For the complete documentation index, see [llms.txt](https://api-docs.myhappyforce.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.myhappyforce.com/docs/api-reference/hierarchy-resource.md).

# Hierarchy Resource

## GET /api/v1/company/hierarchy/{hierarchyId}

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"CompanyHierarchyDTO":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":"string"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}},"siloId":{"type":"string"},"expectedEmployees":{"type":"integer","format":"int32"},"activeEmployees":{"type":"integer","format":"int32"},"resetAssignments":{"type":"boolean"}}}}},"paths":{"/api/v1/company/hierarchy/{hierarchyId}":{"get":{"tags":["hierarchy-resource"],"operationId":"getHierarchy","parameters":[{"name":"hierarchyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}}}}}}}}
```

## PUT /api/v1/company/hierarchy/{hierarchyId}

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"CompanyHierarchyDTO":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":"string"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}},"siloId":{"type":"string"},"expectedEmployees":{"type":"integer","format":"int32"},"activeEmployees":{"type":"integer","format":"int32"},"resetAssignments":{"type":"boolean"}}}}},"paths":{"/api/v1/company/hierarchy/{hierarchyId}":{"put":{"tags":["hierarchy-resource"],"operationId":"updateHierarchy","parameters":[{"name":"hierarchyId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}}}}}}}}}
```

## DELETE /api/v1/company/hierarchy/{hierarchyId}

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"CompanyHierarchyDTO":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":"string"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}},"siloId":{"type":"string"},"expectedEmployees":{"type":"integer","format":"int32"},"activeEmployees":{"type":"integer","format":"int32"},"resetAssignments":{"type":"boolean"}}}}},"paths":{"/api/v1/company/hierarchy/{hierarchyId}":{"delete":{"tags":["hierarchy-resource"],"operationId":"deleteHierarchy","parameters":[{"name":"hierarchyId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}}}}}}}}}
```

## GET /api/v1/company/hierarchy

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"CompanyHierarchyDTO":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":"string"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}},"siloId":{"type":"string"},"expectedEmployees":{"type":"integer","format":"int32"},"activeEmployees":{"type":"integer","format":"int32"},"resetAssignments":{"type":"boolean"}}}}},"paths":{"/api/v1/company/hierarchy":{"get":{"tags":["hierarchy-resource"],"operationId":"getHierarchies","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}}}}}}}}}
```

## POST /api/v1/company/hierarchy

>

```json
{"openapi":"3.1.0","info":{"title":"Happyforce API","version":"v1"},"tags":[],"servers":[{"url":"{url}","description":"API URL","variables":{"url":{"description":"API Environment","enum":["https://api.happyforce.com","https://staging.happyforce.com","http://localhost:9000"],"default":"https://api.happyforce.com"}}}],"security":[{"companyAPISessionId":[]}],"components":{"securitySchemes":{"companyAPISessionId":{"type":"apiKey","description":"SessionId","name":"SessionId","in":"header"}},"schemas":{"CompanyHierarchyDTO":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":"string"},"name":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}},"siloId":{"type":"string"},"expectedEmployees":{"type":"integer","format":"int32"},"activeEmployees":{"type":"integer","format":"int32"},"resetAssignments":{"type":"boolean"}}}}},"paths":{"/api/v1/company/hierarchy":{"post":{"tags":["hierarchy-resource"],"operationId":"addHierarchy","requestBody":{"content":{"*/*":{"schema":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CompanyHierarchyDTO"}}}}}}}}}}
```
