---
title: "Convert ODT files via REST API"
description: "Learn how to handle ODT files (OpenDocument Text) in a Tiptap editor, including in-editor import/export and REST API usage."
---

> [Tiptap Editor 3.0 is out. Start here](https://tiptap.dev/docs/resources/whats-new.md)

# Convert ODT files via REST API

Learn how to handle ODT files (OpenDocument Text) in a Tiptap editor, including in-editor import/export and REST API usage.

Tags: Available in Start plan, Beta

## Requirements

**1. Activate trial or subscribe**

Start a [free trial](https://cloud.tiptap.dev/v2?trial=true) or [subscribe to the Start plan](https://cloud.tiptap.dev/v2/billing) in your account.

**2. Configure Convert app**

In case you want to integrate the REST API retrieve your App ID and Convert secret from [your dashboard](https://cloud.tiptap.dev/v2/cloud/convert).

**3. Install from private registry**

To install the frontend extensions, authenticate to Tiptap’s private npm registry by following the [setup guide](https://tiptap.dev/docs/v2/guides/pro-extensions.md).

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

> **Review the postman collection**
>
> You can also experiment with the Document Conversion API by heading over to our [Postman
> Collection](https://www.postman.com/docking-module-explorer-14290287/workspace/tiptap-collaboration-public/collection/33042171-cc186a66-df41-4df8-9c6e-e91b20deffe5?action=share&creator=32651125).

## Import API endpoint
`POST /import`

The `/import` endpoint enables the conversion of `ODT` files into Tiptap’s JSON format. Users can POST documents to this endpoint.

### Example (cURL)
 ```bash
 curl -X POST "https://api.tiptap.dev/v1/convert/import" \
   -H "Authorization: Bearer <your-jwt-token>" \
   -H "X-App-Id: <your-app-id>" \
   -F "file=@/path/to/document.odt"
 ```
In this example, the request uploads an ODT file

### Required headers

| Name            | Description                                                                                                                                     |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `Authorization` | The JWT token to authenticate the request. Example: `Bearer your-jwt-token`                                                                     |
| `X-App-Id`      | The Convert App-ID from the Collaboration settings page: [https://cloud.tiptap.dev/convert-settings](https://cloud.tiptap.dev/convert-settings) |

### Body

| Name                     | Type     | Description                                                                                                                  |
| ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `file`                   | `File`   | The file to convert                                                                                                          |
| `imageUploadCallbackUrl` | `string` | The callback endpoint to upload images that were encountered within the uploaded document, [see more info](#image-uploading) |

## Export API endpoint
`POST /export`

The `/export` endpoint converts Tiptap documents back into the `docx` format.

### Required headers

| Name            | Description                                                                                                                                     |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `Authorization` | The JWT token to authenticate the request. Example: `Bearer your-jwt-token`                                                                     |
| `X-App-Id`      | The Convert App-ID from the Collaboration settings page: [https://cloud.tiptap.dev/convert-settings](https://cloud.tiptap.dev/convert-settings) |

### Body

| Name      | Type     | Description                                |
|-----------|----------|--------------------------------------------|
| `content` | `Object` | The Tiptap document                        |
| `format`  | `string` | The format to convert to, should be `odt` |
