How to Export a Translation Memory via an API
Export a translation memory through an API by starting a job, polling until it finishes, and downloading the file before the link expires. DeepL’s translation-memory export is TMX only. RWS Language Cloud returns the finished download as tmx.gz. The call does not add context, dates, or previous versions that the file itself does not contain.
This page is for the person who has an API token and needs the memory out, or in, without the console. It is not the format and process for a decade of files handed over by a vendor. It is not version history, which a TMX does not carry as a revision list. It is not whether the contract lets you export at all.
The file at the end of the job is still a TMX
DeepL’s export reference says TMX is currently the only export format, so the request has no format parameter. Exporting runs as a background job. The first call returns a job id. You poll that job, and you download the TMX from the URL on the completed result.
The status code on that first call is the part teams retry wrong:
- 202 Accepted. A new export job started. Poll the job id.
- 200 OK. A recent export was still available and was reused. Poll that job id the same way. The work was not done again.
- 409 Conflict. An export of this translation memory is already running. Poll the job you already have. Do not send the export again. Another try conflicts with the job that is in progress.
The download URL is short-lived. DeepL says it stops working at the expiry time on the result. Download when the job completes. If the URL has expired, start a new export. Do not store the URL as the archive. Store the TMX.
Language Cloud is the same shape, gzipped
RWS Language Cloud’s public API uses the same three beats. Export is a POST with the translation memory id and a valid language direction. The response has an export id and a status. Poll until the status is done, then download. The downloaded file is tmx.gz.
Gunzip it and you are holding a TMX. Locale codes, inline tags, and whatever dates the export wrote are in that file. They are not in the export id. Open the TMX before you delete the source memory. A job that completed is not a file you have read.
Import creates the memory from the file
DeepL’s import reference says there is no endpoint that creates an empty translation memory. Importing a TMX creates the memory and fills it in one job. The request describes the file — name and size — and returns an upload URL. You upload the TMX to that URL. Processing starts when the upload finishes. There is no second call to confirm it.
The documented size limit is a file greater than zero and at most 1 GB. The file name is at most 100 characters. TMX is the only supported format. On a completed import, the result has the new translation memory id and may include a skipped-segment count. A skipped segment did not become a unit. Read that count. Do not treat a completed job as a complete memory until you have compared it with the file you sent.
RWS says to create the translation memory with the create endpoint before the import call. The import then takes the translation memory id, the file, and the import properties. The order is the opposite of DeepL’s. Read the destination’s page before you script the first call. Do not copy one vendor’s sequence onto the other.
Order of work
- Export once, and keep the job id. On DeepL, a 409 means you already have a job. Poll it.
- Download before the link expires. DeepL’s download URL dies at its expiry time. Language Cloud’s download is
tmx.gzafter the status isdone. - Open the TMX. Read
xml:langand whether creation and change dates are in the file. The API will not tell you that from the job status. - Import into a memory the destination actually creates the way its docs say. DeepL: the import creates the memory, up to 1 GB. Language Cloud: create the memory first, then import.
- Compare counts. DeepL may report skipped segments. A skipped row is missing. It is not a warning you can ignore because the job status said completed.
What this usually is not
- “The API migrates context and version history.” It migrates the file. Context and the revision list are separate checks, and previous versions are not the last change date.
- “Retry until it accepts.” On DeepL, retrying a 409 fights the export that is already running.
- “Completed means every segment arrived.” Completed means the job finished. Skipped segments, a refused locale, and an unmapped date are still your problem. The import-formats page is the extension list. This page is the job.
- “We can skip the pilot because a script did it.” Run one real file against the new memory before you point production at it. That gate is the validation checklist.
Summary
- ☐ Start the export and store the job id. On DeepL, do not retry a 409
- ☐ Poll until the job is finished, failed, or expired
- ☐ Download immediately. DeepL’s URL expires. Language Cloud’s file is
tmx.gz - ☐ Open the TMX. The job status does not list locales or dates
- ☐ Import the way that vendor creates a memory. DeepL’s import creates it. Language Cloud wants it created first
- ☐ Read a skipped-segment count before you call the move complete
The limit a finished job cannot repair
A downloaded TMX can be complete and still be the wrong approved target, repeated for as long as the memory has existed. The API got the units across. It did not decide which stored translation you meant to keep. That limit is the one in Your Translation Memory Is Faithfully Preserving Your Mistakes.
That is why we built Aquilla around living project memory rather than a file you re-export every time the TMS changes. You can still run a conventional TMS and its API. This page exists because the export is a job that returns a TMX, not a migration that keeps everything the console displayed.
FAQ
How to export and migrate translation memory data via an API?
Start a job, poll it, and download the file before the link expires. DeepL exports TMX only: 202 starts a job, 200 reuses a recent export, and 409 means one is already running. RWS Language Cloud returns tmx.gz after the status is done. On import, DeepL creates the memory from the TMX and accepts a file up to 1 GB. Language Cloud says to create the memory first. The API does not add dates, context, or previous versions the file does not contain.
Does an API export include more than a TMX?
Not in these two exports. DeepL says TMX is the only export format. Language Cloud’s download is a gzip of that kind of file. If you needed every earlier target, ask for a history export. The job will not assemble one from the last-change date.
What should we do when the export API says a job is already running?
On DeepL, that is a 409. Poll the job id from the earlier request. Do not send the export again. A 200 and a 202 both give you a job id. One reused a recent export. The other started work. You poll either one.
Is an API migration different from a TMX migration?
The transport is different. The file is not. Profile locales and dates, compare the skipped-segment count when the API reports one, and pilot one file before production. A completed job is not proof that every row became a unit.
Related guides
- What Format and Process to Expect for a Legacy Translation Memory Migration — several TMX files and a native archive, when a person hands you the decade
- Version history is not the last change date — the TMX attributes are one creation and one last edit
- What File Formats Are Supported for TM Import — which extensions the destination opens
- How to Migrate Translations Without Losing Context or History — 101% context and the translation date, after the file is in your hands
- Which TMS Vendors Restrict TMX Export — when the account is not allowed to export
- How to Validate a Migrated Translation Memory Before Production — the go/no-go after the job is done
- Your Translation Memory Is Faithfully Preserving Your Mistakes — a complete download can still be the wrong decision