Documents
Send your document HTML indocument_html. The AI reads it, makes changes, and returns updated HTML in document_changes.updated_html.
The one rule: Render the returned HTML as-is in your editor. When sending it back on the next request, send the full document HTML exactly as your editor has it. Don’t programmatically strip, modify, or reformat the HTML. If your editor or HTML sanitizer removes custom data-* attributes, configure it to preserve them.
Example flow
data-chunk-id attributes on elements. These identify document sections and enable the AI to make targeted edits without reprocessing the entire document. These same IDs appear in API responses — for example, chunk_id and insert_after_chunk_id in HITL proposed changes.
