# Update Custom Entity Layout

Each Custom Entity type has its own layout identified by customEntityDenominator. The supplied
layout fully overwrites the currently stored layout for that Custom Entity; it is not merged.
            
A layout must already exist for the requested Custom Entity — this operation replaces it and does
not create one. If none exists the request returns 404 Not Found.
            
## ⚠️ All attributes are required
            
The payload must contain every attribute currently in the stored layout — no more, no less.
Omitting an attribute removes it from the form. Adding an attribute that is not already in the
layout is also rejected. Use GET /CustomEntities('{customEntityDenominator}')/layout first to
obtain the current set of attributes.
            
This is different from PATCH /v2/AttributeSets({id}), where layouts may contain any subset of
the tenant's attributes.
            
## Layout Structure
            
The payload has the same shape as the GET /CustomEntities('{customEntityDenominator}')/layout response:
            
json
{
  "sections": [
    {
      "title": "General",
      "rows": [
        {
          "fields": [
            { "attributeId": "ce_title", "size": "half" },
            { "attributeId": "ce_ref",   "size": "half" }
          ]
        },
        {
          "dividerType": "normal",
          "dividerTitle": "Details",
          "fields": [
            { "attributeId": "ce_description", "size": "row" }
          ]
        }
      ]
    }
  ]
}

            
size — one of: quarter, half, threeQuarters, row.
            
dividerType — optional; one of: normal, wide, lineBreak. dividerTitle is optional
and only meaningful when dividerType is set. Both are omitted from rows that have no divider.
            
## Validation Rules
            
If any rule is violated the request returns 400 Bad Request describing each failure:
            
- The layout must contain every attribute currently in the stored layout — no more, no less.
- No attributeId may appear more than once.
- 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.

Endpoint: PUT /CustomEntities('{customEntityDenominator}')/layout
Version: 2.0.0

## Header parameters:

  - `X-API-KEY` (string)
    Tenant's API key

## Path parameters:

  - `customEntityDenominator` (string, required)
    Denominator of the Custom Entity type whose layout is replaced.

## Request fields (application/json):

  - `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"}]}]}]

  - `sections.title` (string,null)

  - `sections.rows` (array,null)

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

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

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

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

  - `sections.rows.dividerTitle` (string,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 500 fields (application/json):

  - `error` (string,null)

  - `details` (any,null)


## Response 204 fields

## Response 401 fields
