Skip to main content
POST
Generate a PDF from HTML
Render a small HTML document as a PDF. The default response is binary application/pdf; use response_type: "base64" only when your application needs the PDF inside a JSON envelope. The Playground is deliberately limited to response_type: "base64" and returns the JSON envelope only. For a raw application/pdf response, use Postman or your backend integration.
Live Testing Guide: Before using Try it, create a Development project, then enter its Client ID and Client Secret. Configure the relevant provider for that project before sending the request.
HTML can contain invoice details, customer data, and other sensitive business information. Send X-Privacy-Mode: 1 when that privacy guarantee is appropriate for the request. Never place Project Client Secrets in frontend code.

API endpoint

POST

Request fields

AvraAPI sanitizes the HTML before rendering. Treat the result as a document generated from your own content: keep complex document storage, delivery, and authorization in your backend.

Request example

This request receives a real PDF stream. The --output option saves that binary response as a file.
curl

Binary PDF response

response_type: "binary" is the default. A successful request returns the PDF bytes with Content-Type: application/pdf, Content-Length, Cache-Control: no-store, Content-Disposition: inline; filename="apix-document.pdf", and X-APIX-Request-ID headers. The PDF is the response body, not a JSON object. Use this mode from your backend, Postman, or another HTTP client that can handle binary media.

Base64 JSON response

Set response_type to base64 when a JSON response is required. data.data contains Base64 PDF bytes; it is not a temporary download link and AvraAPI does not store an artifact for later retrieval through this API.
curl
The value above is intentionally truncated. A successful response carries the complete Base64 document. Decode it only in a protected backend or trusted application context; do not place PDF content containing sensitive data into browser logs, analytics, or public client state.

Error codes

See the REST API guide for shared credentials, privacy, and response-handling rules.

Playground resources

The generated reference below lists this endpoint’s API standard details: request fields, authorizations, and response schema. The complete integration guide, request and response examples, and endpoint-specific error handling are above.

Authorizations

X-API-KEY
string
header
required

Your Development project's Client ID. Enter your own value in the Documentation Playground.

X-API-SECRET
string
header
required

Your Development project's Client Secret. Mintlify does not proxy these requests; the browser sends them directly to AvraAPI. Never enter a Production secret in the Documentation Playground.

Headers

X-ENV
enum<string>
default:development

Selects the Development credential environment. The Documentation Playground exposes Development values only; normal backend integrations may use their documented Production credentials outside this tool.

Available options:
dev,
development
Accept
string

Requests a JSON response where the selected operation supports JSON.

Example:

"application/json"

X-Privacy-Mode
boolean
default:false

Optional privacy override. Turn this on to request that AvraAPI suppress request-payload storage in observability logs for this request.

Example:

true

Body

application/json

Documentation Playground request projection. The released API also supports a binary PDF response for backend and Postman integrations.

html
string
required

HTML source, limited to 512 KB after Base64 decoding when is_base64 is true.

Required string length: 1 - 524288
response_type
enum<string>
default:base64
required

Fixed to Base64 JSON for the Documentation Playground.

Available options:
base64
privacy_mode
enum<boolean>
default:true
required

Fixed on for the Documentation Playground request body.

Available options:
true
is_base64
boolean
default:false

When true, html is Base64-encoded HTML and is decoded before validation and rendering.

page_size
enum<string>
default:A4
Available options:
A4,
Letter,
Legal
orientation
enum<string>
default:portrait
Available options:
portrait,
landscape
margins
object

Page margins in millimetres.

Response

Base64 PDF JSON envelope for the Documentation Playground.

success
enum<boolean>
required
Available options:
true
request_id
string<uuid>
required

Include this value when contacting AvraAPI support.

data
object
required

Operation-specific result data.

Last modified on October 1, 2026