Create Mode
Modes
Create Mode
Create a new mode in a tokenset
POST
Create Mode
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 Mode
Creates a new mode (theme variation) within a tokenset.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
Authentication
Requires a valid API token in the Authorization header.Request
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer token | Yes |
Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Tokenset ID |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Mode name (max 255 characters) |
is_default | boolean | No | Whether this mode is the default (default: false) |
If
is_default is true, all other modes in this tokenset will be set to non-default.Request Body
Response
Success Response
Status:201 Created
Examples
Error Responses
400 Bad Request
404 Not Found
Common Mode Names
Theme Variations
- Light
- Dark
- High Contrast
Platform Variations
- Web
- Mobile
- Desktop
Brand Variations
- Primary Brand
- Secondary Brand
Context Variations
- Marketing
- Product
- Admin
Use Cases
1. Create Light/Dark Themes
2. Create Multi-Platform Modes
Default Mode Behavior
When setting a mode as default:- The new mode’s
is_defaultis set totrue - All other modes in the tokenset are set to
is_default: false - Only one mode can be default per tokenset
Next Steps
Update Mode
Update mode details
Create Tokens
Add tokens to your mode