{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-experience-cloud/json-schema/salesforce-experience-cloud-record-layout-representation-schema.json",
  "title": "RecordLayoutRepresentation",
  "description": "Layout metadata for an object",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-experience-cloud-layouts-api-openapi.yml#/components/schemas/RecordLayoutRepresentation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Layout ID"
    },
    "layoutType": {
      "type": "string",
      "enum": [
        "Compact",
        "Full"
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "Create",
        "Edit",
        "View"
      ]
    },
    "sections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/LayoutSection"
      }
    }
  },
  "$defs": {
    "LayoutItem": {
      "type": "object",
      "description": "A field item within a layout section",
      "properties": {
        "editableForNew": {
          "type": "boolean"
        },
        "editableForUpdate": {
          "type": "boolean"
        },
        "label": {
          "type": "string"
        },
        "layoutComponents": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "apiName": {
                "type": "string"
              },
              "componentType": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            }
          }
        },
        "lookupIdApiName": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "sortable": {
          "type": "boolean"
        }
      }
    },
    "LayoutSection": {
      "type": "object",
      "description": "A section within a layout",
      "properties": {
        "collapsible": {
          "type": "boolean"
        },
        "columns": {
          "type": "integer"
        },
        "heading": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "layoutRows": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "layoutItems": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/LayoutItem"
                }
              }
            }
          }
        },
        "rows": {
          "type": "integer"
        },
        "useHeading": {
          "type": "boolean"
        }
      }
    }
  }
}