---
title: "Detect a template’s fillable fields"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Detect a template’s fillable fields

Path: CloudRaker Paperwork API › Templates

`POST /v1/templates/{id}/inspect`

Enumerates the fillable fields in a `pdf-form` template, with the page geometry to draw them on.

The response is `{ fields, pageBoxes, pageCount, detected }`. Each field carries its name, type, label, page and bounding box — plus `maxLength`, `multiline` and `options` where the widget declares them. The names you see here are exactly the keys `values` takes on [POST /v1/fill](https://docs.cloudraker.com/paperwork/api/capabilities/fill). Save the curated `fields` onto a fill config to fix the schema for every run.

If the PDF carries no form fields of its own, they are detected from the page instead and `detected` says so.

Any PDF you can reach works here, not only a saved template — a file in one of your spaces is inspected the same way.

> **Note:** Idempotent, but the first call on a template can be slow while the document is analyzed. Later calls reuse that result and return promptly.

**Learn more:** [Form filling guide](https://docs.cloudraker.com/paperwork/capabilities/fill)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`inspectTemplate.path.id`; string, required)
  - minLength 1

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/v1/templates/<id>/inspect' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/templates/<id>/inspect';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/v1/templates/<id>/inspect"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 200

Field inventory, values schema and page geometry.

#### Example

```json
{
  "fields": [
    {
      "name": "string",
      "type": "text",
      "label": "string",
      "description": "string",
      "required": true,
      "options": [
        "string"
      ],
      "maxLength": -9007199254740991,
      "multiline": true,
      "section": "string",
      "page": -9007199254740991,
      "box": {
        "x": 0,
        "y": 0,
        "width": 0,
        "height": 0
      },
      "ignore": true
    }
  ],
  "schema": {
    "property1": null,
    "property2": null
  },
  "pageBoxes": [
    {
      "width": 0,
      "height": 0
    }
  ],
  "pageCount": -9007199254740991,
  "detected": true,
  "templateHash": "string"
}
```

- `fields` (`inspectTemplate.response.200.fields`; array<object>, required)
  - `name` (`inspectTemplate.response.200.fields.name`; string, required) — The field name — the key `values` and task submissions use.
  - `type` (`inspectTemplate.response.200.fields.type`; string, required)
    - example `"text"`
  - `label` (`inspectTemplate.response.200.fields.label`; string | null, required) — Human label, read from the form or inferred. `null` when neither worked.
  - `page` (`inspectTemplate.response.200.fields.page`; integer, required) — 0-based page the field sits on.
    - min -9007199254740991; max 9007199254740991
  - `box` (`inspectTemplate.response.200.fields.box`; object, required) — Widget box in points, origin top-left.
    - `x` (`inspectTemplate.response.200.fields.box.x`; number, required)
    - `y` (`inspectTemplate.response.200.fields.box.y`; number, required)
    - `width` (`inspectTemplate.response.200.fields.box.width`; number, required)
    - `height` (`inspectTemplate.response.200.fields.box.height`; number, required)
  - `description` (`inspectTemplate.response.200.fields.description`; string, optional)
  - `required` (`inspectTemplate.response.200.fields.required`; boolean, optional)
  - `options` (`inspectTemplate.response.200.fields.options`; array<string>, optional) — Choice options (radio, dropdown, listbox).
  - `maxLength` (`inspectTemplate.response.200.fields.maxLength`; integer, optional) — Character cap the widget enforces — longer values are truncated on fill.
    - min -9007199254740991; max 9007199254740991
  - `multiline` (`inspectTemplate.response.200.fields.multiline`; boolean, optional)
  - `section` (`inspectTemplate.response.200.fields.section`; string, optional) — Heading the field sits under, if any.
  - `ignore` (`inspectTemplate.response.200.fields.ignore`; boolean, optional) — Curated as not-fillable.
- `pageBoxes` (`inspectTemplate.response.200.pageBoxes`; array<object>, required) — Page size in points, one entry per page.
  - `width` (`inspectTemplate.response.200.pageBoxes.width`; number, required)
  - `height` (`inspectTemplate.response.200.pageBoxes.height`; number, required)
- `pageCount` (`inspectTemplate.response.200.pageCount`; integer, required)
  - min -9007199254740991; max 9007199254740991
- `detected` (`inspectTemplate.response.200.detected`; boolean, required) — True when the fields were detected rather than read from an existing AcroForm.
- `schema` (`inspectTemplate.response.200.schema`; map<unknown>, optional) — A JSON Schema describing the `values` object the fields accept.
- `templateHash` (`inspectTemplate.response.200.templateHash`; string, optional) — sha256 of the prepared template bytes — save it with the fields to spot a stale curation.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`inspectTemplate.response.400.success`; boolean, required)
  - one of `false`
- `error` (`inspectTemplate.response.400.error`; array<unknown>, required)
- `data` (`inspectTemplate.response.400.data`; unknown, required)

### 409

The template is still uploading (`file_not_ready`).

### 413

The template exceeds the 32 MB inspect cap (`template_too_large`).

### 422

The template is not a PDF (`template_not_inspectable`).

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`inspectTemplate.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`inspectTemplate.response.429.message`; string, required)
- `retryable` (`inspectTemplate.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`inspectTemplate.response.429.requestId`; string, required)
- `docUrl` (`inspectTemplate.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/templates/inspect-template/index.md
