Compose

Combine multiple templates and/or raw HTML into a single PDF. Each part renders on a new page. Counts as one conversion for billing.

POST/v1/compose

Request

The parts array accepts 1-10 items. Each part is either a template reference (template + data) or raw HTML (html). Parts render in order with automatic page breaks.

Request body
{
  "parts": [
    { "template": "cover-page", "data": { "title": "Q1 Report" } },
    { "template": "financials", "data": { "revenue": 128500 } },
    { "html": "<div style='text-align:center;padding:60px'><p>Confidential</p></div>" },
    { "template": "appendix", "data": { "notes": ["Audit pending"] } }
  ],
  "options": { "page_size": "A4" }
}

Response (200)

{
  "id": "conv_mR9xLwQp",
  "status": "completed",
  "document_id": "doc_4f7ab2c1",
  "page_count": 4,
  "duration_ms": 87,
  "parts_count": 4
}

This endpoint also supports hosting options for public download links with expiration, limits, and password protection.

Compose - pdfRelay Docs | pdfRelay