---
search:
  tags:
    - Documents
    - POST
seo:
  description: >-
    Convert a base64-encoded DOCX, XLSX, PPTX, ODF, EPUB, RTF, CSV, HTML or text
    file… Reference for the POST /v1/documents/convert endpoint in the Webfold
    API.
sidebar:
  label: Convert a document to Markdown
  badge: POST
title: Convert a document to Markdown
type: openapi-operation
---
Convert a base64-encoded DOCX, XLSX, PPTX, ODF, EPUB, RTF, CSV, HTML or text file to Markdown with the Webfold document engine. The file travels in the request; the server never fetches a URL for this endpoint. Up to 25 MiB decoded. Metered as `documents.convert`. Set `format` or send a `filename` with a supported extension.

`POST /v1/documents/convert`

**Request body** (`application/json`, required)

- `content_base64` (string, required) — The file, base64 (standard alphabet). Up to 25 MiB decoded.
- `filename` (string) — Used to infer the format from its extension.
- `format` (string) — Overrides the extension in \`filename\`.

Request body example:

```json
{
  "content_base64": "string",
  "filename": "report.docx",
  "format": "docx"
}
```

**Responses**

- `200` — The document as Markdown
- `400` — Bad request
- `401` — Missing or invalid bearer token
- `403` — Billing or plan entitlement blocked the request

Response example, 200:

```json
{
  "format": "string",
  "bytes": 0,
  "characters": 0,
  "markdown": "string"
}
```
