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.

Terminal
curl -H "Authorization: Bearer $STOAKEN_API_KEY" https://www.stoaken.com/api/brands

The 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/api/brandsRead
  • GET/api/brands/:brandIdRead
  • GET/api/brands/:brandId/token-setsRead
  • GET/api/brands/:brandId/themesRead
  • POST/api/brands/:brandId/themesWrite
  • POST/api/brands/:brandId/token-setsWrite
  • POST/api/themes/:themeId/axesWrite
  • POST/api/themes/:themeId/axes/:axis/modesWrite
  • PUT/api/themes/:themeId/axes/:axis/modes/:mode/sets/:tokenSetIdWrite
  • GET/api/token-sets/:tokenSetIdRead
  • PUT/api/token-sets/:tokenSetId/documentWrite
  • PATCH/api/token-sets/:tokenSetId/tokensWrite
  • GET/api/themes/:themeIdRead
  • PATCH/api/themes/:themeIdWrite
  • DELETE/api/themes/:themeIdWrite
  • GET/api/themes/:themeId/tokensRead
  • GET/api/themes/:themeId/tokens/rawRead
  • GET/api/themes/:themeId/deprecationsRead
  • POST/api/themes/:themeId/deprecationsWrite
  • GET/api/themes/:themeId/releasesRead
  • GET/api/themes/:themeId/exportRead
  • POST/api/themes/:themeId/releasesWrite
  • GET/api/releases/:releaseIdRead
  • PATCH/api/releases/:releaseIdWrite
  • GET/api/releases/:releaseId/snapshotRead
  • GET/api/releases/:releaseId/changesRead
  • GET/api/releases/:releaseId/summaryRead
  • GET/api/releases/:releaseId/timelineRead
  • GET/api/releases/:releaseId/exportRead
  • POST/api/releases/:releaseId/submitWrite
  • POST/api/releases/:releaseId/paths/:path/landedWrite
  • GET/api/brands/:brandId/webhooksRead
  • POST/api/brands/:brandId/webhooksWrite
  • PATCH/api/webhooks/:webhookIdWrite
  • DELETE/api/webhooks/:webhookIdWrite
  • POST/api/webhooks/:webhookId/rotate-secretWrite
  • POST/api/webhooks/:webhookId/pingWrite
  • GET/api/workspacesRead
  • POST/api/workspacesWrite
  • GET/api/workspaces/:workspaceId/membersRead
  • GET/api/workspaces/:workspaceId/invitationsRead
  • POST/api/workspaces/:workspaceId/invitationsWrite
  • POST/api/invitations/:invitationId/resendWrite
  • DELETE/api/invitations/:invitationIdWrite
  • POST/api/brands/:brandId/component-modules/missingWrite
  • PUT/api/brands/:brandId/component-modulesWrite
  • POST/api/brands/:brandId/component-importsWrite
  • GET/api/component-imports/:importIdRead
  • POST/api/component-imports/:importId/applyWrite
  • GET/api/brands/:brandId/component-pairsRead
  • GET/api/brands/:brandId/icons/exportRead
  • GET/api/brands/:brandId/iconsRead
  • POST/api/brands/:brandId/iconsWrite
  • POST/api/brands/:brandId/logo-setsWrite
  • GET/api/brands/:brandId/logosRead
  • POST/api/brands/:brandId/logosWrite
MethodPathKind
GET/api/brandsRead
GET/api/brands/:brandIdRead
GET/api/brands/:brandId/token-setsRead
GET/api/brands/:brandId/themesRead
POST/api/brands/:brandId/themesWrite
POST/api/brands/:brandId/token-setsWrite
POST/api/themes/:themeId/axesWrite
POST/api/themes/:themeId/axes/:axis/modesWrite
PUT/api/themes/:themeId/axes/:axis/modes/:mode/sets/:tokenSetIdWrite
GET/api/token-sets/:tokenSetIdRead
PUT/api/token-sets/:tokenSetId/documentWrite
PATCH/api/token-sets/:tokenSetId/tokensWrite
GET/api/themes/:themeIdRead
PATCH/api/themes/:themeIdWrite
DELETE/api/themes/:themeIdWrite
GET/api/themes/:themeId/tokensRead
GET/api/themes/:themeId/tokens/rawRead
GET/api/themes/:themeId/deprecationsRead
POST/api/themes/:themeId/deprecationsWrite
GET/api/themes/:themeId/releasesRead
GET/api/themes/:themeId/exportRead
POST/api/themes/:themeId/releasesWrite
GET/api/releases/:releaseIdRead
PATCH/api/releases/:releaseIdWrite
GET/api/releases/:releaseId/snapshotRead
GET/api/releases/:releaseId/changesRead
GET/api/releases/:releaseId/summaryRead
GET/api/releases/:releaseId/timelineRead
GET/api/releases/:releaseId/exportRead
POST/api/releases/:releaseId/submitWrite
POST/api/releases/:releaseId/paths/:path/landedWrite
GET/api/brands/:brandId/webhooksRead
POST/api/brands/:brandId/webhooksWrite
PATCH/api/webhooks/:webhookIdWrite
DELETE/api/webhooks/:webhookIdWrite
POST/api/webhooks/:webhookId/rotate-secretWrite
POST/api/webhooks/:webhookId/pingWrite
GET/api/workspacesRead
POST/api/workspacesWrite
GET/api/workspaces/:workspaceId/membersRead
GET/api/workspaces/:workspaceId/invitationsRead
POST/api/workspaces/:workspaceId/invitationsWrite
POST/api/invitations/:invitationId/resendWrite
DELETE/api/invitations/:invitationIdWrite
POST/api/brands/:brandId/component-modules/missingWrite
PUT/api/brands/:brandId/component-modulesWrite
POST/api/brands/:brandId/component-importsWrite
GET/api/component-imports/:importIdRead
POST/api/component-imports/:importId/applyWrite
GET/api/brands/:brandId/component-pairsRead
GET/api/brands/:brandId/icons/exportRead
GET/api/brands/:brandId/iconsRead
POST/api/brands/:brandId/iconsWrite
POST/api/brands/:brandId/logo-setsWrite
GET/api/brands/:brandId/logosRead
POST/api/brands/:brandId/logosWrite
Propose a release
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.

Make a set, then a dark mode
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.

Was this page useful?