HTML → PDF API

Render a public web page or raw HTML to a PDF using Revalate’s Browser Rendering worker. Access is authorized using an API token you create inside your team. Only tokens belonging to users with an active Stripe subscription will be allowed.

Base URL
https://staging-render-api.revalate.com
GET Endpoint
/render
POST Endpoint
/render

Authentication

Provide your token with Authorization: Bearer <token>. For GET requests you may alternatively pass ?token=....

Render via Web URL (GET)

Use GET when you want to render an existing publicly accessible URL.

http
GET /render?url=https://example.com&token=YOUR_TOKEN&filename=Invoice.pdf&download=1

Query Parameters

  • url (required): Public URL to render
  • token (required if no Authorization header)
  • filename (optional): Defaults to Revalate_Document.pdf
  • download=1 (optional): Forces download via Content-Disposition

Render via API (POST)

Use POST when you want to send raw HTML or choose either HTML or URL.

http
POST /render
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
json
{
  "url": "https://example.com",  // optional if html/html_b64 provided
  "html": "<html>...</html>",   // optional
  "html_b64": "...",            // optional base64-encoded HTML
  "pdfOptions": {
    "format": "A4",
    "printBackground": true
  },
  "gotoOptions": { "waitUntil": "domcontentloaded" }
}

JSON Schemas

Minimal, illustrative schemas for payloads.

json
// GET (query)
{
  "url": "string (required)",
  "token": "string (required if no Authorization)",
  "filename": "string?",
  "download": "" | "1"?
}
json
// POST (body)
{
  "url": "string?",
  "html": "string?",
  "html_b64": "string?",
  "pdfOptions": { [key: string]: any }?,
  "gotoOptions": { "waitUntil"?: "load"|"domcontentloaded"|"networkidle0"|"networkidle2" }?
}

Response

http
200 OK
Content-Type: application/pdf
Content-Disposition: inline; filename="Revalate_Document.pdf"

Errors

http
400 Invalid input
401 Invalid or missing token
402 Subscription inactive
429 Rate limited (if enabled)
500 Rendering error

Examples

cURL – GET

bash
curl -L "https://staging-render-api.revalate.com/render?url=https://example.com&token=YOUR_TOKEN" -o out.pdf

cURL – POST HTML

bash
curl -X POST "https://staging-render-api.revalate.com/render" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"html":"<html><body><h1>Hello</h1></body></html>","pdfOptions":{"format":"A4"}}' \
  -o out.pdf