---
title: "Post mapping"
method: POST
path: "/schema/{table}/mapping"
tags: ["Schema"]
---

# Post mapping

`POST /schema/{table}/mapping`

## Request

- Base URL: `https://api.lytics.io/v2`
- URL: `https://api.lytics.io/v2/schema/{table}/mapping`
- Auth: API key in header `Authorization`

Upsert a mapping in draft schema.

## Path parameters

- `table` string, required

## Query parameters

- `account_id` string

## Request body `*/*`

- ModelsMapping
  - `created` string, date-time
  - `edit_status` string
  - `expr` string: The LQL expression for the mapping
  - `field` string, required: The target field of the mapping
  - `guard_expr` string: The LQL Guard expression for the mapping
  - `id` string: The ID of the mapping
  - `managed_by` string
  - `modified` string, date-time
  - `stream` string: The stream associated with the mapping

## Response `200`

Mapping

- object
  - `_meta` object: Response Metadata
  - `data` object: Response Payload
    - `created` string, date-time
    - `edit_status` string
    - `expr` string: The LQL expression for the mapping
    - `field` string, required: The target field of the mapping
    - `guard_expr` string: The LQL Guard expression for the mapping
    - `id` string: The ID of the mapping
    - `managed_by` string
    - `modified` string, date-time
    - `stream` string: The stream associated with the mapping
  - `request_id` string
  - `status` integer: HTTP Status Code

## Other responses

- `201`: Mapping
- `400`: Bad Request
- `404`: Not Found
- `500`: Internal Server Error

## Changes

- **2026-11-03** `d8e975057aec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/lytics/apis/lytics-api/changes/schema/:table/mapping/post.md)

---

[API](https://skmtc.dev/lytics/apis/lytics-api.md) - [All operations](https://skmtc.dev/lytics/apis/lytics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lytics/apis/lytics-api/revisions/d8e975057aec?raw)
