Skip to main content

AI-to-AI Integration

Your AI agent can use SuperDocs as a document editing tool. No browser, no frontend — just API calls. Your AI decides what to edit, SuperDocs executes.

How it works

1

Your AI agent sends a message and document HTML to SuperDocs

2

SuperDocs AI edits the document and returns updated HTML

3

Your agent reads the response and decides the next action

4

Repeat — send the updated HTML back with the next instruction

This creates a loop: your AI agent controls what to edit, SuperDocs handles how to edit it.

Example: Autonomous document workflow

Session persistence

Use the same session_id across calls. SuperDocs remembers the full conversation, so your agent can reference previous changes:

Undoing a step

If your agent realizes one of its earlier edits was wrong, it can rewind the session instead of trying to patch the result forward. Call POST /v1/sessions/{session_id}/revert with the turn_index of the user message you want to undo:
The agent receives the document state from before that turn plus the original message text, rewrites the instruction more carefully, and re-sends. The original conversation is preserved for audit but hidden from active reads. Returns 409 if a chat job is currently running on the same session — wait for it to settle first. See Revert a session to a previous message.

With MCP

If your AI agent supports MCP (like Claude), connect it directly to SuperDocs. See MCP Setup for setup. The AI agent gets native access to all 38 SuperDocs tools — including revert_session_to_message — without writing any API client code.