> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Detect a template’s fillable fields

POST https://api.cloudraker.com/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, schema, pageBoxes, pageCount, detected, templateHash }`. Each field carries its name, type, label, page and bounding box — the names you see here are exactly the keys `values` takes on [POST /v1/fill](https://docs.cloudraker.com/api/cloud-raker-api/capabilities/fill). Save the curated `fields` and the `templateHash` 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.

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/capabilities/fill)

Reference: https://docs.cloudraker.com/paperwork/api/templates/inspect-template

## Authentication

- `Authorization` header (bearer token, required)

## Request

### Path parameters

- `id` (string, required)

## Response

### 200

Field inventory, values schema and page geometry.

- `fields` (list of object, required)
  - `name` (string, required) — The field name — the key `values` and task submissions use.
  - `type` (string, required)
  - `label` (string, required) — Human label, read from the form or inferred.
  - `page` (integer, required) — 0-based page the field sits on.
  - `box` (object, required) — Widget box in points, origin top-left.
    - `x` (double, required)
    - `y` (double, required)
    - `width` (double, required)
    - `height` (double, required)
  - `description` (string, optional)
  - `required` (boolean, optional)
  - `options` (list of string, optional) — Choice options (radio, dropdown, listbox).
  - `ignore` (boolean, optional) — Curated as not-fillable.
- `schema` (map from string to any, required) — A JSON Schema describing the `values` object the fields accept.
- `pageBoxes` (list of object, required) — Page size in points, one entry per page.
  - `width` (double, required)
  - `height` (double, required)
- `pageCount` (integer, required)
- `detected` (boolean, required) — True when the fields were detected rather than read from an existing AcroForm.
- `templateHash` (string, required) — sha256 of the prepared template bytes — save it with the fields to spot a stale curation.

## Examples

**Response**

```json
{
  "fields": [
    {
      "name": "string",
      "type": "text",
      "label": "string",
      "page": 1,
      "box": {
        "x": 1.1,
        "y": 1.1,
        "width": 1.1,
        "height": 1.1
      },
      "description": "string",
      "required": true,
      "options": [
        "string"
      ],
      "ignore": true
    }
  ],
  "schema": {},
  "pageBoxes": [
    {
      "width": 1.1,
      "height": 1.1
    }
  ],
  "pageCount": 1,
  "detected": true,
  "templateHash": "string"
}
```

**SDK Code**

```typescript
import { CloudRakerClient } from "@cloudraker/api";

async function main() {
    const client = new CloudRakerClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.templates.inspectTemplate({
        id: "id",
    });
}
main();

```

```python
from cloudraker import CloudRaker

client = CloudRaker(
    token="YOUR_TOKEN_HERE",
)

client.templates.inspect_template(
    id="id",
)

```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

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

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cloudraker.com/v1/templates/id/inspect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.cloudraker.com/v1/templates/id/inspect")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cloudraker.com/v1/templates/id/inspect', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/v1/templates/id/inspect");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cloudraker.com/v1/templates/id/inspect")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```