> 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.

# Inspect a form template's fillable fields

POST https://api.cloudraker.com/actions/{id}/template/inspect
Content-Type: application/json

Reads the PDF referenced by the JSON body — either `{ spaceId, fileId }` (a file in that space) or `{ fileId }` alone (an org-level template file) — detecting form fields when the document has none, and returns the field inventory with page geometry (`{ fields, pageBoxes, pageCount, detected }`). Idempotent; initial field detection can take longer, while later calls reuse the prior result. The file must be `application/pdf` and parented to `:spaceId` (when given) or to the caller’s organization (else 422 `file_ineligible`), and must have finished uploading (else 409 `file_not_ready`). Organization administrators only (denied → 403).

Reference: https://docs.cloudraker.com/api/cloud-raker-api/workspace/installed-actions/inspect-form-template

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: CloudRaker API
  version: 1.0.0
paths:
  /actions/{id}/template/inspect:
    post:
      operationId: inspect-form-template
      summary: Inspect a form template's fillable fields
      description: >-
        Reads the PDF referenced by the JSON body — either `{ spaceId, fileId }`
        (a file in that space) or `{ fileId }` alone (an org-level template
        file) — detecting form fields when the document has none, and returns
        the field inventory with page geometry (`{ fields, pageBoxes, pageCount,
        detected }`). Idempotent; initial field detection can take longer, while
        later calls reuse the prior result. The file must be `application/pdf`
        and parented to `:spaceId` (when given) or to the caller’s organization
        (else 422 `file_ineligible`), and must have finished uploading (else 409
        `file_not_ready`). Organization administrators only (denied → 403).
      tags:
        - installedActions
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Field inventory and page geometry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateInspection'
        '409':
          description: >-
            The file is still uploading — `{ error: { code: "file_not_ready" }
            }`.
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: >-
            The file is not a PDF in this space — `{ error: { code:
            "file_ineligible" } }`.
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fileId:
                  type: string
                  description: The template PDF to inspect.
                spaceId:
                  type: string
                  description: >-
                    Space the file lives in. Omit for an organization-level
                    template (`parentType: organization`).
              required:
                - fileId
servers:
  - url: https://api.cloudraker.com
    description: Production
  - url: https://api.staging.raker.one
    description: Staging
  - url: https://api.dev.raker.one
    description: Development
components:
  schemas:
    TemplateFieldType:
      type: string
      enum:
        - text
        - checkbox
        - radio
        - dropdown
        - listbox
      title: TemplateFieldType
    TemplateFieldBox:
      type: object
      properties:
        x:
          type: number
          format: double
        'y':
          type: number
          format: double
        w:
          type: number
          format: double
        h:
          type: number
          format: double
      required:
        - x
        - 'y'
        - w
        - h
      description: Widget box in points, origin top-left.
      title: TemplateFieldBox
    TemplateField:
      type: object
      properties:
        name:
          type: string
          description: AcroForm field name.
        type:
          $ref: '#/components/schemas/TemplateFieldType'
        label:
          type:
            - string
            - 'null'
          description: >-
            Human label — the /TU tooltip, or an inferred one for a detected
            field.
        section:
          type: string
          description: Heading path the field sits under.
        ignore:
          type: boolean
          description: Curated as not-fillable. Present only on a setup inventory.
        hint:
          type: string
          description: Curated guidance shown to the drafter.
        required:
          type: boolean
        options:
          type: array
          items:
            type: string
          description: Choice options (radio, dropdown, listbox).
        maxLength:
          type: integer
          description: Text length cap; 0 or absent = unbounded.
        multiline:
          type: boolean
        page:
          type: integer
          description: 0-based page the field sits on.
        order:
          type: integer
          description: Reading-order rank within the form.
        box:
          $ref: '#/components/schemas/TemplateFieldBox'
          description: Widget box in points, origin top-left.
      required:
        - name
        - type
        - label
        - required
        - page
        - order
      title: TemplateField
    TemplateInspectionPageBoxesItems:
      type: object
      properties:
        width:
          type: number
          format: double
        height:
          type: number
          format: double
      required:
        - width
        - height
      title: TemplateInspectionPageBoxesItems
    TemplateInspection:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/TemplateField'
        pageBoxes:
          type: array
          items:
            $ref: '#/components/schemas/TemplateInspectionPageBoxesItems'
          description: Page size in points, one entry per page.
        pageCount:
          type: integer
        detected:
          type: boolean
          description: >-
            True when the fields were detected rather than read from an existing
            AcroForm.
      required:
        - fields
        - pageBoxes
        - pageCount
        - detected
      title: TemplateInspection
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "fileId": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890"
}
```

**Response**

```json
{
  "fields": [
    {
      "name": "topmostSubform[0].policyHolderName",
      "type": "text",
      "label": "Policy Holder Name",
      "required": true,
      "page": 0,
      "order": 1,
      "section": "Coverages ▸ General Liability",
      "ignore": false,
      "hint": "Enter the full legal name of the policy holder",
      "options": [],
      "maxLength": 100,
      "multiline": false,
      "box": {
        "x": 72,
        "y": 144,
        "w": 300,
        "h": 20
      }
    }
  ],
  "pageBoxes": [
    {
      "width": 612,
      "height": 792
    }
  ],
  "pageCount": 1,
  "detected": true
}
```

**SDK Code**

```python
import requests

url = "https://api.cloudraker.com/actions/id/template/inspect"

payload = { "fileId": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.cloudraker.com/actions/id/template/inspect';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"fileId":"a1b2c3d4-e5f6-7890-ab12-cd34ef567890"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.cloudraker.com/actions/id/template/inspect"

	payload := strings.NewReader("{\n  \"fileId\": \"a1b2c3d4-e5f6-7890-ab12-cd34ef567890\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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/actions/id/template/inspect")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fileId\": \"a1b2c3d4-e5f6-7890-ab12-cd34ef567890\"\n}"

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/actions/id/template/inspect")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fileId\": \"a1b2c3d4-e5f6-7890-ab12-cd34ef567890\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.cloudraker.com/actions/id/template/inspect', [
  'body' => '{
  "fileId": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.cloudraker.com/actions/id/template/inspect");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"fileId\": \"a1b2c3d4-e5f6-7890-ab12-cd34ef567890\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["fileId": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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

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()
```