Document Renders

Render html to a pdf or docx

POST/document-renders

Starts a job (type document_render) that turns html into a pdf or docx and keeps the file for 7 days. Returns 202; poll GET /document-renders/{id} until status is succeeded, then use result.download_url. html is at most 5,000,000 characters. The converter refusing a pdf fails the job upstream_error. No callback or webhook. Only the starting token can read the render (others get 404). It can't be undone, but the file expires on its own. dry_run validates and returns 202 with no job.

Query parameters

  • dry_runboolean#

    Validate and run the call without committing it, returning what the real call would return with meta.dry_run set.

Headers

  • Idempotency-Keystring#

    Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.

Request body

application/json, required

  • htmlstringRequired#

    The html to render, as a whole document or a fragment. It must not be blank.

  • formatstringRequired#

    pdf is rendered through the document converter; docx is built from the html directly.

    One of: pdf, docx
  • filenamestring#

    The name to report for the file in result.filename, without a path. It may not contain a slash, a backslash or a control character.

    Default: "document"
{
  "html": "<h1>Subscription agreement</h1><p>Between the parties.</p>",
  "format": "pdf",
  "filename": "agreement"
}

Responses

202

The render job was started. Its result carries the file once it has succeeded.

Job
{
  "data": {
    "id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
    "type": "string",
    "status": "queued",
    "progress": {
      "done": 1,
      "total": 1
    },
    "result": {},
    "error": {},
    "created_at": "2026-06-12T10:00:00+00:00",
    "updated_at": "2026-06-12T10:00:00+00:00",
    "completed_at": "2026-06-12T10:00:00+00:00"
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X POST https://your-org-domain/kong/core/api/v2/document-renders\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "html": "<h1>Subscription agreement</h1><p>Between the parties.</p>",
  "format": "pdf",
  "filename": "agreement"
}'