Templates

Store the blank forms your organization fills, and inspect their fields.
View as Markdown

A template is an organization-level document you fill in over and over — a W-9, an onboarding packet, a claim form. Templates are persistent (no TTL), never parsed or indexed, and are referenced by fill as template: { "id": "…" }.

Templates are deliberately a different noun from files: files are the inputs a run reads and are subject to a TTL when a run creates them; templates are curated assets that live until you delete them.

Add a template

Two shapes, same as files — send url, or name + mimeType for a presigned upload.

$curl -X POST https://api.cloudraker.com/v1/templates \
> -H "Authorization: Bearer $CLOUDRAKER_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf", "name": "w9-template.pdf" }'
1{
2 "object": "template",
3 "id": "23e0a865-0be9-45b1-a491-f1b6bd58a31a",
4 "name": "w9-template.pdf",
5 "mimeType": "application/pdf",
6 "kind": "pdf-form",
7 "status": "uploading",
8 "createdAt": "2026-07-25T18:01:28.026Z"
9}

status moves uploadingready. Templates are not parsed, so they reach ready as soon as the bytes land — usually seconds.

FieldWhat it is
objectAlways template.
idPass this as template: { "id": … }. Ids are opaque strings — don’t parse them.
kindWhat the template is. pdf-form today.
statusuploading, processing, ready, or failed.
uploadUrl / uploadExpiresAtOnly on the presigned shape. Valid 15 minutes. The PUT’s Content-Type must equal the mimeType you registered exactly, or storage rejects it.

Read, list, delete

$# one template — includes a signed downloadUrl (~1 hour)
$curl https://api.cloudraker.com/v1/templates/23e0a865-0be9-45b1-a491-f1b6bd58a31a \
> -H "Authorization: Bearer $CLOUDRAKER_API_KEY"
$
$# the library — picker rows, newest first, no download URLs
$curl "https://api.cloudraker.com/v1/templates?limit=50" \
> -H "Authorization: Bearer $CLOUDRAKER_API_KEY"
$
$# remove one
$curl -X DELETE https://api.cloudraker.com/v1/templates/23e0a865-0be9-45b1-a491-f1b6bd58a31a \
> -H "Authorization: Bearer $CLOUDRAKER_API_KEY"

?limit caps the page (1–200, default 50). There is no cursor — the list is a single newest-first page. DELETE returns 204.

Inspect the fields

POST /v1/templates/:id/inspect returns the field inventory with page geometry. Fields are detected when the PDF carries no fillable form. The first call can be slow; later calls reuse the result.

$curl -X POST https://api.cloudraker.com/v1/templates/23e0a865-0be9-45b1-a491-f1b6bd58a31a/inspect \
> -H "Authorization: Bearer $CLOUDRAKER_API_KEY"
1{
2 "fields": [
3 {
4 "name": "topmostSubform[0].Page1[0].f1_01[0]",
5 "type": "text",
6 "label": "1 Name of entity/individual. An entry is required.",
7 "required": false,
8 "page": 0,
9 "order": 0,
10 "box": { "x": 58.6, "y": 118.0, "w": 517.4, "h": 14 },
11 "multiline": false
12 }
13 // …22 more on this form
14 ],
15 "pageBoxes": [{ "width": 611.976, "height": 791.968 }],
16 "pageCount": 6,
17 "detected": false
18}
FieldWhat it is
fields[].nameThe PDF’s own field name — the key you send in POST /v1/runs/:id/task values.
fields[].typetext, checkbox, and the other AcroForm types.
fields[].page / box0-based page index and the field rectangle in PDF points, measured against the matching pageBoxes entry.
pageBoxes[] / pageCountPage geometry, so you can render the form yourself.
detectedfalse when the PDF already had form fields; true when they were detected for you.

box here is in PDF points, unlike extraction citations, whose bbox is normalized to 01.

Fill from a template

$curl -X POST https://api.cloudraker.com/v1/fill \
> -H "Authorization: Bearer $CLOUDRAKER_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "template": { "id": "23e0a865-0be9-45b1-a491-f1b6bd58a31a" },
> "files": [{ "id": "a04d6597-4e34-4a99-94ea-964c289a4c68" }]
> }'

Fill also accepts template: { "url": "…" } for a one-off form. That copy is fetched at run time and is not added to your template library — use it for a form you’ll never see again, and a saved {id} for one you fill weekly.

The fetched copy is registered as a file in your API workspace and shows up in GET /v1/files while the run is alive, but it belongs to that run: the run’s TTL reclaims it along with the run’s other files, and POST /v1/runs/:id/keep moves it into the space you keep the run into. Nothing to clean up. A saved template is the opposite — a persistent asset of your library that no run expiry ever deletes.

Next steps