v1

latestSwagger 2.02026-07-13137761.0 MB
Attribute

Update/create several attributes

This endpoint allows you to update and/or create several attributes at once.

patch/api/rest/v1/attributes

Request body

codestring required

Attribute code

type'pim_catalog_identifier' | 'pim_catalog_metric' | 'pim_catalog_number' | 'pim_catalog_reference_data_multi_select' | 'pim_catalog_reference_data_simple_select' | 'pim_catalog_simpleselect' | 'pim_catalog_multiselect' | 'pim_catalog_date' | 'pim_catalog_textarea' | 'pim_catalog_text' | 'pim_catalog_file' | 'pim_catalog_image' | 'pim_catalog_price_collection' | 'pim_catalog_boolean' | 'akeneo_reference_entity' | 'akeneo_reference_entity_collection' | 'pim_catalog_asset_collection' | 'pim_catalog_product_link' required

Attribute type. See <a href='/concepts/catalog-structure.html#attribute'>type</a> section for more details.

groupstring required

Attribute group

sort_orderinteger

Order of the attribute in its group

localizableboolean

Whether the attribute is localizable, i.e. can have one value by locale

scopableboolean

Whether the attribute is scopable, i.e. can have one value by channel

available_localesstring[]

To make the attribute locale specfic, specify here for which locales it is specific

uniqueboolean

Whether two values for the attribute cannot be the same

useable_as_grid_filterboolean

Whether the attribute can be used as a filter for the product grid in the PIM user interface

max_charactersinteger

Number maximum of characters allowed for the value of the attribute when the attribute type is pim_catalog_text, pim_catalog_textarea or pim_catalog_identifier

validation_rulestring

Validation rule type used to validate any attribute value when the attribute type is pim_catalog_text or pim_catalog_identifier

validation_regexpstring

Regexp expression used to validate any attribute value when the attribute type is pim_catalog_text or pim_catalog_identifier

wysiwyg_enabledboolean

Whether the WYSIWYG interface is shown when the attribute type is pim_catalog_textarea

number_minstring

Minimum integer value allowed when the attribute type is pim_catalog_metric, pim_catalog_price or pim_catalog_number

number_maxstring

Maximum integer value allowed when the attribute type is pim_catalog_metric, pim_catalog_price or pim_catalog_number

decimals_allowedboolean

Whether decimals are allowed when the attribute type is pim_catalog_metric, pim_catalog_price or pim_catalog_number

negative_allowedboolean

Whether negative values are allowed when the attribute type is pim_catalog_metric or pim_catalog_number

metric_familystring

Metric family when the attribute type is pim_catalog_metric

default_metric_unitstring

Default metric unit when the attribute type is pim_catalog_metric

date_minstring date-time

Minimum date allowed when the attribute type is pim_catalog_date

date_maxstring date-time

Maximum date allowed when the attribute type is pim_catalog_date

allowed_extensionsstring[]

Extensions allowed when the attribute type is pim_catalog_file or pim_catalog_image

max_file_sizestring

Max file size in MB when the attribute type is pim_catalog_file or pim_catalog_image

reference_data_namestring

Reference entity code when the attribute type is akeneo_reference_entity or akeneo_reference_entity_collection OR Asset family code when the attribute type is pim_catalog_asset_collection

default_valueboolean

Default value for a Yes/No attribute, applied when creating a new product or product model (only available since the 5.0)

is_main_identifierboolean

Is this attribute main identifier when attribute type is pim_catalog_identifier

is_mandatoryboolean

This attribute must be enriched from the moment a product is created. It will be mandatory across all families.

decimal_places_strategystring

Defines the decimal places strategy. Available options are round, forbid and trim.

decimal_placesnumber

Defines the number of decimal places when decimal places strategy is round or forbid.

Example request

{
  "code": "release_date",
  "type": "pim_catalog_date",
  "group": "marketing",
  "group_labels": {
    "en_US": "Marketing",
    "fr_FR": "Marketing"
  },
  "unique": false,
  "useable_as_grid_filter": true,
  "allowed_extensions": [],
  "metric_family": null,
  "default_metric_unit": null,
  "reference_data_name": null,
  "available_locales": [],
  "max_characters": null,
  "validation_rule": null,
  "validation_regexp": null,
  "wysiwyg_enabled": null,
  "number_min": null,
  "number_max": null,
  "decimals_allowed": null,
  "negative_allowed": null,
  "date_min": "2017-06-28T08:00:00",
  "date_max": "2017-08-08T22:00:00",
  "max_file_size": null,
  "minimum_input_length": null,
  "sort_order": 1,
  "localizable": false,
  "scopable": false,
  "default_value": null,
  "labels": {
    "en_US": "Sale date",
    "fr_FR": "Date des soldes"
  },
  "is_mandatory": false,
  "decimal_places_strategy": null,
  "decimal_places": null
}

Response

OK

lineinteger

Line number

identifierstring

Resource identifier, only filled when the resource is a product

codestring

Resource code, only filled when the resource is not a product

status_codeinteger

HTTP status code, see <a href="/documentation/responses.html#client-errors">Client errors</a> to understand the meaning of each code

messagestring

Message explaining the error