POST
/
api
/
generate
curl --request POST \
  --url https://htmldocs.com/api/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "html": "<string>",
  "url": "<string>",
  "format": "pdf",
  "size": "<string>",
  "orientation": "portrait"
}'
This response does not have an example.

This endpoint allows you to generate a PDF document directly from HTML content, without needing to publish a template first.

For generating documents from published templates, see the Generate Document endpoint instead.

Authorizations

Authorization
string
header
required

API key or authentication token

Body

application/json

Response

200
application/pdf

Generated document in requested format

Binary PDF file (when format=pdf)