Detect Form Fields
Overview
form_id. Returns a FormResult synchronously by default. Set async: true to run in the background and poll GET /job/jobId for the result./form/detect is the entry point for the form-filler workflow when you want to inspect the fields Pulse identified on a PDF before filling or clearing them. Use it to preview detected fields, fix a misclassified cell, see which checkboxes are currently selected, or cache the detection result for repeated chained calls.
The returned form_id references the uploaded PDF and its detected layout, and can be passed back to any of /form/detect, /form/fill, or /form/clear as the single input source. Pulse will reuse the cached layout instead of re-detecting it.
Providing the PDF
Provide the PDF in exactly one of the following ways:form_id: re-detect on a previously stored PDF (returned by an earlier/form/detect,/form/fill, or/form/clearcall). Useful when chaining detect calls or refreshing layout after edits.file_url: public or presigned URL to a PDF.file: PDF uploaded inline with the request.
400.
multipart/form-data request body — that’s how the SDKs send every call. JSON bodies (Content-Type: application/json) with form_id or file_url are still accepted server-side for backward compatibility, but the SDKs only model the multipart form.Pricing
Billed at 1 credit per page of the PDF being processed. Every response also returns a top-levelcredits_used for this request and a cumulative plan_info.total_credits_used snapshot for your organization.
Request
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
form_id | string (uuid) | One of these | Re-detect on a previously stored PDF. |
file_url | string (uri) | One of these | Public or presigned URL of a PDF. |
file | binary | One of these | PDF uploaded inline with the request. |
page_range | string | No | 1-based page filter, for example "1,3-5". Alias pages accepted. |
async | boolean | No | When true, returns { job_id, status: "pending" } immediately (HTTP 202) and processes the job in the background. Default false. |
Response
Sync (200): FormResult
When async is false (default), the call returns a FormResult body directly. Since /form/detect does not modify the PDF, neither fields_filled nor fields_cleared is present.
| Field | Type | Description |
|---|---|---|
form_id | string (uuid) | ID of the form record produced by this run. Pass to a subsequent /form/detect, /form/fill, or /form/clear call. |
page_count | integer | Number of pages in the PDF. |
pdf_url | string (uri) | URL to download the (unmodified) PDF binary. Always points at GET /results/jobId/pdf. Requires the same auth as the rest of the API. |
form_fields | array of FormCell | Detected cells. Each carries a normalized bounding_box, a type (text / checkbox / signature), the current text content, and for checkbox cells a checkbox_details[] array with per-box center coordinates, selection state, and labels. |
credits_used | number | Credits consumed by this request (1 × page_count). |
plan_info | object | { tier, total_credits_used, pages_used } cumulative billing snapshot for your organization (post-request). |
bounding_box, checkbox_details[].center_coord) are normalized to [0, 1] with a top-left origin. Multiply by your render width / height to convert to pixel coordinates.Async (202): FormJobAccepted
When async is true:
result carries the same FormResult shape that the sync flow would have returned inline.
Status Codes
| Code | Description |
|---|---|
| 200 | Detected layout returned synchronously. |
| 202 | Async job accepted (async: true). Poll /job/{jobId} for the result. |
| 400 | Missing PDF or more than one PDF source provided. |
| 401 | Authentication failed or missing API key. |
| 404 | Referenced form_id not found (or belongs to a different org). |
| 500 | Internal server error. |
Example Usage
Detect From URL
File Upload
Detect, Edit, Then Fill
Detect the cells once, hand-edit any that were misclassified, and pass the edited cells back to/form/fill along with the cached form_id. The fill call reuses the cached layout instead of re-detecting it.
Re-detect On A Stored Form
Passform_id (instead of file_url / file) to refresh the layout on a PDF already stored by Pulse. Useful after a /form/clear round-trip, or to grab the latest cells if you suspect drift.
Authorizations
API key for authentication
Body
JSON body for POST /form/detect. Provide exactly one of form_id
or file_url (or use the multipart variant to upload a file).
Restrict the operation to a subset of pages. Accepts
comma-separated page numbers and ranges, e.g. "1-3,5".
Alias: pages.
When true, the endpoint returns immediately with
{ job_id, status: "pending" } (HTTP 202) and processes the
job in the background. Poll GET /job/{jobId} for the result.
Re-detect cells on a previously stored PDF. Useful when chaining detect calls or refreshing layout after edits.
Public or presigned URL of a PDF to detect cells on.
Response
Detected layout returned synchronously.
Result body returned by /form/detect, /form/fill, and
/form/clear. For async jobs (async: true) the same shape is
served back under result on GET /job/{jobId}.
ID of the form record produced by this run. Pass to a subsequent
/form/detect, /form/fill, or /form/clear call as the single
input source to iterate without re-uploading the PDF.
Number of pages in the output PDF.
x >= 1Detected cells of the resulting PDF (refreshed from the
filled / cleared output for fill / clear, or freshly detected for
/form/detect).
URL to download the resulting PDF binary. Always points at
GET /results/{jobId}/pdf for the originating job. Requires the
same authentication (API key or JWT) as the rest of the API.
Number of cells whose value actually changed during this run.
Present on /form/fill responses only.
x >= 0Number of cells whose value actually changed during this run
(no-op clears on already-empty fields are not counted).
Present on /form/clear responses only.
x >= 0Credits consumed by this request. Detect charges 1 credit per page; fill and clear charge 3 credits per page.
Billing tier and cumulative usage information for the calling org, including this form run.
