---
title: "Translate a page"
description: "Translates a page you can edit into lang as a new page next to it, titled with the language's name, with the same blocks, embeds and properties."
canonical_url: https://docs.markdrop.in/api/page-ai/translate-a-page
last_updated: 2026-11-04
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Translate a page

`POST https://api.markdrop.in/api/v1/ai/pages/{slug}/translate`

Translates a page you can edit into `lang` as a new page next to it, titled with the language's name, with the same blocks, embeds and properties. The original doesn't change. Returns the new page's `slug`, `url` and `title`; send `Accept: text/event-stream` to get `progress` events while it works.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 10 per minute per IP address.
- **MCP tool:** `translate_page` ([tools](https://docs.markdrop.in/ai/tools))
- **Guide:** [AI in pages](https://docs.markdrop.in/pages/ai)

## Path parameters

- `slug` (string, required): The document's address: the part after `markdrop.in/`.

## Headers

- `X-Edit-Secret` (string): The document's edit secret (`sk_…`), for a document published without an account. See [Edit key](https://docs.markdrop.in/documents/edit-key).

## Request body

`application/json`, required.

- `lang` (string, required): The language, in English: `Spanish`, `Japanese`, `Chinese (Simplified)` and so on. [Check AI availability](https://docs.markdrop.in/api/page-ai/check-ai-availability) lists them. Up to 40 characters.

## Responses

- `200`: OK.
- `401`: No token, or the token is revoked or mistyped.
- `422`: The request didn't validate. `detail` lists each problem, with where it is (`loc`) and why (`msg`).
- `429`: Too many requests from your IP address. Wait the seconds in `Retry-After`.

## Examples

**curl**

```bash
curl -X POST https://api.markdrop.in/api/v1/ai/pages/k3x9q2m/translate \
  -H "Authorization: Bearer $MARKDROP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"lang":"Spanish"}'
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/ai/pages/k3x9q2m/translate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "lang": "Spanish"
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

r = requests.post(
    "https://api.markdrop.in/api/v1/ai/pages/k3x9q2m/translate",
    headers={"Authorization": f"Bearer {os.environ['MARKDROP_TOKEN']}"},
    json={"lang": "Spanish"},
)
r.raise_for_status()
print(r.json())
```
