Skip to main content
POST
/
documents
/
translate
curl --request POST \ --url https://api.luminpdf.com/v1/documents/translate \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data ' { "document_id": "695dd6880d951f4de70a7c5d", "target_language": "vi" } '
{
  "signed_url": "https://files.luminpdf.com/download/translate-abc123?token=xyz789",
  "expires_at": 1755526530000,
  "output_format": "pdf",
  "detected_language": "en",
  "target_language": "vi",
  "document_name": "vi_rental_agreement.pdf",
  "page_count": 12,
  "remaining_requests": 17
}
When output_format is html, sanitize the returned content before injecting it into a DOM. Use a trusted HTML sanitizer such as DOMPurify to prevent XSS.
This endpoint requires the following scope:pdf:files

Authorizations

X-API-Key
string
header
required

Provide your API key in the X-API-Key header, e.g., X-API-Key: YOUR_API_KEY.

Body

application/json
target_language
string
required

ISO language code for the target language (e.g., vi, fr, ja, zh-hans). Supported codes: ar, bn, bg, ca, zh-hans, zh-hant, hr, cs, da, nl, en, et, fa, fi, fr, de, el, gu, he, hi, hu, id, it, ja, kn, ko, lv, lt, ms, ml, mr, no, pl, pt, ro, ru, sr, sk, sl, es, sw, sv, ta, te, th, tr, uk, ur, vi.

document_id
string

Lumin document ID of the PDF to translate. Required when file_url is not provided. Takes priority if both are provided.

To obtain a document ID, upload the file to Lumin first using Upload Document.

file_url
string<uri>

Publicly accessible URL of the PDF file to translate. Required when document_id is not provided. Ignored if document_id is also provided.

pages
string

Page range to translate. Accepts comma-separated pages and ranges (e.g., 1-10, 1,3,5-8). If omitted, all pages are translated (up to the 40-page limit).

output_format
enum<string>
default:pdf

Output file format.

Available options:
pdf,
html
document_name
string

Custom name for the translated file (without extension). Default is {target_language}_{original_name}.

Response

Returns a temporary download URL for the translated file.

signed_url
string<uri>
required

Temporary URL to download the translated file.

expires_at
integer<unix-epoch>
required

Unix epoch timestamp (in milliseconds) when the signed_url expires.

output_format
enum<string>
required

Format of the output file.

Available options:
pdf,
html
detected_language
string
required

ISO language code of the auto-detected source language.

target_language
string
required

ISO language code of the target language.

document_name
string
required

Name of the translated output file (with extension).

page_count
integer
required

Number of pages that were translated.

remaining_requests
integer
required

Number of translation requests the user has remaining for today.