Edit a Document
Apply AI-powered edits to your document using natural language instructions. The API uses advanced language models to understand your intent and make precise edits to the document.Path Parameters
The unique identifier of the document to edit (UUID from upload response)
Request Body
Client-provided UUID for idempotency and tracking. Generate a new UUID for
each edit request.
Natural language instructions describing the edit to apply (e.g., “Change the
title to ‘Q4 Report’ and update all dates to 2024”)
Optional text excerpt to help locate the section to edit in longer documents.
Use this to pinpoint the exact location for the edit.
Apply changes as tracked changes (like Word’s track changes). Currently
disabled.
Use a larger, more capable model for complex edits. Default is false.
Response
The UUID of the edit operation (same as request)
Whether the edit was successfully applied
Time taken to process the edit in seconds
Name of the edited document
UUID of the edited document
Code Examples
Example Response
Edit Instructions Best Practices
Be specific and clear: The more specific your instructions, the better the results.
- ✅ Good: “Change the company name from ‘Acme Corp’ to ‘Global Industries Inc.’ in the header”
- ❌ Vague: “Update the company info”
Examples of Edit Instructions
Text Replacement
Text Replacement
Content Addition
Content Addition
Formatting Changes
Formatting Changes
Complex Edits
Complex Edits
Using lookupText for Long Documents
For documents longer than a few pages, uselookupText
to help the AI locate the correct section:
Sequential Edits
All edits to the same document are queued and processed sequentially. Each edit waits for the previous one to complete:Error Responses
The document’s TTL (time to live) is automatically refreshed after each
successful edit.