serverlesspdf API Reference

Integrate PDF generation into your product in minutes. A single predictable API for render and download flows.

Quickstart

Create an account, confirm your email, create an API key in the dashboard, then send the request below from your backend.

POST /v1/documents/render

POST

Primary PDF generation method. Accepts HTML, CSS and render options. Returns a ready document or a link to it.

Request Headers
Authorization: Bearer <api_key>
Content-Type: application/json
Request Body
{
  "html": "<!doctype html><html>...</html>",
  "options": {
    "pageSize": "A4",
    "landscape": false,
    "printBackground": true,
    "margin": {
      "top": "12mm",
      "right": "12mm",
      "bottom": "12mm",
      "left": "12mm"
    }
  }
}

GET /v1/documents/:documentId/download

GET

Fetch a generated PDF document by ID. On success the route returns a redirect to a short-lived signed URL for secure downloads.

Auth options
  • Session cookie (browser)
  • Bearer API key (backend integrations)

Error format

All errors use the same structured response shape:

{
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "Monthly limit reached",
    "requestId": "req_123abc"
  }
}

Public Beta limits

  • 1,000 renders per quota window and up to 30 concurrent jobs.
  • HTML up to 10 MB, generated PDF up to 100 MB, and up to 1,000 pages per document.
  • Generated PDFs remain available for up to 90 days through signed download URLs.

Errors and recovery

  • QUOTA_EXCEEDED or CONCURRENT_LIMIT_EXCEEDED: wait for the quota window or reduce parallel requests.
  • INVALID_HTML or HTML_TOO_LARGE: validate the payload and keep it within the documented size limit.
  • RENDER_TIMEOUT or RENDER_ERROR: retry with simpler HTML, then keep the requestId when contacting support.