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

# Upsert

`POST /api/group-hierarchy/upsert`

## Request

- Base URL: `https://indexing-dev.hawksearch.net`
- URL: `https://indexing-dev.hawksearch.net/api/group-hierarchy/upsert`
- Auth: none declared. Required headers: `X-HawkSearch-ApiKey`
- TypeScript: <https://skmtc.dev/hawksearch/apis/hawksearch-elasticsearch-indexingapi/docs/api/group-hierarchy/upsert/post.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/hawksearch/apis/hawksearch-elasticsearch-indexingapi.md) - [All operations](https://skmtc.dev/hawksearch/apis/hawksearch-elasticsearch-indexingapi/llms.txt) - [OpenAPI document](https://skmtc.dev/hawksearch/apis/hawksearch-elasticsearch-indexingapi/revisions/24cba7bf3468?raw)
