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 attribute metadata

    View source
    PATCH
    /catalog/v1/{catalog_id}/types/{object_type}/attribute-metadata
    curl --request PATCH \
    --url https://api.eu1.luigisbox.ai/catalog/v1/example/types/example/attribute-metadata \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{ "items": [] }'

    Merge metadata into one or more of an object type’s attributes, and read back what they now hold.

    Every level merges: an attribute, a value or a key the request leaves out is unchanged, and null clears the one it names, so "metadata": null, "values": null removes all of an attribute’s metadata. An attribute the request sets a key on must be one the object type has — a registered @ slot, or a name the catalog’s last ingest inferred on that type — so metadata can only be set once an ingest has delivered the object type. An object type the catalog does not have is refused with catalog_type_unknown.

    Each item names the version its change is based on, or null for an attribute that carries no metadata yet. Every item applies or none does: if any version is no longer current, nothing changes and the 412 names each stale item by its index.

    The response carries every attribute the request named that holds metadata afterwards, as list_catalog_attribute_metadata returns it; one the request emptied is omitted.

    catalog_id
    required
    Catalog Id
    string
    object_type
    required
    Object Type

    The object type, such as product.

    string
    >= 1 characters <= 64 characters /^[^/:\s\x00]+$/

    The object type, such as product.

    Media typeapplication/json
    AttributeMetadataBatchUpdate

    Changes to the metadata of one or more attributes of an object type.

    Every item applies or none does, so the attributes never end up in a mix of old and new state. One attribute appears at most once.

    object
    items
    Items

    The attributes to change, each naming the version it is based on. At most 100 attributes and 500 value entries across them per request.

    Array<object>
    default: <= 100 items
    AttributeMetadataItem

    Changes to one attribute: its own metadata and its values’ metadata, each merged separately.

    object
    attribute_name
    required
    Attribute Name

    The catalog attribute to change.

    string
    >= 1 characters <= 256 characters /^[^\x00]*$/
    metadata

    Changes to the attribute’s own metadata. null clears the whole map; omit it to leave the map unchanged.

    Any of:
    AttributeMetadataMapUpdate

    Changes to one metadata map: a key set to a value is set, null clears it, and a key left out is unchanged.

    Any key takes a string, integer or number; the keys below are format-checked.

    object
    <= 32 properties
    color
    Color

    Hex color, #RGB or #RRGGBB, stored as sent. null clears it.

    Any of:
    string
    /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/
    currency
    Currency

    Uppercase ISO 4217 currency code, e.g. EUR. null clears it.

    Any of:
    string
    >= 3 characters <= 3 characters
    Allowed values: AED AFN ALL AMD AOA ARS AUD AWG AZN BAM BBD BDT BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UYW UZS VED VES VND VUV WST XAD XAF XAG XAU XBA XBB XBC XBD XCD XCG XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWG
    image_url
    Image Url

    Absolute https URL of an image, at most 2048 characters, in standard form — lowercase host, no default port, a path of at least /, any character a URL cannot hold percent-encoded — and stored as sent. null clears it.

    Any of:
    string
    <= 2048 characters
    label
    Label

    Display name. null clears it.

    Any of:
    string
    >= 1 characters <= 2048 characters /^[^\x00]*$/
    unit
    Unit

    Unit of measure, e.g. cm. null clears it.

    Any of:
    string
    >= 1 characters <= 2048 characters /^[^\x00]*$/
    key
    additional properties
    Any of:
    string
    <= 2048 characters /^[^\x00]*$/
    values
    Values

    Changes to the metadata of the attribute’s raw values, keyed by the value exactly as the catalog holds it. A null entry removes that value’s metadata; null for the whole map removes every value’s metadata. Values left out are unchanged.

    Any of:
    object
    key
    additional properties
    Any of:
    AttributeValueMetadataUpdate

    Changes to one raw value’s metadata.

    object
    metadata

    Changes to the value’s metadata. null clears the whole map, removing the value; omit it to leave the value unchanged.

    Any of:
    AttributeMetadataMapUpdate

    Changes to one metadata map: a key set to a value is set, null clears it, and a key left out is unchanged.

    Any key takes a string, integer or number; the keys below are format-checked.

    object
    <= 32 properties
    color
    Color

    Hex color, #RGB or #RRGGBB, stored as sent. null clears it.

    Any of:
    string
    /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/
    currency
    Currency

    Uppercase ISO 4217 currency code, e.g. EUR. null clears it.

    Any of:
    string
    >= 3 characters <= 3 characters
    Allowed values: AED AFN ALL AMD AOA ARS AUD AWG AZN BAM BBD BDT BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLE SOS SRD SSP STN SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UYW UZS VED VES VND VUV WST XAD XAF XAG XAU XBA XBB XBC XBD XCD XCG XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWG
    image_url
    Image Url

    Absolute https URL of an image, at most 2048 characters, in standard form — lowercase host, no default port, a path of at least /, any character a URL cannot hold percent-encoded — and stored as sent. null clears it.

    Any of:
    string
    <= 2048 characters
    label
    Label

    Display name. null clears it.

    Any of:
    string
    >= 1 characters <= 2048 characters /^[^\x00]*$/
    unit
    Unit

    Unit of measure, e.g. cm. null clears it.

    Any of:
    string
    >= 1 characters <= 2048 characters /^[^\x00]*$/
    key
    additional properties
    Any of:
    string
    <= 2048 characters /^[^\x00]*$/
    version
    required
    Version

    The attribute’s version this change is based on, or null for an attribute read as carrying no metadata. Either one no longer current answers 412 with the current version.

    Any of:
    integer
    >= 1

    Successful Response

    Media typeapplication/json
    AttributeMetadataList

    Attribute metadata for several attributes, as a write left them.

    object
    items
    required
    Items

    Every attribute the request named that carries metadata afterwards, in the order the request named them. An attribute left with no metadata is omitted.

    Array<object>
    AttributeMetadata

    An attribute’s own metadata and every one of its values’ metadata.

    object
    attribute_name
    required
    Attribute Name

    The catalog attribute.

    string
    metadata
    required
    Metadata

    The attribute’s own metadata; empty when only its values carry metadata.

    object
    key
    additional properties
    Any of:
    string
    <= 2048 characters /^[^\x00]*$/
    value_count
    required
    Value Count

    How many of the attribute’s raw values carry metadata.

    integer
    values
    required
    Values

    Every one of the attribute’s raw values that carries metadata, keyed by the value exactly as the catalog holds it, in the shape a write sends it; empty when none does.

    object
    key
    additional properties
    RawValueMetadata

    One raw value’s metadata, as stored.

    object
    metadata
    required
    Metadata

    The value’s metadata.

    object
    key
    additional properties
    Any of:
    string
    <= 2048 characters /^[^\x00]*$/
    version
    required
    Version

    Changes on every change to the attribute’s metadata, at either level. Send it back in an item’s version to change the attribute.

    integer format: int64
    >= 1

    Example

    {
    "items": [
    {
    "attribute_name": "material",
    "metadata": {
    "label": "Material"
    },
    "value_count": 1,
    "values": {
    "Stainless steel": {
    "metadata": {
    "color": "#C0C0C0",
    "label": "Steel"
    }
    }
    },
    "version": 41
    }
    ]
    }

    Missing or invalid credentials

    Media typeapplication/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
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    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 typeapplication/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
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    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 typeapplication/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
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example generated

    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }

    Version not current

    Media typeapplication/json
    BatchPreconditionFailedResponse

    The canonical error body of a batch write’s 412, with exception_details typed.

    object
    exception_details
    required
    BatchPreconditionFailedDetails

    Why the write was refused, and the current version of every stale item.

    object
    error_code
    required
    Error Code

    At least one item named a version its resource no longer has.

    string
    Allowed value: entity_version_stale
    stale_items
    required
    Stale Items

    Every item whose version is not current. Read those resources again, reapply the changes and resend the whole request.

    Array<object>
    StaleItem

    One item of a batch write naming a version that is no longer its resource’s current one.

    object
    current_version
    required
    Current Version

    The resource’s current version, or null where it no longer exists.

    Any of:
    integer
    >= 1
    index
    required
    Index

    The item’s position in items.

    integer
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example

    {
    "exception_details": {
    "error_code": "entity_version_stale"
    }
    }

    Request validation failed

    Media typeapplication/json
    AttributeMetadataValidationError

    The canonical error body of an attribute metadata write that failed validation, its codes typed.

    object
    exception_details
    AttributeMetadataValidationDetails

    The problems found, or why a request with none was refused.

    object
    error_code
    Error Code

    entity_change_empty when the request names no field to change and has no field-level problems. Absent when validation_errors says what failed.

    string
    Allowed value: entity_change_empty
    validation_errors
    Validation Errors

    Every problem found, each naming where in the body it sits. Absent when error_code says why the request was refused.

    Array<object>
    AttributeMetadataValidationProblem

    One reason an attribute metadata write was rejected, with its attribute metadata codes published.

    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: one of the attribute metadata codes listed here, or a generic one such as missing or string_too_long.

    Any of:
    AttributeMetadataProblem

    Stable machine codes for a rejected attribute metadata write.

    string
    Allowed values: catalog_types_unavailable catalog_type_unknown catalog_field_unknown catalog_field_forbidden attribute_metadata_value_invalid attribute_metadata_request_too_large request_item_repeated attribute_metadata_limit_reached attribute_metadata_values_unsupported
    key
    additional properties
    any
    reason
    required
    Reason

    Human-readable, actionable error message.

    string
    request_id
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example

    {
    "exception_details": {
    "error_code": "entity_change_empty",
    "validation_errors": [
    {
    "type": "catalog_types_unavailable"
    }
    ]
    }
    }

    Service temporarily unavailable

    Media typeapplication/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
    Request Id

    Request correlation ID (matches the X-Request-Id response header).

    Any of:
    string

    Example generated

    {
    "exception_details": {
    "error_code": "example",
    "validation_errors": [
    {
    "loc": [
    "example"
    ],
    "msg": "example",
    "type": "example"
    }
    ]
    },
    "reason": "example",
    "request_id": "example"
    }