MageSmith
POSTCatalog · Magento 2.4.9 Admin · Magento_Catalog::attributes_attributes

POST /V1/products/attributes

POST /V1/products/attributes is a Magento 2 REST endpoint in the Catalog module. Save attribute data. Requires an admin Bearer token with ACL Magento_Catalog::attributes_attributes.

Last verified: against Magento 2.4.9.

Returns

Magento\Catalog\Api\Data\ProductAttributeInterface

Service contract

Magento\Catalog\Api\ProductAttributeRepositoryInterface::save

Authorization

Admin Bearer token with ACL:

  • Magento_Catalog::attributes_attributes

Body parameters

attribute Magento\Catalog\Api\Data\ProductAttributeInterface Required

Example request

Auto-generated from the service contract — paste-ready against your store's /rest/default base. Replace the host, store code, ACL token, and any required values before running.

Headers

Accept
application/json
Content-Type
application/json
Authorization
Bearer <ACCESS_TOKEN> admin token with ACL: Magento_Catalog::attributes_attributes

Path

/V1/products/attributes

Body

{
  "attribute": {
    "apply_to": [
      {}
    ],
    "attribute_code": "",
    "attribute_id": 0,
    "backend_model": "",
    "backend_type": "",
    "custom_attributes": [
      {
        "attribute_code": "",
        "value": ""
      }
    ],
    "default_frontend_label": "",
    "default_value": "",
    "entity_type_id": "",
    "extension_attributes": {},
    "frontend_class": "",
    "frontend_input": "",
    "frontend_labels": [
      {
        "label": "",
        "store_id": 0
      }
    ],
    "is_comparable": "",
    "is_filterable": false,
    "is_filterable_in_grid": false,
    "is_filterable_in_search": false,
    "is_html_allowed_on_front": false,
    "is_required": false,
    "is_searchable": "",
    "is_unique": "",
    "is_used_for_promo_rules": "",
    "is_used_in_grid": false,
    "is_user_defined": false,
    "is_visible": false,
    "is_visible_in_advanced_search": "",
    "is_visible_in_grid": false,
    "is_visible_on_front": "",
    "is_wysiwyg_enabled": false,
    "note": "",
    "options": [
      {
        "is_default": false,
        "label": "",
        "sort_order": 0,
        "store_labels": [
          {
            "label": "",
            "store_id": 0
          }
        ],
        "value": ""
      }
    ],
    "position": 0,
    "scope": "",
    "source_model": "",
    "used_for_sort_by": false,
    "used_in_product_listing": "",
    "validation_rules": [
      {
        "key": "",
        "value": ""
      }
    ]
  }
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.