Tokencraft REST API
The Tokencraft API is a RESTful API that provides programmatic access to your design tokens. Use it to integrate Tokencraft into your build process, CI/CD pipeline, or any application.Base URL
Authentication
All API requests require authentication using Bearer tokens in the Authorization header:API v1 Access Model
API v1 access is scoped by token + workspace access context:read:tokensis required for read endpoints.write:tokensis required for create/update/delete endpoints.export:tokensis required for export endpoints.
- If the workspace owner is on
TEAM:- read:
owner,admin,editor,viewer - write:
owner,admin,editor viewerwrite attempts return403
- read:
- If the workspace owner is on any non-TEAM plan:
- read/write remain owner-only
- If the workspace owner plan does not include API write access (for example
FREE), write endpoints return403even withwrite:tokensscope.
404 on workspace-scoped routes.
Request Format
The API accepts and returns JSON. Always include theContent-Type header for POST/PATCH requests:
Response Format
Success Response
Error Response
Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid input |
401 | Unauthorized - Invalid or missing token |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Rate Limiting
- Limit: 100 requests per minute per API token
- Headers: Rate limit information is included in response headers
Endpoints Overview
Workspaces
GET /workspaces- List all workspacesPOST /workspaces- Create a workspaceGET /workspaces/{id}- Get a workspacePATCH /workspaces/{id}- Update a workspaceDELETE /workspaces/{id}- Delete a workspaceGET /workspaces/{id}/tokensets- List tokensets in a workspace
Tokensets
GET /tokensets/{id}- Get a tokensetPATCH /tokensets/{id}- Update a tokensetDELETE /tokensets/{id}- Delete a tokensetGET /tokensets/{id}/modes- List modesPOST /tokensets/{id}/modes- Create a modeGET /tokensets/{id}/modes/{modeId}- Get a modePATCH /tokensets/{id}/modes/{modeId}- Update a modeDELETE /tokensets/{id}/modes/{modeId}- Delete a modeGET /tokensets/{id}/tokens- Get all tokens (across all modes)
Tokens
GET /tokensets/{id}/modes/{modeId}/tokens- List tokens in a modePOST /tokensets/{id}/modes/{modeId}/tokens- Create a tokenGET /tokensets/{id}/modes/{modeId}/tokens/{tokenId}- Get a token by IDPATCH /tokensets/{id}/modes/{modeId}/tokens/{tokenId}- Update a tokenDELETE /tokensets/{id}/modes/{modeId}/tokens/{tokenId}- Delete a token
Export
GET /tokensets/{id}/export- Export all modesGET /tokensets/{id}/modes/{modeId}/export- Export a specific mode
Dashboard Session Endpoints (/api, cookie auth)
GET /api/subscription/downgrade-status- Get downgrade overage/enforcement statusPOST /api/workspaces- Create workspace from dashboard sessionGET /api/workspaces/{workspaceId}/members- List workspace membersPOST /api/workspaces/{workspaceId}/members- Add/update member immediately (no pending invitation email)POST /api/workspaces/invitations/accept- Deprecated, returns410 GoneGET /api/workspaces/invitations/verify- Deprecated, returns410 GoneDELETE /api/workspaces/invitations/{id}- Deprecated, returns410 Gone
Organizations & Environments (Business Session API)
GET /api/organizations/{orgId}/environments- List organization environmentsPOST /api/organizations/{orgId}/environments- Create environmentDELETE /api/organizations/{orgId}/environments/{environmentId}- Delete non-production environmentGET /api/organizations/{orgId}/environments/{environmentId}/releases- List releasesPOST /api/organizations/{orgId}/environments/{environmentId}/releases- Publish releasePOST /api/organizations/{orgId}/environments/{environmentId}/merge- Merge a source environment intoProductionGET /api/organizations/{orgId}/environments/{environmentId}/export- Export active environment release