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: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}/tokens- Get all tokens
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/{name}- Get a tokenPATCH /tokensets/{id}/modes/{modeId}/tokens/{name}- Update a tokenDELETE /tokensets/{id}/modes/{modeId}/tokens/{name}- Delete a token
Export
GET /tokensets/{id}/export- Export all modesGET /tokensets/{id}/modes/{modeId}/export- Export a specific mode