Export translations (API V1)
Request an export of a project, wait until it has finished and download the ZIP file.
Request the export
Section titled “Request the export”POST /v1/{workspaceUrl}/projects/{projectUrl}/exports starts an export; LingoHub writes the files in the background. The body is optional: without it, the export contains every file in every language.
filePathslimits the export to certain files. A path names a file in all its languages, so it carries the placeholder%{locale}where the language stands, for exampleconfig/locales/%{locale}/messages.yml. Replace the path of the sample with a path of your project; Get project resource file status returns the paths infilePathWithLocalePlaceholder. A path the project doesn’t have returns404.iso2Slugslimits the export to certain languages.
The response carries the id of the export. Its status starts as SCHEDULED.
# Step 1: Request the exportEXPORT=$(curl -sS --fail-with-body -X POST "$API/exports" \ -H "$AUTH" \ -H "Content-Type: application/json" \ -d '{ "filePaths": ["config/locales/%{locale}/messages.yml"], "iso2Slugs": ["en", "de"] }') || { echo "$EXPORT"; exit 1; }EXPORT_ID=$(echo "$EXPORT" | jq -r '.id')echo "Export requested: $EXPORT_ID"# Step 1: Request the exportresponse = session.post( f"{API}/exports", json={ "filePaths": ["config/locales/%{locale}/messages.yml"], "iso2Slugs": ["en", "de"], },)response.raise_for_status()export_id = response.json()["id"]print(f"Export requested: {export_id}")Wait for the export
Section titled “Wait for the export”Read the export with GET .../exports/{id} until its status is no longer NEW, SCHEDULED or PROCESSING. The final statuses are SUCCESS, ERROR and SKIPPED.
# Step 2: Wait until the export has finishedwhile true; do EXPORT=$(curl -sS --fail-with-body "$API/exports/$EXPORT_ID" -H "$AUTH") || { echo "$EXPORT"; exit 1; } STATUS=$(echo "$EXPORT" | jq -r '.status') case "$STATUS" in NEW|SCHEDULED|PROCESSING) sleep 2 ;; *) break ;; esacdoneecho "Export $EXPORT_ID finished: $STATUS"# Step 2: Wait until the export has finishedwhile True: response = session.get(f"{API}/exports/{export_id}") response.raise_for_status() export = response.json() if export["status"] not in ("NEW", "SCHEDULED", "PROCESSING"): break time.sleep(2)print(f"Export {export_id} finished: {export['status']}")Download the ZIP file
Section titled “Download the ZIP file”Only an export with the status SUCCESS has a file. downloadUrl is a pre-signed link to the ZIP file that is valid for 24 hours; every read of the export returns a fresh link. If the export failed, errorDetails says why.
# Step 3: Download the ZIP fileif [ "$STATUS" != "SUCCESS" ]; then echo "$EXPORT" | jq -r '.errorDetails' exit 1ficurl -sS -o export.zip "$(echo "$EXPORT" | jq -r '.downloadUrl')"# Step 3: Download the ZIP fileif export["status"] != "SUCCESS": sys.exit(export["errorDetails"] or "The export produced no file.")with requests.get(export["downloadUrl"], stream=True) as download: download.raise_for_status() with open("export.zip", "wb") as file: for chunk in download.iter_content(chunk_size=65536): file.write(chunk)Complete example
Section titled “Complete example”# Requires: LINGOHUB_API_KEY, WORKSPACE_URL and PROJECT_URL (the two slugs of the project's API URL)API="https://api.lingohub.com/v1/$WORKSPACE_URL/projects/$PROJECT_URL"AUTH="Authorization: Bearer $LINGOHUB_API_KEY"
# Step 1: Request the exportEXPORT=$(curl -sS --fail-with-body -X POST "$API/exports" \ -H "$AUTH" \ -H "Content-Type: application/json" \ -d '{ "filePaths": ["config/locales/%{locale}/messages.yml"], "iso2Slugs": ["en", "de"] }') || { echo "$EXPORT"; exit 1; }EXPORT_ID=$(echo "$EXPORT" | jq -r '.id')echo "Export requested: $EXPORT_ID"
# Step 2: Wait until the export has finishedwhile true; do EXPORT=$(curl -sS --fail-with-body "$API/exports/$EXPORT_ID" -H "$AUTH") || { echo "$EXPORT"; exit 1; } STATUS=$(echo "$EXPORT" | jq -r '.status') case "$STATUS" in NEW|SCHEDULED|PROCESSING) sleep 2 ;; *) break ;; esacdoneecho "Export $EXPORT_ID finished: $STATUS"
# Step 3: Download the ZIP fileif [ "$STATUS" != "SUCCESS" ]; then echo "$EXPORT" | jq -r '.errorDetails' exit 1ficurl -sS -o export.zip "$(echo "$EXPORT" | jq -r '.downloadUrl')"# Requires: LINGOHUB_API_KEY, WORKSPACE_URL and PROJECT_URL (the two slugs of the project's API URL)import osimport sysimport time
import requests
API = f"https://api.lingohub.com/v1/{os.environ['WORKSPACE_URL']}/projects/{os.environ['PROJECT_URL']}"session = requests.Session()session.headers["Authorization"] = f"Bearer {os.environ['LINGOHUB_API_KEY']}"
# Step 1: Request the exportresponse = session.post( f"{API}/exports", json={ "filePaths": ["config/locales/%{locale}/messages.yml"], "iso2Slugs": ["en", "de"], },)response.raise_for_status()export_id = response.json()["id"]print(f"Export requested: {export_id}")
# Step 2: Wait until the export has finishedwhile True: response = session.get(f"{API}/exports/{export_id}") response.raise_for_status() export = response.json() if export["status"] not in ("NEW", "SCHEDULED", "PROCESSING"): break time.sleep(2)print(f"Export {export_id} finished: {export['status']}")
# Step 3: Download the ZIP fileif export["status"] != "SUCCESS": sys.exit(export["errorDetails"] or "The export produced no file.")with requests.get(export["downloadUrl"], stream=True) as download: download.raise_for_status() with open("export.zip", "wb") as file: for chunk in download.iter_content(chunk_size=65536): file.write(chunk)Responses
Section titled “Responses”{ "id": "reg_18USq6822XIv-19847171", "status": "SCHEDULED", "resourceExports": [], "errorDetails": null, "filePath": null, "downloadUrl": null, "triggerType": "API_V1", "createdAt": "2026-01-15T10:30:00.000+00:00"}{ "id": "reg_18USq6822XIv-19847171", "status": "SUCCESS", "resourceExports": [ { "filePath": "config/locales/en/messages.yml", "iso2Slug": "en", "status": "SUCCESS", "downloadUrl": "https://lingohub-...s3.amazonaws.com/..." }, { "filePath": "config/locales/de/messages.yml", "iso2Slug": "de", "status": "SUCCESS", "downloadUrl": "https://lingohub-...s3.amazonaws.com/..." } ], "errorDetails": null, "filePath": "files.zip", "downloadUrl": "https://lingohub-...s3.amazonaws.com/...", "triggerType": "API_V1", "createdAt": "2026-01-15T10:30:00.000+00:00"}