POST /v1/render
Fill a published template
Name a published template as namespace/slug[@version] plus JSON data. web assembles the same file directory; the press still compiles typst-package only.
- Auth
Authorization: Bearer rmpdf_…- Host
https://pdf.railman.io
| Field | Type | Notes |
|---|---|---|
kindrequired | "typst-template" | Assembled in web. Never a press kind. |
templaterequired | string | namespace/slug or namespace/slug@version. |
version | integer | Optional sibling. Pinned onto the ref only when @version is omitted. @version in template wins. |
datarequired | object | JSON object. web writes it to data.json beside your Typst files, then submits typst-package. |
params | object | Optional object written to params.json. Not the template; Typst reads json("params.json"). |
wait | boolean | Same HTTP wait contract as the package path — not Typst syntax. |
Request body
{
"data": {
"client": {
"address": "88 Market Street, San Francisco, CA",
"email": "ap@acme.example",
"name": "Acme Studio"
},
"currency": "USD",
"dueDate": "2026-09-16",
"invoiceNumber": "INV-1042",
"issueDate": "2026-08-17",
"items": [
{
"description": "Typst press retainer",
"quantity": 1,
"unitPrice": 1200
},
{
"description": "Extra compile hours",
"quantity": 4,
"unitPrice": 85
}
],
"notes": "Net 30. Wire details on file.",
"seller": {
"address": "Railman, SNRK",
"email": "billing@railman.io",
"name": "PDF Railman"
},
"shareUrl": "https://pdf.railman.io/library/railman/invoice",
"taxRate": 0
},
"kind": "typst-template",
"template": "railman/invoice@1",
"wait": true
}curl
curl -X POST https://pdf.railman.io/v1/render \ -H "Authorization: Bearer rmpdf_…" \ -H "Content-Type: application/json" \ -d @template.json
200
application/pdf bytes
Same download contract as the package path.
202
{ "jobId": "…", "statusUrl": "/v1/jobs/{id}" }Queued after assemble. Credits still come from the caller, not the template owner.
4xx
{ "type": "https://pdf.railman.io/problems/{code}", "detail": "…" }Unknown ref, unpublished version, or schema mismatch.