Skip to main content

Section Definitions API

Manage the component library — reusable section types with configurable settings and block schemas.

Base path: /api/v1/admin/sdui/section-definitions


Create Section Definition

POST /api/v1/admin/sdui/section-definitions
Content-Type: application/json
{
"type": "HeroSection",
"name": "Hero Section",
"description": "Full-width hero banner with CTA buttons",
"category": "layout",
"platforms": "ALL",
"maxBlocks": 3,
"settings": [
{
"id": "title",
"type": "TEXT",
"label": "Title",
"defaultValue": "Welcome"
},
{
"id": "bgColor",
"type": "COLOR",
"label": "Background Color",
"defaultValue": "#FFFFFF"
},
{
"id": "bgImage",
"type": "IMAGE",
"label": "Background Image"
}
],
"blocks": [
{
"type": "Button",
"name": "CTA Button",
"limit": 2,
"settings": [
{
"id": "label",
"type": "TEXT",
"label": "Label",
"defaultValue": "Click Me"
},
{
"id": "variant",
"type": "SELECT",
"label": "Style",
"defaultValue": "primary",
"options": [
{ "value": "primary", "label": "Primary" },
{ "value": "secondary", "label": "Secondary" }
]
}
]
}
]
}

Response 200 OK:

{
"id": "d1a2b3c4",
"type": "HeroSection",
"name": "Hero Section",
"platforms": "ALL",
"maxBlocks": 3,
"status": "ACTIVE",
"settings": [ ... ],
"blocks": [ ... ],
"createdAt": "2026-04-03T10:00:00Z"
}

List Active Definitions

Use this to populate section type dropdowns in the template editor.

GET /api/v1/admin/sdui/section-definitions/active

Response 200 OK:

[
{ "id": "d1", "type": "HeroSection", "name": "Hero Section", "status": "ACTIVE" },
{ "id": "d2", "type": "BannerCarousel", "name": "Banner Carousel", "status": "ACTIVE" },
{ "id": "d3", "type": "DestinationGrid", "name": "Destination Grid", "status": "ACTIVE" }
]

List All (Paginated)

GET /api/v1/admin/sdui/section-definitions?page=1&size=20

Response 200 OK:

{
"data": [ ... ],
"total": 15,
"page": 1,
"size": 20
}

Get by ID

GET /api/v1/admin/sdui/section-definitions/{id}

Update

Only non-null fields are updated (PATCH semantics).

PUT /api/v1/admin/sdui/section-definitions/{id}
{
"name": "Hero Section v2",
"status": "DEPRECATED"
}

Delete (Soft)

Templates referencing this type will skip the section at render time.

DELETE /api/v1/admin/sdui/section-definitions/{id}