---
title: "saveHierarchyV1"
method: POST
path: "/cruise/hierarchy/v1/saveHierarchy"
tags: ["Hierarchy Service"]
---

# saveHierarchyV1

`POST /cruise/hierarchy/v1/saveHierarchy`

Create a new hierarchy. 
 Update a hierarchy's details. 
 Delete a hierarchy.

## Headers

- `authenticationtoken` string, required
- `password` string
- `sitename` string, required
- `userid` string
- `X-B3-TraceId` string

## Request body

- HierarchyV1DetailsList — HierarchyV1DetailsList
  - `hierarchyDetails` HierarchyV1Details — HierarchyV1Details description
    - `hierarchyDetailDetails` HierarchyDetailDto[], required — "Hierarchy Detail Details" from Hierarchy setup screen
      - `hasChildren` boolean — Indicates whether the hierarchy has more than just one level. Valid values are 'true' or 'false'.
      - `levelDescription` string, required — "Level Description" from Hierarchy setup screen.
      - `levelName` string, required — "Level Name" from Hierarchy setup screen.
      - `levelNumber` integer, required — "Nierarchy Level" number from Hierarchy setup screen.
      - `locationCode` string — "Code" for the physical location from Hierarchy setup screen.
      - `locationName` string — Name for the physical "Location" from Hierarchy setup screen.
      - `logicalName` string — Name for the logical "Location" from Hierarchy setup screen.
      - `parentLogicalName` string — Name of the "Parent Location" from Hierarchy setup screen.
    - `hierarchyHeaderDetails` HierarchyHeaderDto, required — Creates a new Hierarchy or updates the Physical Locations of an existing Hierarchy.
      - `deleteFlag` string — "Delete Flag" indicator. If populated, must be ‘Y' or 'N'. If not populated, will be 'N'.
      - `hierarchyType` string, required — "Hierarchy Type" (the name of the hierarchy) from Hierarchy setup screen.
      - `locationCode` string, required — The Company "Code" from Company setup screen.

## Response `200`

Success

- object

## Other responses

- `400` — Validation Error
- `401` — Authorization
- `429` — Too Many Requests
- `500` — Unexpected Error
- `503` — System under maintenance
- `504` — Timeout

---

[API](https://skmtc.net/crunchtime/apis/inventory-labor.md) · [All operations](https://skmtc.net/crunchtime/apis/inventory-labor/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crunchtime/inventory-labor/revisions/0af8e380ff2c/schema)
