Skip to content

    Pre-launch API. The concepts described here are settled, but the API shape is not: request and response fields, parameters and defaults can still change. Build against it, and talk to your Luigi's Box contact before you put an integration into production.

    Update a mapping

    View source
    PATCH
    /catalog/v1/{catalog_id}/mappings/{mapping_id}
    curl --request PATCH \
    --url https://api.eu1.luigisbox.ai/catalog/v1/example/mappings/1 \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{ "expected_version": 1, "mapping": {} }'

    Replace the mapping’s rules and return it with its new version.

    expected_version must be the mapping’s current version; otherwise the update is a 409 and nothing changes. The new rules are checked as on create.

    catalog_id
    required
    Catalog Id
    string
    mapping_id
    required
    Mapping Id

    The mapping’s mapping_id.

    integer
    >= 1 <= 9007199254740991

    The mapping’s mapping_id.

    Media type application/json
    CatalogMappingUpdate
    object
    expected_version
    required
    Expected Version

    The mapping’s version this change is based on; a stored version that has moved on is a 409.

    integer
    <= 2147483647
    mapping
    required
    Mapping

    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.

    object
    key
    additional properties
    any
    Example generated
    {
    "expected_version": 1,
    "mapping": {}
    }

    Successful Response

    Media type application/json
    CatalogMapping
    object
    catalog_id
    required
    Catalog Id
    string
    catalog_type
    required
    Catalog Type
    string
    created_at
    required
    Created At
    string format: date-time
    mapping
    required
    Mapping

    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.

    object
    key
    additional properties
    any
    mapping_id
    required
    Mapping Id
    integer
    updated_at
    required
    Updated At
    string format: date-time
    updated_by
    required
    Any of:
    string
    version
    required
    Version
    integer
    Example generated
    {
    "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
    }

    Missing or invalid credentials

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Authenticated but not permitted

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Resource not found

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    State conflict

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Request validation failed. A mapping with a rule that cannot apply to any record lists every problem at once in exception_details.mapping_problems: mapping_rule_invalid for a target spec that does not parse or an @defaults that is not an object, mapping_target_invalid for a target that is not a string, mapping_transform_unknown for an unknown transform.

    Media type application/json
    Any of:
    MappingProblemsError

    Error body returned when a mapping holds rules that cannot apply to any record.

    exception_details.mapping_problems lists every problem; reason names the first one.

    object
    exception_details
    required
    MappingProblems

    Machine-readable error context: every problem found in the mapping.

    object
    mapping_problems
    required
    Mapping Problems

    Every problem found in one pass over the mapping, in mapping order; never truncated.

    Array<object>
    MappingProblem

    One mapping rule that cannot apply to any record.

    object
    code
    required
    MappingProblemCode

    Stable machine code of the problem.

    string
    Allowed values: mapping_rule_invalid mapping_target_invalid mapping_transform_unknown
    key
    required
    Key

    The rule’s key as written in the mapping, e.g. price.

    string
    message
    required
    Message

    Human-readable explanation of the problem; may be reworded.

    string
    target_specification
    required
    Any of:
    string
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example
    {
    "exception_details": {
    "mapping_problems": [
    {
    "code": "mapping_rule_invalid"
    }
    ]
    }
    }

    Service temporarily unavailable

    Media type application/json
    ErrorResponse

    Canonical error body — every non-2xx response uses this shape.

    object
    exception_details
    ExceptionDetails

    Machine-readable error context; empty object when there is nothing to add.

    object
    error_code
    Error Code

    Stable machine code naming why a well-formed request was refused: snake_case, prefixed by its domain — e.g. filter_unknown_field or cursor_mismatch. Safe to branch on; reason is not. Absent when the status code says all there is to say.

    string
    validation_errors
    Validation Errors

    Every field-level problem found in the request, when validation is what failed. Absent when the rejection is not about a specific value.

    Array<object>
    ValidationProblem

    One field-level reason a request was rejected.

    object
    loc
    required
    Loc

    Path to the offending value from the request root, e.g. ["body", "filters", 0, "operator"].

    Array
    msg
    required
    Msg

    What is wrong with the value at loc.

    string
    type
    required
    Type

    Stable machine code for the problem, e.g. missing or string_too_short.

    string
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Any of:
    string
    Example generated
    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }