Edit Document
API Reference
Edit Document
Apply AI-powered edits to a document using natural language instructions
POST
Edit Document
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
string
required
The unique identifier of the document to edit (UUID from upload response)
Request Body
string
required
Client-provided UUID for idempotency and tracking. Generate a new UUID for
each edit request.
string
required
Natural language instructions describing the edit to apply (e.g., “Change the
title to ‘Q4 Report’ and update all dates to 2024”)
string
Optional text excerpt to help locate the section to edit in longer documents.
Use this to pinpoint the exact location for the edit.
boolean
Use a larger, more capable model for complex edits. Default is false.
Response
string
required
The UUID of the edit operation (same as request)
boolean
required
Whether the edit was successfully applied
number
required
Time taken to process the edit in seconds
string
required
Name of the edited document
string
required
UUID of the edited document
Code Examples
Example Response
Edit Instructions Best Practices
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.

