v1

latestSwagger 2.02026-07-13137761.0 MB
Reference entity attribute

Update/create an attribute of a given reference entity

This endpoint allows you to update a given attribute for a given renference entity. Note that if the attribute does not already exist for the given reference entity, it creates it.

patch/api/rest/v1/reference-entities/{reference_entity_code}/attributes/{code}

Path parameters

reference_entity_codestring required

Code of the reference entity

codestring required

Code of the resource

Request body

codestring required

Attribute code

type'text' | 'image' | 'number' | 'single_option' | 'multiple_options' | 'reference_entity_single_link' | 'reference_entity_multiple_links' required

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

value_per_localeboolean

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

value_per_channelboolean

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

is_required_for_completenessboolean

Whether the attribute should be part of the record's completeness calculation

max_charactersinteger

Maximum number of characters allowed for the value of the attribute when the attribute type is text

is_textareaboolean

Whether the UI should display a text area instead of a simple field when the attribute type is text

is_rich_text_editorboolean

Whether the UI should display a rich text editor instead of a simple text area when the attribute type is text

validation_rule'email' | 'url' | 'regexp' | 'none'

Validation rule type used to validate the attribute value when the attribute type is text

validation_regexpstring

Regexp expression used to validate the attribute value when the attribute type is text

allowed_extensionsstring[]

Extensions allowed when the attribute type is image

max_file_sizestring

Max file size in MB when the attribute type is image

reference_entity_codestring

Code of the linked reference entity when the attribute type is reference_entity_single_link or reference_entity_multiple_links

asset_family_identifierstring

Code of the linked asset family when the attribute type is asset_collection

decimals_allowedboolean

Whether decimals are allowed when the attribute type is number

min_valuestring

Minimum value allowed when the attribute type is number

max_valuestring

Maximum value allowed when the attribute type is number

Example request

{
  "code": "description",
  "labels": {
    "en_US": "Description",
    "fr_FR": "Description"
  },
  "type": "text",
  "value_per_locale": true,
  "value_per_channel": false,
  "is_required_for_completeness": true,
  "max_characters": null,
  "is_textarea": true,
  "is_rich_text_editor": true,
  "validation_rule": "none",
  "validation_regexp": null
}

Response

Created