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.
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.
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.
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
attributeIdmay appear more than once. - Each field
sizemust 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
titlevalues must be unique (case-insensitive). - When a row sets
dividerTypeit must be one of:normal,wide,lineBreak.
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"
}
]
}
]
}
]
}'