API overview
On this page
Three addresses, read only: the manual and its design tokens as JSON, and the manual as a PDF. A public manual needs no key, so the shortest useful call is one line. Nothing is written through the API.
curl https://stylehub.cloud/api/v1/manuals/acme.jsonThe three addresses
Every address starts with https://stylehub.cloud/api/v1/manuals/. Any other path under it answers 404 with a note naming the three. On a brand's own host or a custom domain the same three paths answer; there the host names the brand, and the slug is a manual's own path segment or the host's label for the manual at its root.
What a slug is
The API names a manual after its public address, in lowercase, and calls that name the slug. It is one of three things. For the primary manual of a brand, the brand's subdomain: acme for acme.stylehub.cloud. For another manual of the brand, the brand's subdomain and the manual's own path joined with a dot: acme.guidelines for acme.stylehub.cloud/guidelines. For a manual with a subdomain of its own, that subdomain. The dashboard prints the exact address of every published manual on its API page, in the account menu, so nothing has to be worked out.
A first call
curl -sS https://stylehub.cloud/api/v1/manuals/acme.json \
-H "Accept: application/json" | jq '.title, .sections[].title'When you need a token
- A public or unlisted manual answers anyone. No token.
- A private or password protected manual needs an API token of its brand, sent as a bearer. See Tokens and authentication.
- An unpublished manual answers 404, token or not; an expired one answers 410. Every refusal is described under Errors.
Where things are in the dashboard
Under API in the dashboard of a brand: its tokens, the requests a minute its owner's plan allows, the ready made address of each published manual, and how often the API was called in the last thirty days. Tokens are made and revoked there by the owner, an admin, or a custom role holding the settings permission. Open it (opens in a new tab).
The manual as the page shows it
Reading order
- Tokens and authentication, if any manual you read is private.
- Rate limits, before anything runs on a schedule.
- Caching and CORS, so a build that runs hourly does not download an unchanged manual hourly.
- Complete examples, one program per language, when you would rather start from working code.
Something the API does that this page does not say? Write to hello@stylehub.cloud with the request and the answer you got.