Document Processing
Transform entire HTML documents with free-form AI instructions — no editor instance, no streaming, no conversation state.
Send a document and a natural-language prompt to a single REST endpoint. The API returns the modified document and a summary of what changed as synchronous JSON. Built for server-side integrations, content pipelines, and backend automation.
This feature is experimental and may be changed or removed in future versions.
The endpoint accepts two fields:
document– The HTML content to process.prompt– A natural language instruction describing the desired change.
The AI applies the instruction and returns:
document– The complete modified HTML document.summary– A concise explanation of what was changed and why.
The response preserves HTML structure, attributes and CSS classes unless the instruction explicitly
requires modifying them.
Document Processing is designed for server-side workflows where content flows through your systems without a user in an editor:
- CMS publish hooks — fix grammar or adjust tone before content goes live
- Sequential processing — apply the same instruction to contracts, policies, or templates one document at a time
- Pipeline steps — translate or summarize as one step in a larger workflow
- SaaS personalization — adapt templates before delivering to end users
- AI agent tooling — expose as a tool in your own AI agents or MCP servers
POST /v1/documents/process
Content-Type: application/json
Authorization: Bearer <your-token>
{
"document": "<p>The norhtern lights dence across the polar skies, painting ribbons of green and purple light that ripple like a cosmic
curtain.</p>",
"prompt": "Fix all grammar and spelling errors"
}
For complete endpoint documentation, request/response schemas, authentication details, and error codes, see:
- Document processing API Reference – Full documentation for the document processing endpoint.
- Complete API Documentation – Interactive API reference with all CKEditor AI endpoints.
- Actions – Transform content with predefined or custom operations.
- Reviews – Analyze documents and get per-element improvement suggestions.
- Conversations – Interactive discussions with document context.