# Fill a scanned, non-fillable PDF form with an API

> Fill a scanned PDF form that has no fillable fields using the Reducto Edit API and plain-language instructions. Returns a filled PDF and the detected fields.

Canonical: https://reducto.ai/cookbooks/fill-scanned-pdf-form

Send the scanned form to Reducto Edit with the values in plain language, such as "Legal business name: Quillstone Partners LLC". Edit finds the blank fields on the page, writes each value in place and returns a link to the filled PDF plus the list of fields it detected and filled. It works on flat scans with no form fields.

## What you'll build

Synthetic scanned vendor setup form (or your own file)

- Upload the scanned form or pass a public URL.
- Write the values as label: value pairs in edit_instructions.
- Call /edit and download the filled PDF from document_url.
- Save form_schema from the response and pass it next time to skip detection.

## Setup

Grab an API key from <a href="https://studio.reducto.ai" rel="noopener noreferrer" target="_blank">studio.reducto.ai</a> -> API Keys -> Create new API key, then set it and install the SDK:

```bash
export REDUCTO_API_KEY="your-api-key-here"
pip install reductoai   # or: npm install reductoai
```

## Step 1: Call `/edit`

The options that matter for this job:

- `document_url`: The form to fill.
- `edit_instructions`: The values to write, in plain language.
- `form_schema`: Reuse the detected fields on later runs for speed and consistency.

```python
# pip install reductoai
from pathlib import Path
from reducto import Reducto

client = Reducto()  # reads REDUCTO_API_KEY

upload = client.upload(file=Path("vendor-form.pdf"))
result = client.edit.run(
    document_url=upload.file_id,
    edit_instructions="Legal business name: Quillstone Partners LLC. Tax ID: 00-0000000. Street address: 18 Ferry Slip Rd. City / State / ZIP: Elmstead, ST 00000. Primary contact name: Noor Haddad. Contact phone: (555) 010-4482. Contact email: ap@quillstone.example. Remittance email: remit@quillstone.example. Business type: LLC. Date: 2026-11-15.",
)
print(result)
```

```javascript
// npm install reductoai

const client = new Reducto(); // reads REDUCTO_API_KEY

const upload = await client.upload({ file: fs.createReadStream("vendor-form.pdf") });
const result = await client.edit.run({
  document_url: upload.file_id,
  edit_instructions: "Legal business name: Quillstone Partners LLC. Tax ID: 00-0000000. Street address: 18 Ferry Slip Rd. City / State / ZIP: Elmstead, ST 00000. Primary contact name: Noor Haddad. Contact phone: (555) 010-4482. Contact email: ap@quillstone.example. Remittance email: remit@quillstone.example. Business type: LLC. Date: 2026-11-15.",
});
console.log(JSON.stringify(result, null, 2));
```

Or with curl:

```bash
# 1. Upload the file (or pass a public URL as "document_url" and skip this step)
curl -s https://platform.reducto.ai/upload \
  -H "Authorization: Bearer $REDUCTO_API_KEY" \
  -F file=@vendor-form.pdf
# => {"file_id": "reducto://..."}

# 2. Run edit
curl -s https://platform.reducto.ai/edit \
  -H "Authorization: Bearer $REDUCTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "document_url": "reducto://FILE_ID",
  "edit_instructions": "Legal business name: Quillstone Partners LLC. Tax ID: 00-0000000. Street address: 18 Ferry Slip Rd. City / State / ZIP: Elmstead, ST 00000. Primary contact name: Noor Haddad. Contact phone: (555) 010-4482. Contact email: ap@quillstone.example. Remittance email: remit@quillstone.example. Business type: LLC. Date: 2026-11-15."
}'
```

## Step 2: Read the result

On the sample (a synthetic scanned vendor setup form), the job-specific part of the response:

```json
{"description": "Legal business name", "value": "Quillstone Partners LLC"}
{"description": "Tax ID (EIN)", "value": "00-0000000"}
{"description": "Street address", "value": "18 Ferry Slip Rd"}
{"description": "City / State / ZIP", "value": "Elmstead, ST 00000"}
{"description": "Primary contact name", "value": "Noor Haddad"}
```

Edit found the fields on a scanned page with no form layer and wrote each value in place. `document_url` in the response is the filled PDF.

[Full response format ->](https://docs.reducto.ai/editing/edit-overview#response)

## When to use something else

- **Edit**: to fill scanned or flat forms from data you already have.
- **Extract**: to read values off a form that is already filled in.

## Where this goes next

- [Edit docs](https://docs.reducto.ai/editing/edit-overview.md)
- [Reducto Edit](/edit)
- [Handwritten form to JSON](/cookbooks/reducto-extract-handwritten-property-loss-forms)
