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.
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
Replace all occurrences of “2023” with “2024”
Content Addition
Content Addition
Add a new section titled “Risk Analysis” after the Executive Summary with
placeholder text
Formatting Changes
Formatting Changes
Make all section headings bold and increase font size to 16pt
Complex Edits
Complex Edits
In the financial table, update Q4 revenue to $2.5M and recalculate the total.
Also add a footnote explaining the increase.
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.

