DocsRTL API

Translate DOCX documents programmatically with layout and RTL formatting fully preserved. The same engine that powers the DocsRTL web app, available via REST.

You need an API key to use this API. Generate one in Account Settings

Base URL

https://docsrtl.com/v1

All requests are HTTPS. HTTP requests are redirected.

Authentication

Pass your API key in the X-API-Key request header. Keys look like drtl_... and never expire unless you revoke them.

X-API-Key: drtl_your_key_here

Keep your key secret. It carries the same quota as your account. Revoke it immediately from Account Settings if it is compromised.

Job Lifecycle

Translation is asynchronous. You submit a file, receive a job ID, poll until complete, then download the result.

pendingprocessingcompletedfailed

Endpoints

POST/v1/translate

Submit a DOCX file for translation. Returns a job ID immediately (HTTP 202). The file is translated asynchronously - poll /v1/jobs/:id for status.

Request - multipart/form-data

FieldTypeDescription
filefileDOCX file to translate (required)
target_langstringTarget language code: Hebrew Arabic Persian Urdu
translation_modestringprofessional (default), full, literal, or extreme

Response - 202 Accepted

{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "pending",
  "poll_url": "/v1/jobs/3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

GET/v1/jobs/:id

Poll the status of a translation job. Recommended polling interval: 2–5 seconds.

{
  "job_id": "3fa85f64-...",
  "status": "completed",   // pending | processing | completed | failed
  "error": null            // error message if status == "failed"
}

GET/v1/jobs/:id/download

Download the translated DOCX once status == "completed". Returns the file as application/octet-stream. Available for 10 minutes after completion.

Full Example (curl)

# 1. Submit the document
curl -X POST https://docsrtl.com/v1/translate \
  -H "X-API-Key: drtl_your_key" \
  -F "[email protected]" \
  -F "target_lang=Arabic"

# → {"job_id":"abc123","status":"pending","poll_url":"/v1/jobs/abc123"}

# 2. Poll until completed
curl https://docsrtl.com/v1/jobs/abc123 \
  -H "X-API-Key: drtl_your_key"

# → {"job_id":"abc123","status":"completed","error":null}

# 3. Download the translated file
curl https://docsrtl.com/v1/jobs/abc123/download \
  -H "X-API-Key: drtl_your_key" \
  -o translated_contract.docx

Rate Limits & Quota

PlanRequests / minMonthly word quota
Free1010,000 words
Starter30100,000 words
Pro60Unlimited

API translations share the same word quota as your web translations. Rate limit exceeded responses return HTTP 429.

Error Codes

StatusMeaning
401Missing or invalid API key
403Key revoked or account suspended
413File too large (max 50 MB)
422Unsupported file type or missing field
429Rate limit exceeded - back off and retry
502Translation provider error - retry after a moment

Ready to integrate? Generate your first API key in Account Settings.

Get Your API Key