Skip to content

Update Custom Entity Layout

Request

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:

{
  "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.
Path
customEntityDenominatorstringrequired

Denominator of the Custom Entity type whose layout is replaced.

Headers
X-API-KEYstring

Tenant's API key

Bodyapplication/json

The new form layout to store

sectionsArray of objects or null(FormSectionDto)
Example:
[ { "title": "General", "rows": [ … ] }, { "title": "Content", "rows": [ … ] } ]
PUT
/CustomEntities('{customEntityDenominator}')/layout
curl -i -X PUT \
  'https://api2.saleslayer.com/catalog/CustomEntities('\''{customEntityDenominator}'\'')/layout' \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: string' \
  -d '{
    "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"
              }
            ]
          }
        ]
      }
    ]
  }'

Responses

No Content

Response
No content