# Create a mapping `POST /catalog/v1/{catalog_id}/mappings` ## Request example ```bash curl --request POST \ --url 'https://api.eu1.luigisbox.ai/catalog/v1//mappings' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "catalog_type": "example", "mapping": {} }' ``` ## Path Parameters | Name | Type | Required | Description | Constraints | |---|---|---|---|---| | `catalog_id` | `string` | Yes | Catalog Id | — | ## Request Body **Required.** ### application/json Schema: `object` #### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `catalog_type` | `string` | Yes | Catalog Type | >= 1 characters | | `mapping` | `object` | Yes | Attribute-mapping DSL as a `source -> target` object, e.g. `{"name": "@title", "price": "price_amount \| to_f"}`. Keys select fields on the incoming item; each value is a target spec — an optional target field name followed by optional `\|`-chained transform filters. Omit the name (`"\| to_s"`) to transform the field in place, or pass a list of specs to write several targets from one source. A renamed source key is moved rather than copied, so list the original name among the targets to keep it; unmapped fields pass through unchanged. The object is open: any source field name is a valid key. | — | | `mapping.*` | `any` | No | Additional property. | — | #### Request body example ```json { "catalog_type": "example", "mapping": {} } ``` ## Responses | Status | Description | Content | |---|---|---| | `201` | Successful Response | application/json: object | | `401` | Missing or invalid credentials | application/json: object | | `403` | Authenticated but not permitted | application/json: object | | `422` | Request validation failed | application/json: object | ### 201 Successful Response #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `catalog_id` | `string` | Yes | Catalog Id | — | | `catalog_type` | `string` | Yes | Catalog Type | — | | `created_at` | `string` | Yes | Created At | format: date-time | | `mapping` | `object` | Yes | Attribute-mapping DSL as a `source -> target` object, e.g. `{"name": "@title", "price": "price_amount \| to_f"}`. Keys select fields on the incoming item; each value is a target spec — an optional target field name followed by optional `\|`-chained transform filters. Omit the name (`"\| to_s"`) to transform the field in place, or pass a list of specs to write several targets from one source. A renamed source key is moved rather than copied, so list the original name among the targets to keep it; unmapped fields pass through unchanged. The object is open: any source field name is a valid key. | — | | `mapping.*` | `any` | No | Additional property. | — | | `mapping_id` | `integer` | Yes | Mapping Id | — | | `updated_at` | `string` | Yes | Updated At | format: date-time | | `updated_by` | `anyOf(string, null)` | Yes | Updated By | — | | `version` | `integer` | Yes | Version | — | ##### Response example ```json { "catalog_id": "example", "catalog_type": "example", "created_at": "2026-04-15T12:00:00Z", "mapping": {}, "mapping_id": 1, "updated_at": "2026-04-15T12:00:00Z", "updated_by": "example", "version": 1 } ``` ### 401 Missing or invalid credentials #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 403 Authenticated but not permitted #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ``` ### 422 Request validation failed #### application/json Schema: `object` ##### Attributes | Attribute | Type | Required | Description | Constraints | |---|---|---|---|---| | `exception_details` | `object` | No | Machine-readable error context; empty object when there is nothing to add. | — | | `exception_details.validation_errors` | `anyOf(Array, null)` | No | Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value. | — | | `exception_details.validation_errors[].loc` | `Array` | Yes | Path to the offending value from the request root, e.g. `["body", "filters", 0, "operator"]`. | — | | `exception_details.validation_errors[].msg` | `string` | Yes | What is wrong with the value at `loc`. | — | | `exception_details.validation_errors[].type` | `string` | Yes | Stable machine code for the problem, e.g. `missing` or `string_too_short`. | — | | `exception_details.*` | `any` | No | Additional property. | — | | `reason` | `string` | Yes | Human-readable, actionable error message. | — | | `request_id` | `anyOf(string, null)` | No | Request correlation ID (matches the X-Request-Id response header). | — | ##### Response example ```json { "exception_details": { "validation_errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ] }, "reason": "example", "request_id": "example" } ```