---
title: "Upsert mapping"
method: POST
path: "/api/mapping/upsert"
tags: ["Mapping"]
---

# Upsert mapping

`POST /api/mapping/upsert`

Add new or update existing mappings

## Headers

- `X-HawkSearch-ApiKey` string, required

## Request body

- CustomMappingUpsertParams — Create custom mapping params
  - `IndexName` string — Index used for operation
  - `Mappings` CustomMappingModel[] — Array of custom mappings
    - `Label` string — Mapping label
    - `Field` string — Field name
    - `Value` string — Mapping Value
    - `SortOrder` integer — Nnumber defining the order

## 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)
