📄 PDF Generation API

The Outliny PDF Generation API lets you create professional, dynamic PDFs from your templates with just one simple API call.

Endpoint

POST /api/v1/render/pdf

Authentication

Include your API Key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Need an API key? Create one in your dashboard.

Request Body

FieldTypeRequiredDescription
template_idstringYesID of the PDF template you created in Outliny.
parametersobjectYesKey-value pairs replacing Jinja variables in template.
output_typestringOptionalpdf (default) or base64.
filenamestringOptionalSuggested filename for downloaded file

Example Request

POST https://api.outliny.com/api/v1/render/pdf
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "template_id": "template_123abc",
  "parameters": {
    "customer_name": "Jane Doe",
    "invoice_number": "INV-2025-001",
    "amount_due": "$500",
    "due_date": "2025-05-10"
  },
  "filename": "invoice-jane-doe.pdf"
}

Response

FieldTypeDescription
statusstringsuccess
file_urlstring (If hosted) URL to download the PDF
file_urlstring(If output_type=base64) Base64-encoded PDF.

Example Response (default output)

{
  "status": "success",
  "file_url": "https://api.outliny.com/files/generated/invoice-jane-doe.pdf"
}

Example Response (base64)

{
  "status": "success",
  "file_base64": "JVBERi0xLjQKJc..."
}

Output Types Explained

ValueDescription
pdfHosted URL (default).
base64Returns the PDF directly encoded in base64 string (useful for APIs, internal storage, etc.).

Common Errors

HTTP CodeErrorDescription
400invalid_requestMissing or invalid fields
401unauthorizedMissing/incorrect API key
404template_not_foundTemplate ID doesn't exist
500internal_errorServer error—try later

Notes

  • Parameters must match Jinja variable names like amount_due
  • PDFs typically generate within 1-3 seconds
  • Files are private, securely hosted, and expire after a set period