To apply the same terminology in both directions, add a second dictionary with the reverse mapping (Spanish → French). You can create dictionaries for any language that supports glossaries; to check programmatically, call
GET /v3/languages?resource=glossary.
Entry formats
Glossary entries are formatted as CSV (comma-separated values) or TSV (tab-separated values), one entry per line, source phrase first:CSV entries
- Fields containing double quotes or commas must be enclosed in double quotes
- A double quote inside a quoted field is escaped by doubling it (
"")
Create a glossary
SendPOST /v3/glossaries an array of one or more dictionaries. This example creates a glossary with an English → German dictionary and its reverse:
Example request
Example response
jq to embed the file contents in the request body:
Create a glossary from a CSV file
Use a glossary in a translation
Include theglossary_id in a /v2/translate or /v2/document request, along with the source_lang of the text. To translate text without setting source_lang, see Use a glossary with automatic source language detection.
Example request
Example response
EN applies when translating into EN-US and EN-GB alike, and must be created with the root code. See How to Apply Customizations to Language Variants.
The v3 endpoints handle glossary management only; translation itself stays on the v2 endpoints.
Use a glossary with automatic source language detection
On/v2/translate you can omit source_lang: DeepL detects the source language and applies the glossary’s dictionary for the detected language pair. This works through the REST API only. The DeepL client libraries currently require source_lang with a glossary, and so does document translation.
This request has no source_lang:
Example request
EN to DE dictionary also contains the entry finance team = Buchhaltung. The response reports which language DeepL detected:
Example response
- A
400means the glossary has no dictionary for the detected source language and yourtarget_lang. Add the dictionary, or setsource_langif detection picked the wrong language. - Short input, such as a single word, can be detected as the wrong language. Set
source_langfor short text. See Language detection.
glossary_ids, every listed glossary needs a dictionary for the detected language pair, otherwise the whole request returns a 400.
Edit a glossary
Two methods change an existing glossary, with different semantics:
For example, this
PATCH renames a glossary and adds one entry to its English → German dictionary, keeping existing entries:
Example request
PUT or PATCH can change one dictionary. To change the same source phrase across multiple language pairs, make one call per dictionary.
Retrieve glossaries
GET /v3/glossarieslists all your glossaries with per-dictionary metadata (no entries)GET /v3/glossaries/{id}returns one glossary’s metadataGET /v3/glossaries/{id}/entriesreturns the entries of a single dictionary, selected viasource_langandtarget_langquery parameters. Entries are currently returned in TSV format only.
Delete glossaries
DELETE /v3/glossaries/{id}deletes the whole glossaryDELETE /v3/glossaries/{id}/dictionaries?source_lang=...&target_lang=...deletes a single dictionary
Limits and restrictions
- Each dictionary can contain up to 10 MB of entries; a glossary with five dictionaries can hold up to 50 MB in total
- The glossary name, each source phrase, and each target phrase can contain up to 1024 UTF-8 bytes
- Duplicate source entries are not allowed, and neither source nor target may be empty
- Entries must not contain control characters (such as
\tor\ninside a phrase), Unicode newlines, or leading/trailing whitespace - The number of glossaries per account is limited by your plan