Edit
Edit Overview
Understanding Reducto’s Edit endpoint for document modification
Edit is used to modify documents by applying instructions to either fill forms (PDF) or insert/modify content (DOCX). The edit endpoint is currently in beta and available only to whitelisted organizations.
Key Features
The edit endpoint supports two different document types with distinct capabilities:
DOCX Editing
- AI-powered content insertion: Uses intelligent agents to insert content at specific markers
- Table cell editing: Modify existing table cells or add content to empty cells
- Text snippets: Reusable text snippets that can be referenced throughout the document
- Custom highlighting: Configurable highlight colors for edited content
- Instruction-based editing: Natural language instructions for content modifications
PDF Editing
- Form filling: Automatically detects and fills form fields
- Vision-based field detection: Uses computer vision to identify form elements
- Multi-field support: Handles text fields, checkboxes, radio buttons, and dropdowns
- Intelligent field mapping: Maps instructions to appropriate form fields
Configuration
EditConfig Parameters
The edit endpoint uses the EditConfig
class with the following parameters:
document_url
: The document to edit (public URL, presigned S3 URL, or reducto:// URL)edit_instructions
: Natural language instructions describing the desired editssnippets
: Array of reusable text snippets (DOCX only)edit_options
: Configuration options including highlight color and LLM provider preferencepriority
: Whether to use priority processing (default: true for sync, false for async)
EditOptions
color
: Hex color code for highlighting edits (default: “#FF0000”)llm_provider_preference
: Choose between “openai” or “anthropic” (internal use)
Usage Examples
Synchronous DOCX Editing
Asynchronous PDF Form Filling
Response Format
Synchronous Response (EditResponse)
Asynchronous Response (AsyncEditResponse)
Limitations and Considerations
DOCX Limitations
- Requires documents with proper structure for marker-based insertion
- Complex formatting may not be preserved in all cases
- Large documents may take longer to process
PDF Limitations
- Only works with fillable PDF forms
- Snippets are not supported for PDF editing
- Scanned PDFs without form fields cannot be edited
- Complex form layouts may not be detected accurately
General Limitations
- Beta access required (contact support for access)
- File size limits apply (check your plan limits)
- Processing time varies based on document complexity
- Only DOCX and PDF formats are supported
Error Handling
Common error scenarios:
- 401 Unauthorized: Invalid or missing API key
- 403 Forbidden: Organization not whitelisted for beta access
- 400 Bad Request: Unsupported file format, invalid configuration, no widgets found in PDF, or no pages with widgets found
- 500 Internal Server Error: Processing failure or timeout
Beta Access
The edit endpoint is currently in beta and restricted to specific organizations:
- Reducto AI
- Vanta
- Vanta Staging
Contact support to request beta access for your organization.
Best Practices
- Clear instructions: Provide specific, actionable edit instructions
- Use snippets: For DOCX editing, use snippets for repeated content
- Test with samples: Start with simple documents to understand capabilities
- Handle errors: Implement proper error handling for production use
- Async for large files: Use async processing for larger documents
- Validate forms: For PDFs, ensure forms are properly fillable before editing