API reference

One endpoint to render the business documents your product depends on

Authenticate with an API key, send HTML and rendering options, then return a production-ready PDF your app can download, store, or stream to users.

Base URL: https://getdocrender.com Auth: x-api-key header Format: application/json

Render PDF

The core request accepts HTML plus a few layout settings so you can generate professional documents from your product.

POST /api/v1/render/pdf
{
  "html": "<h1>Invoice</h1><p>Total: £100</p>",
  "pageSize": "A4",
  "orientation": "portrait",
  "fileName": "invoice-100.pdf",
  "metadata": {
    "documentType": "invoice",
    "accountId": "acct_123"
  }
}

Headers and supported fields

Keep the request small and explicit so your integration is easy to reason about.

Required request details

  • x-api-key header with your account key
  • Content-Type: application/json
  • html body field containing your printable markup
  • pageSize and orientation for page layout

Document capabilities

  • Print CSS with dependable pagination and page breaks
  • Headers, footers, page numbers, tables, images, and fonts
  • File naming and metadata support for downstream workflows
  • Built for invoices, reports, contracts, statements, and letters

Example response

Use the returned identifiers and file URL to manage download or storage inside your own product flow.

{
  "id": "doc_01JH8PX3RX4S7M1D8P4R5WQY2V",
  "status": "completed",
  "fileName": "invoice-100.pdf",
  "contentType": "application/pdf",
  "downloadUrl": "https://getdocrender.com/files/doc_01JH8PX3RX4S7M1D8P4R5WQY2V",
  "expiresAt": "2026-03-21T12:00:00Z"
}

Error handling and operational notes

The main integration work is usually around validating input and handling render failures cleanly.

Common API responses

  • 401 when the API key is missing or invalid
  • 400 when required fields such as html are missing
  • 422 when markup cannot be rendered safely
  • 5xx for transient platform or dependency failures

Security and retention

  • Queue-based rendering for reliable workload handling
  • API-key-based authentication for server-side integrations
  • Temporary file storage suited to document workflows
  • Auto-delete policies designed for business-sensitive output

Want the getting-started version?

Use the docs page for the quickstart path, then come back here when you need the reference details for production integration.