Design Token Provider
API Contract
REST
/api/v1/design-tokens
6 endpoints
GET
/api/v1/design-tokens/api/v1/design-tokens
List all design tokens
Public
Response Example
{
"data": [
{
"id": "dt-001",
"token_key": "color.primary",
"category": "color",
"value": "#1A73E8",
"description": "Primary brand color",
"created_at": "2026-03-26T07:00:00Z"
},
{
"id": "dt-002",
"token_key": "spacing.md",
"category": "spacing",
"value": "16",
"unit": "dp",
"description": "Medium spacing unit",
"created_at": "2026-03-26T07:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 64
}
}
GET
/api/v1/design-tokens/api/v1/design-tokens/:id
Get a single design token by ID
Public
Response Example
{
"id": "dt-001",
"token_key": "color.primary",
"category": "color",
"value": "#1A73E8",
"description": "Primary brand color",
"created_at": "2026-03-26T07:00:00Z",
"updated_at": "2026-03-26T09:00:00Z"
}
POST
/api/v1/design-tokens/api/v1/design-tokens
Create a new design token
Public
Request Example
{
"token_key": "sizing.icon-sm",
"category": "sizing",
"value": "20",
"unit": "dp",
"description": "Small icon size"
}
Response Example
{
"id": "dt-065",
"token_key": "sizing.icon-sm",
"category": "sizing",
"value": "20",
"unit": "dp",
"description": "Small icon size",
"created_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/design-tokens/api/v1/design-tokens/:id
Update a design token value
Public
Request Example
{
"value": "24",
"description": "Small icon size — updated to 24dp for touch accessibility"
}
Response Example
{
"id": "dt-065",
"token_key": "sizing.icon-sm",
"category": "sizing",
"value": "24",
"unit": "dp",
"description": "Small icon size — updated to 24dp for touch accessibility",
"created_at": "2026-03-26T10:00:00Z",
"updated_at": "2026-03-26T10:30:00Z"
}
DELETE
/api/v1/design-tokens/api/v1/design-tokens/:id
Delete a design token
Public
Response Example
{
"deleted": true,
"id": "dt-065"
}
GET
/api/v1/design-tokens/api/v1/design-tokens/resolve/:token_key
Resolve a token key to its current value (color, text style, spacing, or sizing)
Public
Response Example
{
"token_key": "color.primary",
"category": "color",
"value": "#1A73E8",
"resolved_at": "2026-03-26T10:00:00Z"
}