POST/api/v1/ai/pages/{slug}/translate

Translate a page

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.

API token requiredOr edit secret10 per minute per IPMCP: translate_page

Guide: AI in pages

Code samples and Try it

Path parameters

#
  • slugstringRequired

    The document's address: the part after markdrop.in/.

Headers

#
  • X-Edit-Secretstring

    The document's edit secret (sk_…), for a document published without an account. See Edit key.

Request body

#

application/json, required

  • langstringRequired

    The language, in English: Spanish, Japanese, Chinese (Simplified) and so on. Check AI availability lists them. Up to 40 characters.

Responses

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