Templates

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

A template is an organization-level document that you fill in many times. Examples: a W-9, an onboarding packet, a claim form. Templates are persistent and have no TTL. CloudRaker never parses or indexes them. Fill references a template as template: { "id": "…" }.

Templates are a different noun from files by design. Files are the inputs a run reads. A file that a run creates is subject to a TTL. Templates are curated assets that live until you delete them.

Add a template

There are two shapes, the same as files. Send url, or send 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 from uploading to ready. CloudRaker does not parse templates, so a template reaches ready when the bytes land. This usually takes seconds.

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

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, a values schema, and a content hash. CloudRaker detects fields when the PDF carries no fillable form. It also reads each field’s printed caption as its label. The first call can be slow. Later calls reuse the result. Templates over 32 MB answer 413 template_too_large.

Inspect is the configure-time step of fill. Curate the returned fields — labels, descriptions, ignore flags — and save them with the templateHash on a fill config. A fill run never re-inspects the form.

$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 "box": { "x": 58.6, "y": 118.0, "width": 517.4, "height": 14 },
10 "ignore": false
11 }
12 // …22 more on this form
13 ],
14 "schema": { "type": "object", "properties": { "values": { /* one property per field */ } }, "required": ["values"] },
15 "pageBoxes": [{ "width": 611.976, "height": 791.968 }],
16 "pageCount": 6,
17 "detected": false,
18 "templateHash": "9c56cc51b374c3ba189210d5b6d4bf57790d351c96c47c02190ecf1e430635ab"
19}
FieldWhat it is
fields[].nameThe PDF’s own field name. This is the key values takes on POST /v1/fill.
fields[].typetext, checkbox, and the other AcroForm types. Choice fields also carry options[].
fields[].label / descriptionThe human caption, read from the form or inferred from the page. description starts as the section heading; overwrite it with your own guidance when you curate.
fields[].page / boxThe 0-based page index and the field rectangle in PDF points, measured against the matching pageBoxes entry.
fields[].ignorefalse on every inspected field. Set it to true when you curate a field no run should touch.
schemaA JSON Schema describing the exact values object the fields accept.
pageBoxes[] / pageCountPage geometry, so you can render the form yourself.
detectedfalse when the PDF already had form fields. true when CloudRaker detected them for you.
templateHashsha256 of the prepared template bytes. Save it with the curated fields to spot a stale curation after the template changes.

box here is in PDF points. Extraction citations differ: their 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. CloudRaker fetches that copy at run time and does not add it to your template library. Use a url for a form you will never see again. Use a saved {id} for a form you fill weekly.

CloudRaker registers the fetched copy as a file in your API workspace. It 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. POST /v1/runs/:id/keep moves it into the space you keep the run into. There is nothing to clean up. A saved template is the opposite: a persistent asset of your library. No run expiry ever deletes it.

Next steps