REST API
Read tokens and releases, propose changes and manage themes and webhooks over HTTPS. Every call runs as the key's owner, inside their roles.
Authentication
Create a key in Settings > Developer access and send it as a bearer token. Keys act as you; revoke them at any time.
curl -H "Authorization: Bearer $STOAKEN_API_KEY" https://www.stoaken.com/api/brandsThe API answers browsers on any origin (CORS), for tools that run in a browser, such as the Figma plugin. It only ever reads the key from the Authorization header, never a cookie, so a web page can’t act as a visitor. Never put a key in a public web page.
Versions
Pin a version with the Stoaken-Version header (current: 2026-09-29). Responses echo the version they used.
Rate limits
120 requests per minute per key, and 60 writes per hour. Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; over the limit you get 429 with Retry-After.
Idempotency
Send an Idempotency-Key header on writes. Repeating the same request with the same key returns the first response (with Idempotent-Replayed: true) instead of doing it twice.
Errors
Errors are RFC 9457 problem documents (application/problem+json) with a type you can look up at /api/problems/<slug> and a plain detail. On the Free plan, writes return 403 with what to upgrade.
Endpoints
The full schema is at /api/openapi.json (OpenAPI 3.1). Lists are paginated with limit and cursor.
- GET
/Readapi/ brands - GET
/Readapi/ brands/ :brandId - GET
/Readapi/ brands/ :brandId/ token-sets - GET
/Readapi/ brands/ :brandId/ themes - POST
/Writeapi/ brands/ :brandId/ themes - POST
/Writeapi/ brands/ :brandId/ token-sets - POST
/Writeapi/ themes/ :themeId/ axes - POST
/Writeapi/ themes/ :themeId/ axes/ :axis/ modes - PUT
/Writeapi/ themes/ :themeId/ axes/ :axis/ modes/ :mode/ sets/ :tokenSetId - GET
/Readapi/ token-sets/ :tokenSetId - PUT
/Writeapi/ token-sets/ :tokenSetId/ document - PATCH
/Writeapi/ token-sets/ :tokenSetId/ tokens - GET
/Readapi/ themes/ :themeId - PATCH
/Writeapi/ themes/ :themeId - DELETE
/Writeapi/ themes/ :themeId - GET
/Readapi/ themes/ :themeId/ tokens - GET
/Readapi/ themes/ :themeId/ tokens/ raw - GET
/Readapi/ themes/ :themeId/ deprecations - POST
/Writeapi/ themes/ :themeId/ deprecations - GET
/Readapi/ themes/ :themeId/ releases - GET
/Readapi/ themes/ :themeId/ export - POST
/Writeapi/ themes/ :themeId/ releases - GET
/Readapi/ releases/ :releaseId - PATCH
/Writeapi/ releases/ :releaseId - GET
/Readapi/ releases/ :releaseId/ snapshot - GET
/Readapi/ releases/ :releaseId/ changes - GET
/Readapi/ releases/ :releaseId/ summary - GET
/Readapi/ releases/ :releaseId/ timeline - GET
/Readapi/ releases/ :releaseId/ export - POST
/Writeapi/ releases/ :releaseId/ submit - POST
/Writeapi/ releases/ :releaseId/ paths/ :path/ landed - GET
/Readapi/ brands/ :brandId/ webhooks - POST
/Writeapi/ brands/ :brandId/ webhooks - PATCH
/Writeapi/ webhooks/ :webhookId - DELETE
/Writeapi/ webhooks/ :webhookId - POST
/Writeapi/ webhooks/ :webhookId/ rotate-secret - POST
/Writeapi/ webhooks/ :webhookId/ ping - GET
/Readapi/ workspaces - POST
/Writeapi/ workspaces - GET
/Readapi/ workspaces/ :workspaceId/ members - GET
/Readapi/ workspaces/ :workspaceId/ invitations - POST
/Writeapi/ workspaces/ :workspaceId/ invitations - POST
/Writeapi/ invitations/ :invitationId/ resend - DELETE
/Writeapi/ invitations/ :invitationId - POST
/Writeapi/ brands/ :brandId/ component-modules/ missing - PUT
/Writeapi/ brands/ :brandId/ component-modules - POST
/Writeapi/ brands/ :brandId/ component-imports - GET
/Readapi/ component-imports/ :importId - POST
/Writeapi/ component-imports/ :importId/ apply - GET
/Readapi/ brands/ :brandId/ component-pairs - GET
/Readapi/ brands/ :brandId/ icons/ export - GET
/Readapi/ brands/ :brandId/ icons - POST
/Writeapi/ brands/ :brandId/ icons - POST
/Writeapi/ brands/ :brandId/ logo-sets - GET
/Readapi/ brands/ :brandId/ logos - POST
/Writeapi/ brands/ :brandId/ logos
| Method | Path | Kind |
|---|---|---|
GET | /api/brands | Read |
GET | /api/brands/:brandId | Read |
GET | /api/brands/:brandId/token-sets | Read |
GET | /api/brands/:brandId/themes | Read |
POST | /api/brands/:brandId/themes | Write |
POST | /api/brands/:brandId/token-sets | Write |
POST | /api/themes/:themeId/axes | Write |
POST | /api/themes/:themeId/axes/:axis/modes | Write |
PUT | /api/themes/:themeId/axes/:axis/modes/:mode/sets/:tokenSetId | Write |
GET | /api/token-sets/:tokenSetId | Read |
PUT | /api/token-sets/:tokenSetId/document | Write |
PATCH | /api/token-sets/:tokenSetId/tokens | Write |
GET | /api/themes/:themeId | Read |
PATCH | /api/themes/:themeId | Write |
DELETE | /api/themes/:themeId | Write |
GET | /api/themes/:themeId/tokens | Read |
GET | /api/themes/:themeId/tokens/raw | Read |
GET | /api/themes/:themeId/deprecations | Read |
POST | /api/themes/:themeId/deprecations | Write |
GET | /api/themes/:themeId/releases | Read |
GET | /api/themes/:themeId/export | Read |
POST | /api/themes/:themeId/releases | Write |
GET | /api/releases/:releaseId | Read |
PATCH | /api/releases/:releaseId | Write |
GET | /api/releases/:releaseId/snapshot | Read |
GET | /api/releases/:releaseId/changes | Read |
GET | /api/releases/:releaseId/summary | Read |
GET | /api/releases/:releaseId/timeline | Read |
GET | /api/releases/:releaseId/export | Read |
POST | /api/releases/:releaseId/submit | Write |
POST | /api/releases/:releaseId/paths/:path/landed | Write |
GET | /api/brands/:brandId/webhooks | Read |
POST | /api/brands/:brandId/webhooks | Write |
PATCH | /api/webhooks/:webhookId | Write |
DELETE | /api/webhooks/:webhookId | Write |
POST | /api/webhooks/:webhookId/rotate-secret | Write |
POST | /api/webhooks/:webhookId/ping | Write |
GET | /api/workspaces | Read |
POST | /api/workspaces | Write |
GET | /api/workspaces/:workspaceId/members | Read |
GET | /api/workspaces/:workspaceId/invitations | Read |
POST | /api/workspaces/:workspaceId/invitations | Write |
POST | /api/invitations/:invitationId/resend | Write |
DELETE | /api/invitations/:invitationId | Write |
POST | /api/brands/:brandId/component-modules/missing | Write |
PUT | /api/brands/:brandId/component-modules | Write |
POST | /api/brands/:brandId/component-imports | Write |
GET | /api/component-imports/:importId | Read |
POST | /api/component-imports/:importId/apply | Write |
GET | /api/brands/:brandId/component-pairs | Read |
GET | /api/brands/:brandId/icons/export | Read |
GET | /api/brands/:brandId/icons | Read |
POST | /api/brands/:brandId/icons | Write |
POST | /api/brands/:brandId/logo-sets | Write |
GET | /api/brands/:brandId/logos | Read |
POST | /api/brands/:brandId/logos | Write |
curl -X POST https://www.stoaken.com/api/themes/$THEME_ID/releases \
-H "Authorization: Bearer $STOAKEN_API_KEY" \
-H "Idempotency-Key: release-1-4-0" \
-H "Content-Type: application/json" \
-d '{"version":"1.4.0","title":"Checkout colours"}'A release can carry a title (one plain line, up to 120 characters); PATCH /api/releases/{releaseId} with {"title": "..."} changes it while it is a draft or waiting, by the person who proposed it (409 once decided). Token sets, axes and modes can be made through the API too (Editor on the Brand, working copy only; nothing is live until a person approves a release). A new set with theme_id is added to that theme only when it overrides nothing there, or with accept_overrides; otherwise added_to_theme is false and overrides lists what would change.
curl -X POST https://www.stoaken.com/api/brands/$BRAND_ID/token-sets -H "Authorization: Bearer $STOAKEN_API_KEY" -H "Idempotency-Key: set-mobile" -H "Content-Type: application/json" -d '{"name":"Mobile","theme_id":"'$THEME_ID'"}'
curl -X POST https://www.stoaken.com/api/themes/$THEME_ID/axes -H "Authorization: Bearer $STOAKEN_API_KEY" -H "Idempotency-Key: axis-scheme" -H "Content-Type: application/json" -d '{"key":"color-scheme","modes":[{"key":"light","default":true},{"key":"dark"}]}'Icons and logos (Editor on the Brand; working copy only, so every answer has live: false and a next naming the release call): POST /api/brands/{brandId}/icons takes 1 to 300 icons ({"icons": [{"name": "arrow_back", "svg": "<svg …>"}], "on_conflict": "skip"}; names match ^[a-z0-9]+([_-][a-z0-9]+)*$; over the Brand’s 2,000 the whole call is refused with the numbers) and answers saved, replaced, unchanged, refused (with why) and same_drawing. POST …/logo-sets makes a set; GET …/logos lists the sets and logos (Viewer); POST …/logos takes 1 to 20 files as base64 into a set by id or by name (each up to 3 MB; the body up to 4 MB, so big files go one per call). To ship them on a theme other than the main one, propose its release with "include_assets": true.