---
title: "Create a field map"
method: POST
path: "/v1/contexts/{contextId}/sources/{sourceId}/field-maps"
tags: ["Configuration Field Maps"]
---

# Create a field map

`POST /v1/contexts/{contextId}/sources/{sourceId}/field-maps`

Use this endpoint to create a field map for a specific source within a context. Field maps define how source fields are mapped to reconciliation fields.

## Path parameters

- `contextId` string, required
- `sourceId` string, required

## Headers

- `X-Request-Id` string
- `X-Idempotency-Key` string

## Request body

- CreateFieldMapRequest
  - `mapping` object, required

## Response `201`

Successfully created field map.

The response includes the `X-Idempotency-Replayed` header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See [Retries and idempotency](/en/reference/retries-idempotency) for more details.

- FieldMapResponse
  - `contextId` string
  - `createdAt` string
  - `id` string
  - `mapping` object
  - `sourceId` string
  - `updatedAt` string
  - `version` integer

## Other responses

- `400` — Invalid request payload
- `401` — The request lacks valid authentication credentials.
- `403` — You do not have permission to access this resource.
- `404` — Context or source not found
- `409` — Idempotency conflict: request with same key in progress
- `500` — An unexpected error occurred on the server.

---

[API](https://skmtc.net/lerian/apis/identity-plugin.md) · [All operations](https://skmtc.net/lerian/apis/identity-plugin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lerian/identity-plugin/versions/25daba385532/schema)
