# Update Attribute Set

Partially updates an existing attribute set identified by id. Accepted values:
- default (case-insensitive) — updates the tenant's default attribute set.
- Positive integer — updates the attribute set with that numeric ID.
            
Any other value is rejected with 400 Bad Request.
            
## Authentication
            
Requires a valid API key in the X-API-KEY header.
            
## Request Body
            
All fields are optional. Omitted (null) fields are left unchanged (PATCH semantics).
When a layout is supplied it fully replaces the currently stored layout — it is not merged.
            
| Field | Description |
|---|---|
| name | New unique name for the attribute set. |
| productLayout | Replacement form layout for Products. |
| variantLayout | Form layout for Variants. Sets the Variant layout when the set does not yet have one (e.g. created without it), or replaces it when it does. |
            
## Layout Structure
            
Each layout is a JSON document with a sections array. Each section has a title and a rows
array. Each row has a fields array and an optional divider (dividerType, dividerTitle).
Each field carries an attributeId and a size.
            
json
{
  "sections": [
    {
      "title": "General",
      "rows": [
        {
          "fields": [
            { "attributeId": "prod_title", "size": "half" },
            { "attributeId": "prod_ref",   "size": "half" }
          ]
        },
        {
          "dividerType": "normal",
          "dividerTitle": "Details",
          "fields": [
            { "attributeId": "prod_description", "size": "row" }
          ]
        }
      ]
    }
  ]
}

            
size — width of the field in the form grid. One of: quarter, half, threeQuarters, row.
            
dividerType — optional visual separator above the row. One of: normal, wide, lineBreak.
dividerTitle is optional and only meaningful when dividerType is set.
Both properties are omitted from rows that have no divider.
            
## Layout Validation
            
A layout may contain any subset of the tenant's valid attributes — you do not need to
include all of them. Attributes omitted from the layout simply do not appear in the form
for this attribute set; they are not removed from the tenant.
            
This is different from PUT /Categories/layout and PUT /CustomEntities('{id}')/layout,
where the payload must contain every attribute currently in the stored layout — no more, no less.
            
If a layout is supplied it must satisfy all of the following rules; otherwise the request
returns 400 Bad Request describing each failure:
            
- Every attributeId included must exist for the entity type (Products or Variants) in the tenant's storage definition.
- No attributeId may appear more than once across the entire layout.
- Each field size must be one of: quarter, half, threeQuarters, row.
- The sum of field sizes within any single row must not exceed a full row.
- Every row must contain at least one field.
- Section title values must be unique (case-insensitive).
- When a row sets dividerType it must be one of: normal, wide, lineBreak.
            
### Required attributes
            
These attributes must always be present in their respective layout:
            
| Layout | Required attribute IDs |
|---|---|
| productLayout | typ_id, prod_ref, prod_title, cat_ref, prod_stat, prod_description, prod_image, prod_tags |
| variantLayout | frmt_stat, prod_ref, frmt_ref, frmt_tags |
            
            
## Response
            
200 OK — The updated attribute set (UpdateAttributeSet2Response).
            
## Error Responses
            
- 400 Bad Request — Invalid id, missing body, or layout validation failure.
- 401 Unauthorized — Missing or invalid tenant identifier.
- 404 Not Found — No attribute set with the given identifier exists for this tenant.
- 500 Internal Server Error — Unexpected technical error.
            
## Example
            
Request:
http
PATCH /v2/AttributeSets(1) HTTP/1.1
X-API-KEY: your-api-key-here
Content-Type: application/json
            
{ "name": "Electronics v2" }

            
Response:
http
HTTP/1.1 200 OK
Content-Type: application/json

Endpoint: PATCH /v2/AttributeSets({id})
Version: 2.0.0

## Path parameters:

  - `id` (string, required)
    Attribute set identifier: default or a positive integer.

## Request fields (application/json):

  - `name` (string,null)

  - `productLayout` (object)
    Example: {"sections":[{"title":"General","rows":[{"fields":[{"attributeId":"code","size":"half"},{"attributeId":"name","size":"half"}]},{"fields":[{"attributeId":"parent_ref","size":"row"}],"dividerType":"normal","dividerTitle":"Hierarchy"}]},{"title":"Content","rows":[{"fields":[{"attributeId":"status","size":"quarter"},{"attributeId":"description","size":"threeQuarters"}]},{"fields":[{"attributeId":"image","size":"half"},{"attributeId":"tags","size":"half"}]}]}]}

  - `productLayout.sections` (array,null)
    Example: [{"title":"General","rows":[{"fields":[{"attributeId":"code","size":"half"},{"attributeId":"name","size":"half"}]},{"fields":[{"attributeId":"parent_ref","size":"row"}],"dividerType":"normal","dividerTitle":"Hierarchy"}]},{"title":"Content","rows":[{"fields":[{"attributeId":"status","size":"quarter"},{"attributeId":"description","size":"threeQuarters"}]},{"fields":[{"attributeId":"image","size":"half"},{"attributeId":"tags","size":"half"}]}]}]

  - `productLayout.sections.title` (string,null)

  - `productLayout.sections.rows` (array,null)

  - `productLayout.sections.rows.fields` (array,null)

  - `productLayout.sections.rows.fields.attributeId` (string,null)

  - `productLayout.sections.rows.fields.size` (string)
    Enum: "quarter", "half", "threeQuarters", "row"

  - `productLayout.sections.rows.dividerType` (string,null)
    Enum: "normal", "wide", "lineBreak"

  - `productLayout.sections.rows.dividerTitle` (string,null)

  - `variantLayout` (object)
    Example: {"sections":[{"title":"General","rows":[{"fields":[{"attributeId":"code","size":"half"},{"attributeId":"name","size":"half"}]},{"fields":[{"attributeId":"parent_ref","size":"row"}],"dividerType":"normal","dividerTitle":"Hierarchy"}]},{"title":"Content","rows":[{"fields":[{"attributeId":"status","size":"quarter"},{"attributeId":"description","size":"threeQuarters"}]},{"fields":[{"attributeId":"image","size":"half"},{"attributeId":"tags","size":"half"}]}]}]}

## Response 200 fields (application/json):

  - `@readLink` (string,null)

  - `@editLink` (string,null)

  - `@etag` (string,null)

  - `@navigationLinks` (array,null)

  - `@navigationLinks.uri` (string,null)

  - `@associationLinks` (array,null)

  - `@associationLinks.uri` (string,null)

  - `@context` (string,null)

  - `value` (any,null)

## Response 400 fields (application/json):

  - `validationFailures` (object,null)
    Example: {"Layout":[{"PropertyName":"Layout","ErrorMessage":"The layout must contain exactly the attributes of the stored layout. Missing: tags. Unknown: extra_field.","AttemptedValue":null}]}

## Response 401 fields (application/json):

  - `type` (string,null)

  - `title` (string,null)

  - `status` (integer,null)

  - `detail` (string,null)

  - `instance` (string,null)

## Response 500 fields (application/json):

  - `error` (string,null)

  - `details` (any,null)


