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

# Upsert mapping

`POST /api/mapping/upsert`

## Request

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

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