---
title: "Fill a public template with JSON data and compile it to a PDF"
method: POST
path: "/api/v1/public_templates/{slug}/render"
tags: ["public templates"]
---

# Fill a public template with JSON data and compile it to a PDF

`POST /api/v1/public_templates/{slug}/render`

## Request

- Base URL: `https://api.pressa.dev`
- URL: `https://api.pressa.dev/api/v1/public_templates/{slug}/render`
- Auth: one of:
  - none
  - HTTP bearer
  - API key in header `X-API-Key`

Fills the template, then runs exactly the compile endpoint: authentication is OPTIONAL with the same anonymous tier and daily limit, the same plan limits, and the same success and failure bodies. The designs of one document take the same data (the five resume designs, as do the packing slip and the delivery note). Data that does not match the schema is a 422 `schema_validation_failed` listing `missing_fields` and `type_errors`; it never reaches the compiler and costs no quota.

## Path parameters

- `slug` string, required

## Request body

- object
  - `data` object, required: Values for the template's fields; see GET /api/v1/public_templates/{slug}.
  - `color` string: Optional: one of the template's `colors` from the list (e.g. navy). Left out, the template's default colour. An unknown colour is a 422 `invalid_color` listing the valid ones.

## Response `200`

PDF produced.

- CompileSuccess
  - `job_id` string, uuid, required
  - `pdf_url` string, uri, required: Signed URL. Fetchable with no credentials until it expires.
  - `expires_at` string, date-time
  - `pages` integer, required: Pages in the PDF at `pdf_url`. For a preview this is what was delivered; `total_pages` is what the document has.
  - `compilation_time_ms` integer
  - `assets_count` integer
  - `studio_url` string, uri: Browser editor link. Absent for anonymous compiles.
  - `anonymous` boolean: Present and true when the compile used the keyless tier.
  - `remaining_today` integer: Anonymous tier only.
  - `note` string: Anonymous tier only. Human- and agent-readable upgrade guidance.
  - `next_step` NextStep: What the caller should do to get past this response.
    - `action` 'obtain_api_key' | 'retry_without_assets'
    - `signup_url` string, uri
    - `env_var` string
    - `header` string
    - `remove_fields` string[]
    - `card_required` boolean
  - `usage` object: Monthly counters for accounts; daily counters for the anonymous tier.
  - `quota_grace` boolean: Present and true when this compilation exceeded the plan's monthly limit and drew on the paid-plan grace buffer. Grace compilations are not charged.
  - `grace_remaining` integer: Compilations left in the grace buffer before requests start failing.
  - `warning` string: Present with `quota_grace` (capacity is about to run out) and with `preview` (what was delivered and which plan covers the whole document). Human- and agent-readable; relay it.
  - `preview` boolean: Present and true when the document exceeded the plan's page or source-size limit. The PDF at `pdf_url` is what the plan delivers of it. Accounts only; anonymous callers get 413/422 instead.
  - `truncated` boolean: With `preview`: true when the PDF holds only the first `pages` of a `total_pages` document, false when the source was over the plan's size limit but every page fit.
  - `total_pages` integer: With `preview`: how many pages the whole document has. `pages` is how many were delivered.
  - `plan_required` 'free' | 'starter' | 'pro' | 'business', nullable: With `preview`: the smallest plan whose page and source-size limits cover the whole document. Null when even Business does not.
  - `upgrade_url` string, uri

## Other responses

- `404`: No public template with that slug.
- `422`: `schema_validation_failed` or `invalid_data` (nothing compiled), or a compile failure with the usual diagnosis.
- `429`: Anonymous daily limit or plan limit reached, as on the compile endpoint.

---

[API](https://skmtc.dev/pressa/apis/pressa-api.md) · [All operations](https://skmtc.dev/pressa/apis/pressa-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pressa/apis/pressa-api/revisions/045e40b209e8?raw)
