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.
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.
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
| Field | Type | Description |
|---|---|---|
| file | file | DOCX file to translate (required) |
| target_lang | string | Target language code: Hebrew Arabic Persian Urdu |
| translation_mode | string | professional (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
| Plan | Requests / min | Monthly word quota |
|---|---|---|
| Free | 10 | 10,000 words |
| Starter | 30 | 100,000 words |
| Pro | 60 | Unlimited |
API translations share the same word quota as your web translations. Rate limit exceeded responses return HTTP 429.
Error Codes
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 403 | Key revoked or account suspended |
| 413 | File too large (max 50 MB) |
| 422 | Unsupported file type or missing field |
| 429 | Rate limit exceeded - back off and retry |
| 502 | Translation provider error - retry after a moment |
Ready to integrate? Generate your first API key in Account Settings.
Get Your API Key