---
title: "Upsert"
method: POST
path: "/api/group-hierarchy/upsert"
tags: ["GroupHierarchy"]
---

# Upsert

`POST /api/group-hierarchy/upsert`

Upserts Hierarchy for Client Group

## Headers

- `X-HawkSearch-ApiKey` string, required

## Request body

- CreateHierarchyParams — Create hierarchy params
  - `IndexName` string — Index used for operation
  - `Hierarchies` HierarchyModel[] — Array of categories
    - `HierarchyId` string — Id of a category
    - `Name` string — Category Name
    - `ParentHierarchyId` string — Id of parent category
    - `IsActive` boolean — Is Active ?
    - `SortOrder` integer — Sort order of a category
    - `Url` string — Url of hierarchy
    - `ImageUrl` string — Image Url
    - `Custom` string — Custom field

## Response `200`

OK

- object

---

[API](https://skmtc.net/hawksearch/apis/hawksearch-elasticsearch-indexingapi.md) · [All operations](https://skmtc.net/hawksearch/apis/hawksearch-elasticsearch-indexingapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hawksearch/hawksearch-elasticsearch-indexingapi/versions/24cba7bf3468/schema)
