Menu
Get Attribute By Code
Get an attribute
/api/rest/v1/attributes/{code}Use it in a workflow
- Add a step and choose the Akeneo connector.
- Pick the Get Attribute By Code action (under Attribute).
- Fill in the fields below, then reference the result from later steps as
{{getAttributeByCode.response.data}}.
Request
Path parameters
codestringrequiredThis path parameter is used to specify the unique identifier of the entity you want to retrieve or manipulate. It is essential for identifying the specific entity in the API requests. Ensure that the code is correctly formatted and corresponds to an existing entity in the system.
Query parameters
with_table_select_optionsbooleanReturn the options of 'select' column types (of a table attribute) in the response. When set to `true`, the response will include all available options for select-type columns in table attributes. This is useful for retrieving all available options for select-type columns in table attributes, which is essential for form rendering and data validation. If set to `false`, the response will not include select options, which can improve performance.
Default false
Response
Returns 200 with an object. Read it in later steps with {{getAttributeByCode.response.data.<field>}}.
codestringAttribute code
typestringAttribute type. See [type](https://api.akeneo.com/concepts/catalog-structure.html#attribute) section for more details.
One ofpim_catalog_identifierpim_catalog_metricpim_catalog_numberpim_reference_data_multiselectpim_reference_data_simpleselectpim_catalog_simpleselectpim_catalog_multiselectpim_catalog_datepim_catalog_textareapim_catalog_textpim_catalog_filepim_catalog_imagepim_catalog_price_collectionpim_catalog_booleanakeneo_reference_entityakeneo_reference_entity_collectionpim_catalog_asset_collectionpim_catalog_product_linkpim_catalog_table
labelsobjectAttribute labels for each locale
Default {}
groupstringAttribute group
group_labelsobjectGroup labels for each locale
Default {}
sort_orderintegerOrder of the attribute in its group
Default 0
localizablebooleanWhether the attribute is localizable, i.e. can have one value by locale
Default false
scopablebooleanWhether the attribute is scopable, i.e. can have one value by channel
Default false
available_localesarray<string>To make the attribute locale specfic, specify here for which locales it is specific
uniquebooleanWhether two values for the attribute cannot be the same
useable_as_grid_filterbooleanWhether the attribute can be used as a filter for the product grid in the PIM user interface
max_charactersinteger | nullNumber 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 | nullValidation rule type used to validate any attribute value when the attribute type is `pim_catalog_text` or `pim_catalog_identifier`
validation_regexpstring | nullRegexp expression used to validate any attribute value when the attribute type is `pim_catalog_text` or `pim_catalog_identifier`
wysiwyg_enabledboolean | nullWhether the WYSIWYG interface is shown when the attribute type is `pim_catalog_textarea`
number_minstring | nullMinimum integer value allowed when the attribute type is `pim_catalog_metric`, `pim_catalog_price` or `pim_catalog_number`
number_maxstring | nullMaximum integer value allowed when the attribute type is `pim_catalog_metric`, `pim_catalog_price` or `pim_catalog_number`
decimals_allowedboolean | nullWhether decimals are allowed when the attribute type is `pim_catalog_metric`, `pim_catalog_price` or `pim_catalog_number`
negative_allowedboolean | nullWhether negative values are allowed when the attribute type is `pim_catalog_metric` or `pim_catalog_number`
metric_familystring | nullMetric family when the attribute type is `pim_catalog_metric`
default_metric_unitstring | nullDefault metric unit when the attribute type is `pim_catalog_metric`
date_minstring | nullMinimum date allowed when the attribute type is `pim_catalog_date`. Accepts a date in `YYYY-MM-DD` format or an ISO 8601 date-time (`YYYY-MM-DDTHH:MM:SS+00:00` or `YYYY-MM-DDTHH:MM:SSZ`).
date_maxstring | nullMaximum date allowed when the attribute type is `pim_catalog_date`. Accepts a date in `YYYY-MM-DD` format or an ISO 8601 date-time (`YYYY-MM-DDTHH:MM:SS+00:00` or `YYYY-MM-DDTHH:MM:SSZ`).
display_timeboolean | nullWhether the time component is displayed and stored for values of this attribute. When `true`, filters on this attribute using `pim_catalog_date` values accept ISO 8601 date-times with time-of-day precision. When `false`, the time component of filter values is ignored (the filter matches the full day).
allowed_extensionsarray<string>Extensions allowed when the attribute type is `pim_catalog_file` or `pim_catalog_image`
max_file_sizestring | nullMax file size in MB when the attribute type is `pim_catalog_file` or `pim_catalog_image`
reference_data_namestring | nullReference 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_valueoneOftable_configurationarray<object>Configuration of the Table attribute (columns)
codestringrequiredColumn code
data_typestringrequiredColumn data type
One ofselecttextnumberbooleanincremental_numberreference_entityproduct_linkmeasurementdate
validationsobject4 fieldsUser defined validation constraints on the cell content
Default {}
labelsobjectColumn labels for each locale
Default {}
is_required_for_completenessbooleanDefines if the column should be entirely filled for the attribute to be considered complete
Default false
is_main_identifierbooleanIs this attribute main identifier when attribute type is `pim_catalog_identifier`
is_mandatorybooleanThis attribute must be enriched from the moment a product is created. It will be mandatory across all families.
decimal_places_strategystring | nullDefines the decimal places strategy. Available options are `round`, `forbid` and `trim`.
decimal_placesnumber | nullDefines the number of decimal places when decimal places strategy is `round` or `forbid`
enable_option_creation_during_importboolean | nullWhether new attribute options can be created automatically during product or product model import (CSV, XLSX), when the attribute type is `pim_catalog_simpleselect` or `pim_catalog_multiselect`
max_items_countnumber | nullMaximum number of items allowed in an asset collection when the attribute type is `pim_catalog_asset_collection`
{
"code": "release_date",
"type": "pim_catalog_date",
"labels": {
"en_US": "Release date",
"fr_FR": "Date de sortie"
},
"group": "marketing",
"group_labels": {
"en_US": "Marketing",
"fr_FR": "Marketing"
},
"sort_order": 1,
"localizable": false,
"scopable": false,
"available_locales": [
"en_US",
"fr_FR"
],
"unique": false,
"useable_as_grid_filter": true,
"max_characters": 255
}
Need more? See the Akeneo guide for connection setup and behaviour shared by every action.