stylehub.cloud

API documentation

Fetching the PDF

On this page

The published manual as an A4 document, drawn from the published page itself: the same template, colors, fonts and sections, with nothing around them.

Request

Endpoint
GET https://stylehub.cloud/api/v1/manuals/{slug}.pdf

The slug, the token and the refusals are the same as for the manual. See Reading a manual.

Example

GET acme.pdf
curl -sS https://stylehub.cloud/api/v1/manuals/acme.pdf -o acme.pdf

Response

Content-Type
application/pdf, with a Content-Length.
Content-Disposition
An attachment named after the manual's slug field, such as acme.pdf.
ETag
A fingerprint of everything the document was drawn from: the sections, the design settings, the brand's fonts and whether the footer shows. Send it back as If-None-Match and an unchanged manual answers 304 with no body and draws nothing.
Cache-Control
public, max-age=60 for a public or unlisted manual read with no token, private, no-store otherwise. See Caching.
X-RateLimit-*
The request allowance, the same numbers the JSON addresses report, not the render allowance below.

A drawn document is kept in memory on the server for ten minutes. A second caller in that time gets the same bytes rather than a second drawing.

Its own allowance

A render draws the whole page, so it is counted twice: once against the request allowance, like every call, and once against a smaller render allowance of its own. Reading JSON all minute never uses up the renders; reading PDFs all minute does use up the requests.

Plan of the brandPDF renders a minute
Free3
Pro10
Business30

Only a call that draws is a render. A 304 and a document served from the ten minute cache are not. Past the number the answer is 429 with Retry-After in seconds, X-RateLimit-Limit set to the render allowance, and the error Too many PDF renders. Up to N a minute. See Rate limits.

Refusals of its own

503
PDF export is not available on this server. when there is no renderer, or The PDF could not be rendered. Try again in a moment. when the drawing failed. The JSON addresses are unaffected. See Errors.

What is in the document

  • The published sections, in order, in the manual's template and design settings, the same version the page shows.
  • No internal blocks and no empty ones, the same rule as the page and the JSON.
  • The Stylehub footer, when the manual shows branding or the brand's plan has no white label.

The same document as the button

The Download PDF button on a public or unlisted manual links to this address. The button in the dashboard does not: it draws the team's own draft fresh, published or not. What a reader can do with the document is in The manual as a PDF.

Something the API does that this page does not say? Write to hello@stylehub.cloud with the request and the answer you got.

Fetching the PDF - API - Stylehub