Theme Builder
API Contract
REST
/api/v1/themes
6 endpoints
GET
/api/v1/themes/api/v1/themes
List all built theme snapshots
Public
Response Example
{
"data": [
{
"id": "th-001",
"name": "light-v1",
"mode": "light",
"compliant": true,
"component_theme_count": 8,
"created_at": "2026-03-26T08:30:00Z"
},
{
"id": "th-002",
"name": "dark-v1",
"mode": "dark",
"compliant": true,
"component_theme_count": 8,
"created_at": "2026-03-26T08:31:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/themes/api/v1/themes/:id
Get a full theme snapshot including component overrides
Public
Response Example
{
"id": "th-001",
"name": "light-v1",
"mode": "light",
"compliant": true,
"primary_color": "#1A73E8",
"background_color": "#FFFFFF",
"surface_color": "#F8F9FA",
"on_primary_color": "#FFFFFF",
"component_themes": {
"elevated_button": {
"background_color": "#1A73E8",
"foreground_color": "#FFFFFF"
},
"text_field": {
"fill_color": "#F8F9FA",
"border_color": "#DADCE0"
}
},
"created_at": "2026-03-26T08:30:00Z"
}
POST
/api/v1/themes/api/v1/themes
Build and save a new theme from token values
Public
Request Example
{
"name": "high-contrast-v1",
"mode": "light",
"primary_color": "#000000",
"background_color": "#FFFFFF",
"surface_color": "#F0F0F0",
"on_primary_color": "#FFFFFF"
}
Response Example
{
"id": "th-003",
"name": "high-contrast-v1",
"mode": "light",
"compliant": true,
"component_theme_count": 8,
"created_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/themes/api/v1/themes/:id
Rebuild a theme with updated token values
Public
Request Example
{
"primary_color": "#0057B7",
"on_primary_color": "#FFFFFF"
}
Response Example
{
"id": "th-003",
"name": "high-contrast-v1",
"mode": "light",
"compliant": true,
"component_theme_count": 8,
"created_at": "2026-03-26T10:00:00Z",
"updated_at": "2026-03-26T10:25:00Z"
}
DELETE
/api/v1/themes/api/v1/themes/:id
Delete a theme snapshot
Public
Response Example
{
"deleted": true,
"id": "th-003"
}
POST
/api/v1/themes/api/v1/themes/:id/validate
Validate a theme snapshot for WCAG compliance
Public
Response Example
{
"theme_id": "th-001",
"compliant": true,
"checks_run": 24,
"failures": []
}