Templates
Templates are page definitions — bound to an app + route (e.g., default + /home).
Create → Update → Publish
# 1. Create (DRAFT)
POST /api/v1/admin/sdui/templates
{ "name": "Home Page", "route": "/home" }
# 2. Add sections
PUT /api/v1/admin/sdui/templates/{id}
{
"sections": [
{
"id": "hero-1",
"type": "HeroSection",
"disabled": false,
"settings": { "title": "Welcome to ELIVAAS" },
"blocks": [
{ "id": "btn-1", "type": "Button", "disabled": false, "settings": { "label": "Explore" } }
]
}
]
}
# 3. Publish
POST /api/v1/admin/sdui/templates/{id}/publish
{ "publishedBy": "admin@elivaas.com" }
Versioning & Rollback
Every publish creates an immutable snapshot:
# View history
GET /api/v1/admin/sdui/templates/{id}/versions
# → [{ versionNumber: 2, publishedAt: "..." }, { versionNumber: 1, publishedAt: "..." }]
# Rollback to v1
POST /api/v1/admin/sdui/templates/{id}/rollback/1
# → Template restored to v1 sections, status set to DRAFT
Scheduled Publishing
POST /api/v1/admin/sdui/templates/{id}/publish
{
"publishedBy": "admin@elivaas.com",
"publishAt": "2026-05-01T00:00:00Z",
"expireAt": "2026-06-01T00:00:00Z"
}
publishAtin future → statusSCHEDULED, auto-activates at that timeexpireAt→ template auto-hides after this time
Platform Targeting
Templates can target specific platforms. Resolution prefers exact match over ALL:
Request: platform=WEB
1. Template with platform=WEB → preferred
2. Template with platform=ALL → fallback
3. No match → 404