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
FAQ
Why is my PDF not being edited?
Why is my PDF not being edited?
PDF editing only works with fillable forms. If your PDF doesn’t have form fields, the edit endpoint cannot modify it. Convert your PDF to include form fields or use a DOCX format instead.
Can I edit the same document multiple times?
Can I edit the same document multiple times?
Yes, but each edit operation creates a new document. You’ll need to use the output from one edit as input to the next edit operation.
How do I get access to the edit endpoint?
How do I get access to the edit endpoint?
The edit endpoint is currently in beta. Contact Reducto support to request access for your organization.
What's the difference between sync and async editing?
What's the difference between sync and async editing?
Synchronous editing returns the result immediately but may timeout for large documents. Asynchronous editing returns a job ID immediately and processes the document in the background.