Seven routes read one design system with its project token. The command line and the MCP server use the first four; the Figma plugin uses the last three. All are GET, all answer Cache-Control: no-store, and all share the contract on Authentication.
How to use it
| Route | Takes | Answers |
|---|---|---|
GET /api/project |
the bearer token | { "id", "name" }: whose token this is. What designsource connect calls first. |
GET /api/snapshot |
the bearer token; optional pages (1 or 2) |
The snapshot: everything the MCP server serves, in one JSON. |
GET /api/kit |
the bearer token; optional screens, pages (1 or 2) |
The kit manifest designsource add writes from. |
GET /api/starter?framework=next |
the bearer token; framework one of next, vue, svelte, angular, css (default next); optional name (a lowercase package name), screens, pages (1 or 2) |
The starter manifest designsource create and integrate write from. |
GET /api/figma/canonical |
x-figma-sync-token |
The canonical token JSON; headers x-ds-project-id and x-ds-project-name. |
GET /api/figma/blocks |
x-figma-sync-token |
The captured blocks snapshot the plugin's Build blocks draws from, as a gzip file. |
GET /api/figma/icons |
x-figma-sync-token |
The project's whole icon set in its chosen style, for the plugin's Icons page, as a gzip file. |
curl -H "Authorization: Bearer $DS_SYNC_TOKEN" "https://designsource.app/api/starter?framework=next" > manifest.jsonThe shapes are on Data formats.
How it works
The token identifies the project; there is no project id in the URL, so one credential is one design system. GET /api/project is the only route that answers before the plan gate matters in practice: it is gated too, but its body is the two fields a client needs to say whose token it holds.
The snapshot, kit and starter manifests are built on each request from the saved tokens (never the workbench's unsaved edits), so a Save shows on the next call. The MCP server caches the snapshot for 60 seconds on its side.
The Figma routes answer the plugin's iframe, which has a null origin: every answer, refusals included, carries Access-Control-Allow-Origin: * and allows the x-figma-sync-token header, which is safe because no ambient credential is ever sent. The blocks snapshot and the largest icon sets are past the platform's response cap uncompressed, so both routes answer a gzip file (Content-Type: application/gzip) that the plugin unzips itself.
Screens and pages. screens=all or a comma list of up to 50 screen names adds those screens to the kit manifest, or to a Next.js starter, with the parts they import; without it the manifest carries none. Marketing pages stay out of every answer unless pages is sent: pages=1 brings the home, pricing and waitlist pages, which designsource before 0.19.0 asks for, with links to a features, about or contact page removed, and pages=2 brings all six kinds. Any other value of either, pages=true included, is a 400; a bad pages answers the error Invalid pages query, which is the one answer designsource 0.19.0 and later meet by asking again with pages=1. A starter for another framework ignores both.
The starter route refuses a framework outside its list with 400 before looking the token up.
What can go wrong
401: the token is missing or unknown.402 plan_required: the owner is on Free.400: a badframework,screensorpages.- An older command line refuses a manifest whose
versionit does not know and says to update.
Related
- Data formats: what each answer holds.
createandintegrate,add,mcp: the consumers.- Error codes.