Document conversion API

Beta

This feature is currently in beta and available to all users with a Tiptap account.

The document conversion API supports DOCX, ODT, and Markdown conversion from and to Tiptap’s JSON format.

The following demo uses the Document Conversion API by integrating both the import and export extensions into the editor.

Review the postman collection

You can also experiment with the Document Conversion API by heading over to our Postman Collection.

Integrate into the editor

Tiptap offers editor extensions for importing and exporting documents. These extensions provide full access to the Document Conversion API. Instead of using the Document Conversion API directly, you can use Tiptap Editor's import and export extensions:

/import endpoint

The /import endpoint enables the conversion of docx, odt, or markdown files into Tiptap’s JSON format. Users can POST documents to this endpoint and use various parameters to customize how different document elements are handled during the conversion process.

  • Method: POST

Required headers

NameDescription
AuthorizationThe JWT token to authenticate the request. Example: Bearer your-jwt-token
X-App-IdThe Convert App-ID from the Collaboration settings page: https://cloud.tiptap.dev/convert-settings

Body

NameTypeDescription
fileFileThe file to convert

Query parameters

Specify how source document elements are mapped to ProseMirror nodes or marks, and adjust the conversion to meet your specific styling and structural preferences.

NameDefaultDescription
paragraphparagraphDefines which prosemirror type is used for paragraph conversion
headingheadingDefines which prosemirror type is used for heading conversion
blockquoteblockquoteDefines which prosemirror type is used for blockquote conversion
codeblockcodeblockDefines which prosemirror type is used for codeblock conversion
bulletlistbulletlistDefines which prosemirror type is used for bulletList conversion
orderedlistorderedlistDefines which prosemirror type is used for orderedList conversion
listitemlistitemDefines which prosemirror type is used for listItem conversion
hardbreakhardbreakDefines which prosemirror type is used for hardbreak conversion
horizontalrulehorizontalruleDefines which prosemirror type is used for horizontalRule conversion
tabletableDefines which prosemirror type is used for table conversion
tablecelltablecellDefines which prosemirror type is used for tableCell conversion
tableheadertableheaderDefines which prosemirror type is used for tableHeader conversion
tablerowtablerowDefines which prosemirror type is used for tableRow conversion
boldboldDefines which prosemirror mark is used for bold conversion
italicitalicDefines which prosemirror mark is used for italic conversion
underlineunderlineDefines which prosemirror mark is used for underline conversion
strikethroughstrikeDefines which prosemirror mark is used for strikethrough conversion
linklinkDefines which prosemirror mark is used for link conversion
codecodeDefines which prosemirror mark is used for code conversion

/export endpoint

The /export endpoint converts Tiptap documents back into formats like docx, odt, or markdown.

  • Method: POST

Convert a Tiptap document to a different format.

Required headers

NameDescription
AuthorizationThe JWT token to authenticate the request. Example: Bearer your-jwt-token
X-App-IdThe Convert App-ID from the Collaboration settings page: https://cloud.tiptap.dev/convert-settings

Body

NameTypeDescription
contentObjectThe Tiptap document
formatstringThe format to convert to, can be docx, odt or markdown

Query parameters

NameDefaultDescription
gfm0Use Github Flavored Markdown for markdown export
paragraphparagraphDefines which prosemirror type is used for paragraph conversion
headingheadingDefines which prosemirror type is used for heading conversion
blockquoteblockquoteDefines which prosemirror type is used for blockquote conversion
codeblockcodeblockDefines which prosemirror type is used for codeblock conversion
bulletlistbulletlistDefines which prosemirror type is used for bulletList conversion
orderedlistorderedlistDefines which prosemirror type is used for orderedList conversion
listitemlistitemDefines which prosemirror type is used for listItem conversion
hardbreakhardbreakDefines which prosemirror type is used for hardbreak conversion
horizontalrulehorizontalruleDefines which prosemirror type is used for horizontalRule conversion
tabletableDefines which prosemirror type is used for table conversion
tablecelltablecellDefines which prosemirror type is used for tableCell conversion
tableheadertableheaderDefines which prosemirror type is used for tableHeader conversion
tablerowtablerowDefines which prosemirror type is used for tableRow conversion
boldboldDefines which prosemirror mark is used for bold conversion
italicitalicDefines which prosemirror mark is used for italic conversion
underlineunderlineDefines which prosemirror mark is used for underline conversion
strikethroughstrikeDefines which prosemirror mark is used for strikethrough conversion
linklinkDefines which prosemirror mark is used for link conversion
codecodeDefines which prosemirror mark is used for code conversion