Create Token
Tokens
Create Token
Create a new design token
POST
Create Token
Documentation Index
Fetch the complete documentation index at: https://docs.tokencraft.dev/llms.txt
Use this file to discover all available pages before exploring further.
Create Token
Creates a new design token in a specific mode.Write access policy - This endpoint requires the
write:tokens scope.- TEAM-owned workspace:
owner,admin,editorcan write;vieweris blocked (403). - Non-TEAM workspace: only the workspace owner can write.
- If the workspace owner plan has no API write access (for example FREE), write is blocked.
Endpoint
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Tokenset ID |
modeId | string | Yes | Mode ID |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Token name (dot notation, e.g., colors.primary.500) |
type | string | Yes | Token type (see valid types below) |
value | string | Conditionally | Token value (required unless alias_to is provided) |
description | string | No | Optional description |
alias_to | string | No | Reference to another token (for aliases) |
Valid Token Types
color- Color valuesdimension- Sizes and spacingfontFamily- Font familiesfontWeight- Font weightsfontSize- Font sizeslineHeight- Line heightsletterSpacing- Letter spacingduration- Animation durationscubicBezier- Easing functionsnumber- Numeric valuesstrokeStyle- Stroke stylesborder- Border definitionstransition- Transition definitionsshadow- Shadow effectsgradient- Gradient definitionstypography- Complete typography definitionsstring- String valuesboolean- Boolean values
Response
Status:201 Created
Examples
Error Responses
400 Bad Request
404 Not Found
Naming Convention
Use dot notation for hierarchical organization:Examples
✅ Good:colors.primary.500spacing.component.padding.xfont.size.heading.h1
primaryColor500spacing_basefontSizeBody
Token Aliases
Create semantic tokens that reference base tokens:Batch Creation
Create multiple tokens:Next Steps
Update Token
Update token details
List Tokens
View all tokens