POST /v1/render
Compile a custom Typst package
The press compiles a directory of text files. HTTP carries that directory as UTF-8 strings — not a nested document format. Typst still reads data with json("data.json").
- Auth
Authorization: Bearer rmpdf_…- Host
https://pdf.railman.io
| Field | Type | Notes |
|---|---|---|
kindrequired | "typst-package" | Native compile path. |
package.mainrequired | string | Entry file. Must be one of the .typ / .typst paths. |
package.files[]required | { path, content } | Directory listing. content is UTF-8 text, never nested JSON. |
data.json | file | Optional package-root JSON file. Typst reads it with json("data.json"). |
params.json | file | Optional package-root JSON file. Same rule as data.json. |
fonts | "core" | "cjk" | "cjkRound"[] | Allowlist profiles. You never upload font files. |
wait | boolean | HTTP wait, not Typst. Default true: this request waits up to 25s for a PDF. false returns 202 immediately when the job is queued. Cache hits are still 200. |
Package
2 files
Typst
= Hello
#let data = json("data.json")
#data.title
POST envelope
{
"fonts": [
"core"
],
"kind": "typst-package",
"package": {
"files": [
{
"content": "= Hello\n#let data = json(\"data.json\")\n#data.title\n",
"path": "main.typ"
},
{
"content": "{\"title\":\"Q3\"}",
"path": "data.json"
}
],
"main": "main.typ"
},
"wait": true
}curl
curl -X POST https://pdf.railman.io/v1/render \ -H "Authorization: Bearer rmpdf_…" \ -H "Content-Type: application/json" \ -d @package.json
200
application/pdf bytes
sync or cache-hit. Header x-pdf-job-id is the job UUID.
202
{ "jobId": "…", "statusUrl": "/v1/jobs/{id}" }Queued. Poll GET /v1/jobs/{id}.
4xx
{ "type": "https://pdf.railman.io/problems/{code}", "title": "…", "status": 422, "detail": "…" }RFC 9457. Images, remote imports, and unsafe paths are 422 before queue.