Document Editing
Fill forms and edit documents with natural language instructions.
What is Document Editing?
Document editing detects fillable fields and fills them:
- Form fields (text, checkboxes, dropdowns)
- Signature blocks
- Date fields
- Any editable area
Use cases:
- Fill out PDF forms programmatically
- Auto-populate contracts with client data
- Update template documents
- Batch form filling
Editing Documents
From the Dashboard
- Go to Edit in the sidebar
- Select a document (PDF or image)
- DocLD detects fillable elements
- Fill using:
- Direct field mapping
- Natural language instructions
- Suggest — get AI-suggested values for fields
- Download the filled document
You can create edit projects to group runs by document and config, and use saved edit configs (per organization) to apply the same settings across runs. For multiple documents, use batch edit to apply one config to many forms. See the Edit API for projects, batch, configs, and suggest endpoints.
Using Natural Language
Describe what you want to fill:
Fill the client name as "Acme Corporation",
the date as "January 15, 2024",
and the contract amount as "$25,000"DocLD interprets your instructions and fills the appropriate fields.
Using Field Mappings
Map values directly to detected fields:
{
"mappings": {
"client_name": "Acme Corporation",
"contract_date": "January 15, 2024",
"amount": "$25,000",
"signature_required": true
}
}Detected Elements
DocLD detects various field types:
| Type | Description |
|---|---|
text_field | Text input boxes |
date_field | Date inputs |
number_field | Numeric inputs |
checkbox | Checkboxes |
radio | Radio button groups |
dropdown | Select/dropdown menus |
signature | Signature blocks |
Element Detection
Each detected element includes:
{
"id": "element-uuid",
"type": "text_field",
"label": "Client Name",
"page": 1,
"bbox": {
"x": 100,
"y": 200,
"width": 200,
"height": 25
},
"required": true,
"current_value": ""
}Two-Step Process
For complex forms, use the two-step process: detect elements first, then fill using the returned edit job ID (edit_job_id).
Step 1: Detect Elements
curl -X POST "/api/edit/detect" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"document_id": "form-uuid"}'Review detected elements and their labels. The response includes a job_id (use this as edit_job_id in the next step).
Step 2: Fill Elements
Pass edit_job_id from the detect response so the server uses the same detected elements. You can send mappings as an array (with elementId and value) or as an object keyed by field label or element ID:
curl -X POST "/api/edit/run" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"edit_job_id": "detect-job-uuid",
"mappings": {
"client_name": "Acme Corporation"
}
}'Configuration Options
Formatting
Control how filled values appear:
{
"config": {
"formatting_color": "#0000FF",
"font_size": 12,
"font_family": "Arial"
}
}Preservation
Keep original content:
{
"config": {
"preserve_original": true
}
}Supported Formats
| Format | Support Level |
|---|---|
| Full — form fields and free text | |
| Images (PNG, JPEG, HEIC, etc.) | Full — detection and fill |
Only PDF and image files are supported for detection and editing. See the Edit API for details.
Workflow Integration
Add editing to workflows:
{
"type": "edit",
"config": {
"instructions": "Fill with extracted data",
"mappings": {
"name": "{{extracted.name}}",
"date": "{{current_date}}"
}
}
}This enables automated form filling as part of processing pipelines.
Combining with Extraction
Powerful workflow: Extract → Edit
- Extract data from source document
- Edit template document with extracted values
# Step 1: Extract from source
curl -X POST "/api/extract/run" \
-d '{"document_id": "source-doc", "schema_id": "client-schema"}'
# Step 2: Fill template with extracted data
curl -X POST "/api/edit/run" \
-d '{
"document_id": "template-form",
"mappings": {
"client_name": "extracted_name_value",
"address": "extracted_address_value"
}
}'Best Practices
- Preview first - Detect elements before filling
- Verify mappings - Ensure fields match expected values
- Use clear labels - Match field labels for accurate filling
- Test with samples - Verify results before batch processing
- Keep originals - Preserve original documents
CLI Support
The DocLD CLI supports editing:
# Fill a single form
docld edit form.pdf -i "Fill client name as 'Acme Corp'"
# Batch editing
docld edit ./contracts -i "Replace 'OLD COMPANY' with 'NEW COMPANY'"API Reference
See the Edit API for programmatic access.