rewrite

Rewrite

Rewrite selected text within the context of a full text.

This endpoint is designed to work with Tiptap's AI Changes extension:

  1. User selects text in the editor
  2. Editor calls this API with selected text + full text context
  3. API returns rewritten text
  4. Tiptap tracks changes and allows accept/reject workflow

The rewriting considers the full text context to maintain consistency and coherence with the surrounding content.

post/v2/rewrite/

Request

  • Base URL
    https://api.mentium.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Headers

mentium-workspace-idstring nullable

Request body

full_text_with_embedded_selectionstring required

The full text with embedded selection

rewrite_instructions_for_selectionstring required

The rewrite instructions for the selection

Response

Successful Response

rewritten_selectionstring required

The rewritten selection

Changes

No recorded changes to this operation across all 2 revisions of this API.