Sign up (with export icon)

Document Processing

Show the table of contents

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.

Note

This feature is experimental and may be changed or removed in future versions.

How It Works

Copy link

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.

When to use this

Copy link

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

API Example

Copy link
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"
}
Copy code

API Reference

Copy link

For complete endpoint documentation, request/response schemas, authentication details, and error codes, see:

Copy link
  • Actions – Transform content with predefined or custom operations.
  • Reviews – Analyze documents and get per-element improvement suggestions.
  • Conversations – Interactive discussions with document context.