Body
Required
-
Name to be associated with the glossary.
-
The language in which the source texts in the glossary are specified.
Values are
ar,bg,cs,da,de,el,en,es,et,fi,fr,he,hu,id,it,ja,ko,lt,lv,nb,nl,pl,pt,ro,ru,sk,sl,sv,th,tr,uk,vi, orzh. -
The language in which the target texts in the glossary are specified.
Values are
ar,bg,cs,da,de,el,en,es,et,fi,fr,he,hu,id,it,ja,ko,lt,lv,nb,nl,pl,pt,ro,ru,sk,sl,sv,th,tr,uk,vi, orzh. -
The entries of the glossary. The entries have to be specified in the format provided by the
entries_formatparameter. -
The format in which the glossary entries are provided. Formats currently available:
tsv(default) - tab-separated valuescsv- comma-separated values
See Supported Glossary Formats for details about each format.
Values are
tsvorcsv. Default value istsv.
Body
Required
-
Name to be associated with the glossary.
-
The language in which the source texts in the glossary are specified.
Values are
ar,bg,cs,da,de,el,en,es,et,fi,fr,he,hu,id,it,ja,ko,lt,lv,nb,nl,pl,pt,ro,ru,sk,sl,sv,th,tr,uk,vi, orzh. -
The language in which the target texts in the glossary are specified.
Values are
ar,bg,cs,da,de,el,en,es,et,fi,fr,he,hu,id,it,ja,ko,lt,lv,nb,nl,pl,pt,ro,ru,sk,sl,sv,th,tr,uk,vi, orzh. -
The entries of the glossary. The entries have to be specified in the format provided by the
entries_formatparameter. -
The format in which the glossary entries are provided. Formats currently available:
tsv(default) - tab-separated valuescsv- comma-separated values
See Supported Glossary Formats for details about each format.
Values are
tsvorcsv. Default value istsv.
Responses
-
The function for creating a glossary returns a JSON object containing the ID of the newly created glossary and a boolean flag that indicates if the created glossary can already be used in translate requests.
-
Bad request. Please check error message and your parameters.
-
Authorization failed. Please supply a valid
DeepL-Auth-Keyvia theAuthorizationheader. -
Authorization failed. Please supply a valid
DeepL-Auth-Keyvia theAuthorizationheader. -
The request size exceeds the limit.
-
Too many requests. Please wait and resend your request.
-
Quota exceeded. The glossary creation limit has been reached.
-
Internal error.
-
Resource currently unavailable. Try again later.
-
Too many requests. Please wait and resend your request.
curl \
--request POST 'https://api.deepl.com/v2/glossaries' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"name":"My Glossary","source_lang":"en","target_lang":"de","entries":"Hello\tGuten Tag","entries_format":"tsv"}'
curl \
--request POST 'https://api.deepl.com/v2/glossaries' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'name=My+Glossary&source_lang=en&target_lang=de&entries=Hello%09Guten+Tag&entries_format=tsv'
{
"name": "My Glossary",
"source_lang": "en",
"target_lang": "de",
"entries": "Hello\tGuten Tag",
"entries_format": "tsv"
}
# Headers
# Payload
{
"glossary_id": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7",
"ready": true,
"name": "My Glossary",
"source_lang": "en",
"target_lang": "de",
"creation_time": "2021-08-03T14:16:18.329Z",
"entry_count": 1
}
{
"message": "Invalid glossary entries provided",
"detail": "Key with the index 1 (starting at position 13) duplicates key with the index 0 (starting at position 0)"
}