Clear Form
Overview
FormResult synchronously by default. Set async: true to run in the background and poll GET /job/jobId for the result./form/clear strips handwritten entries, typed responses, and selected checkbox marks from a PDF without altering the blank template underneath.
instructions is optional:
- Omit to clear every user-filled value on the form.
- Provide a natural-language prompt (for example
"clear only the address fields") to scope the clear to specific fields.
Providing the PDF
Provide the PDF in exactly one of the following ways:form_id: chain off a prior/form/detect,/form/fill, or/form/clearcall. The cached PDF andform_fieldsare reused, so there is no need to re-upload.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 3 credits per page of the PDF being cleared. 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 | Reuse a previously processed form. Skips re-upload and re-detection. |
file_url | string (uri) | One of these | Public or presigned URL of a PDF to download and clear. |
file | binary | One of these | PDF uploaded inline with the request. |
instructions | string | No | Optional natural-language scoping prompt. When omitted, every user-filled value is cleared and the printed template is preserved. |
form_fields | array of FormCell | No | Optional override for the cells used when clearing. |
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
Mirrors the /form/fill response, with fields_cleared substituted for fields_filled.
| Field | Type | Description |
|---|---|---|
form_id | string (uuid) | ID of the new form record produced by this run. Pass back via form_id to chain. |
page_count | integer | Number of pages in the output PDF. |
pdf_url | string (uri) | URL to download the cleared 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 of the resulting (cleared) PDF, refreshed after the clear. |
fields_cleared | integer | Number of cells whose value actually changed during this run. Fields that were already empty are not counted, so on an empty template this returns 0 even when many fields exist. |
credits_used | number | Credits consumed by this request (3 × page_count). |
plan_info | object | { tier, total_credits_used, pages_used } cumulative billing snapshot for your organization (post-request). |
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 | Cleared FormResult returned synchronously. |
| 202 | Async job accepted (async: true). Poll /job/{jobId} for the result. |
| 400 | Missing PDF, more than one PDF source provided, or malformed form_fields. |
| 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
Clear All User Input
Scoped Clear
Passinstructions to clear only specific fields.
Chain Fill, Clear, Fill
Clear an existing filled form and immediately re-fill it with new values without re-uploading the PDF. Theform_id returned by each step is the hand-off.
Async Clear With Polling
Authorizations
API key for authentication
Body
JSON body for POST /form/clear. 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.
Optional override for the cells used when filling or clearing.
When omitted, Pulse uses the cells stored on the referenced
form_id, or detects them from the uploaded PDF.
ID returned by a previous /form/detect, /form/fill, or
/form/clear call. Reuses the stored PDF without re-uploading.
Public or presigned URL of a PDF to download and clear.
Optional natural-language description of what to clear. When omitted, every user-filled value is cleared while the printed template is preserved.
"Clear only the signature and date fields."
Response
Cleared FormResult 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.
