Templates API
Manage page templates — create, update sections, publish, rollback.
Base path: /api/v1/admin/sdui/templates
Create Template
POST /api/v1/admin/sdui/templates
{
"app": "default",
"name": "Home Page",
"route": "/home",
"description": "Main landing page",
"platform": "ALL"
}
Response 200 OK:
{
"id": "t1a2b3c4",
"app": "default",
"name": "Home Page",
"route": "/home",
"platform": "ALL",
"status": "DRAFT",
"sections": [],
"version": 0
}
Update with Sections
PUT /api/v1/admin/sdui/templates/{id}
{
"sections": [
{
"id": "hero-1",
"type": "HeroSection",
"disabled": false,
"settings": {
"title": "Welcome to ELIVAAS",
"bgColor": "#1a1a2e"
},
"blocks": [
{
"id": "btn-1",
"type": "Button",
"disabled": false,
"settings": { "label": "Explore Villas", "variant": "primary" }
}
]
},
{
"id": "visa-banner",
"type": "BannerSection",
"disabled": false,
"settings": { "text": "Exclusive 15% off with Visa Cards" },
"blocks": [],
"visibilityRules": [
{ "field": "partner_id", "operator": "EQUALS", "value": "VISA" }
]
}
]
}
Publish
POST /api/v1/admin/sdui/templates/{id}/publish
Immediate publish:
{ "publishedBy": "[email protected]" }
Scheduled with expiry:
{
"publishedBy": "[email protected]",
"publishAt": "2026-05-01T00:00:00Z",
"expireAt": "2026-06-01T00:00:00Z"
}
Response 200 OK:
{
"id": "t1a2b3c4",
"status": "PUBLISHED",
"version": 1
}
Version History
GET /api/v1/admin/sdui/templates/{id}/versions
Response 200 OK:
[
{ "id": "v2", "versionNumber": 2, "publishedBy": "[email protected]", "publishedAt": "2026-04-02T10:00:00Z" },
{ "id": "v1", "versionNumber": 1, "publishedBy": "[email protected]", "publishedAt": "2026-04-01T10:00:00Z" }
]
Rollback
Restores sections from a previous version. Sets status to DRAFT.
POST /api/v1/admin/sdui/templates/{id}/rollback/{versionNumber}
Validate
Checks all section types have active definitions.
GET /api/v1/admin/sdui/templates/{id}/validate
Response 200 OK:
[]
Or with errors:
["Unknown section type: NonExistentSection"]