Skip to main content
POST
Convert Document
Upload a document and get it back in another format, saved as a new asset. Use it when the file isn’t in Dreep yet, or when you want the converted file stored on its own. For documents you’ve already uploaded, you can also convert them by URL.

Word to PDF

Saving to a folder

With no folder given, the result is saved to the project’s default folder. Name one with folder (a path, created on demand), folderId (a UUID) or key (a full path that also names the file):
See Folders & Paths.

What converts to what

Anything else returns 400 with the formats that file can convert to. Converting a spreadsheet to csv exports its first sheet. To render one page of a PDF as an image, pass page:

Long conversions

The request waits for the result, up to two minutes. Most documents take a second or two and return 201. A very long document returns 202 with status: "processing". The asset already exists, and its url answers 202 until the conversion finishes, then serves the file. Poll the URL, as with video transformations.

Billing and limits

Each conversion counts toward your plan’s monthly document conversions: Free 100, Starter 2,000, Pro 10,000. Once those are used, conversions come from a +1,000 add-on pack ($4.99). If the same document was already converted the same way through its fetch URL, that result is reused for free. Going over a limit returns 402 with code: "LIMIT_EXCEEDED" and featureKey: "document_conversions_monthly". The saved result also counts toward your storage, so a full storage quota returns 402 too. A conversion only counts once the result is stored, so a failed request costs nothing.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

The document to convert. Word (doc, docx, odt, rtf), Excel (xls, xlsx, ods, csv), PowerPoint (ppt, pptx, odp) or PDF.

format
enum<string>
required

The format to convert to. Documents convert within their own family (a spreadsheet can't become a Word document); PDFs convert to docx, png or jpeg.

Available options:
pdf,
docx,
odt,
rtf,
xlsx,
ods,
csv,
pptx,
odp,
png,
jpeg
page
integer

Only when converting a PDF to png or jpeg: which page to render as the image (page 1 if omitted). Leave it out for every other format - those always include all pages.

Required range: x >= 1
folder
string

Slug path of the folder to save the result into, relative to the project root. Missing folders are created.

Example:

"contracts/pdf"

folderId
string<uuid>

UUID of an existing folder to save the result into. Mutually exclusive with folder.

key
string

Full storage path for the result, e.g. contracts/pdf/acme. The folder part is created like folder; the last segment names the file.

autoCreateFolders
enum<string>
default:true

Set to false to require that folder already exists.

Available options:
true,
false

Response

Document converted and saved

asset
object

The saved result.