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
- 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 theEditConfig
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 editsedit_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”). This is only available for DOCX files.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
- Densely packed form layouts may not be detected accurately
General limitations
- 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
- 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
Best practices
- Clear instructions: Provide specific, actionable edit instructions
- 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
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 generally available. You can start using it with your existing API key.
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.