Skip to content

Export translations (API V1)

Request an export of a project, wait until it has finished and download the ZIP file.

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.

  • filePaths limits 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 example config/locales/%{locale}/messages.yml. Replace the path of the sample with a path of your project; Get project resource file status returns the paths in filePathWithLocalePlaceholder. A path the project doesn’t have returns 404.
  • iso2Slugs limits the export to certain languages.

The response carries the id of the export. Its status starts as SCHEDULED.

Terminal window
# Step 1: Request the export
EXPORT=$(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"

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.

Terminal window
# Step 2: Wait until the export has finished
while 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 ;;
esac
done
echo "Export $EXPORT_ID finished: $STATUS"

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.

Terminal window
# Step 3: Download the ZIP file
if [ "$STATUS" != "SUCCESS" ]; then
echo "$EXPORT" | jq -r '.errorDetails'
exit 1
fi
curl -sS -o export.zip "$(echo "$EXPORT" | jq -r '.downloadUrl')"
Terminal window
# 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 export
EXPORT=$(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 finished
while 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 ;;
esac
done
echo "Export $EXPORT_ID finished: $STATUS"
# Step 3: Download the ZIP file
if [ "$STATUS" != "SUCCESS" ]; then
echo "$EXPORT" | jq -r '.errorDetails'
exit 1
fi
curl -sS -o export.zip "$(echo "$EXPORT" | jq -r '.downloadUrl')"
Response: export requested
{
"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"
}
Response: export finished
{
"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"
}