Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions api-reference/document.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ curl -X POST 'https://api.deepl.com/v2/document' \
--form 'source_lang=EN' \
--form 'target_lang=DE' \
--form 'file=@document.docx' \
--form 'glossary_id=[yourGlossaryId]'
--form 'glossary_id=[yourGlossaryId]'
```

```json Example response
Expand All @@ -71,38 +71,38 @@ The examples below use our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: document upload (no glossary)
POST /v2/document HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: [length]
Content-Type: multipart/form-data;boundary="boundary"

--boundary,Content-Disposition: form-data; name=target_lang

DE
--boundary,Content-Disposition: form-data; name=file

@document.docx
```

```http Example request: document upload (with glossary)
POST /v2/document HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: [length]
Content-Type: multipart/form-data;boundary="boundary"

--boundary,Content-Disposition: form-data; name=source_lang

EN
--boundary,Content-Disposition: form-data; name=target_lang

DE
--boundary,Content-Disposition: form-data; name=file

@document.docx
--boundary,Content-Disposition: form-data; name=glossary_id

[yourGlossaryId]
```

Expand Down Expand Up @@ -146,7 +146,7 @@ These examples are for demonstration purposes only. In production code, the auth
The name of the uploaded file. Can be used as an alternative to including the file name in the file part's content disposition.
</ParamField>
<ParamField body="formality" type="string">
Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages `DE` (German), `FR` (French), `IT` (Italian), `ES` (Spanish), `NL` (Dutch), `PL` (Polish), `PT-BR` and `PT-PT` (Portuguese), `JA` (Japanese), and `RU` (Russian). Learn more about the plain/polite feature for Japanese <a href="https://support.deepl.com/hc/en-us/articles/6306700061852-About-the-plain-polite-feature-in-Japanese">here</a>. Setting this parameter with a target language that does not support formality will fail, unless one of the `prefer_...` options are used. Possible options are:
Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages `DE` (German), `FR` (French), `IT` (Italian), `ES` (Spanish), `NL` (Dutch), `PL` (Polish), `PT-BR` and `PT-PT` (Portuguese), `JA` (Japanese), and `RU` (Russian). Learn more about the plain/polite feature for Japanese <a href="https://support.deepl.com/hc/en-us/articles/6306700061852-About-the-plain-polite-feature-in-Japanese">here</a>. Setting this parameter with a target language that does not support formality will fail, unless one of the `prefer_...` options are used. To check formality support dynamically, call <a href="/api-reference/languages/retrieve-supported-languages-by-resource"><code>GET /v3/languages?resource=translate_document</code></a> and look for the <code>formality</code> feature key on the target language. Possible options are:
<ul>
<li>`default` (default)</li>
<li>`more` - for a more formal language</li>
Expand All @@ -156,7 +156,7 @@ These examples are for demonstration purposes only. In production code, the auth
</ul>
</ParamField>
<ParamField body="glossary_id" type="string">
A unique ID assigned to a glossary.
A unique ID assigned to a glossary. To check glossary support for a language pair, call <a href="/api-reference/languages/retrieve-supported-languages-by-resource"><code>GET /v3/languages?resource=translate_document</code></a> and verify the <code>glossary</code> feature key is present on both the source and target language.
</ParamField>
<ParamField body="output_format" type="string">
File extension of desired format of translated file, for example: `pdf`. If unspecified, by default the translated file will be in the same format as the input file.
Expand Down Expand Up @@ -219,7 +219,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: check document status
POST /v2/document/{document_id} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 83
Content-Type: application/json
Expand Down Expand Up @@ -285,7 +285,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: download translated document
POST /v2/document/{document_id}/result HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 83
Content-Type: application/json
Expand All @@ -312,4 +312,4 @@ The range of alternative output formats you can select are indicated in the tabl
| Input document format | Alternative output document formats |
| --- | --- |
| PDF | `docx` - Microsoft Word Document |
| Others | None |
| Others | None |
18 changes: 9 additions & 9 deletions api-reference/glossaries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This page documents `v2` glossary endpoints, legacy endpoints that let you creat
[See here](/api-reference/multilingual-glossaries) for information on current `v3` endpoints. Using `v3` allows you to create, manage, and edit glossaries with entries in multiple language pairs, while still supporting monolingual functionality. [See here](/api-reference/glossaries/v2-vs-v3-endpoints) for an overview of the difference.
</Info>

This page describes how to use the `v2` endpoints to work with _monolingual_ glossaries - glossaries that map phrases in one language to phrases in another language. If you're new to glossaries, we suggest you use `v3` instead.
This page describes how to use the `v2` endpoints to work with _monolingual_ glossaries - glossaries that map phrases in one language to phrases in another language. If you're new to glossaries, we suggest you use `v3` instead.

### Create a glossary

Expand Down Expand Up @@ -49,7 +49,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: create a glossary
POST /v2/glossaries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 112
Content-Type: application/json
Expand Down Expand Up @@ -113,7 +113,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: create a glossary
POST /v2/glossaries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 112
Content-Type: application/json
Expand Down Expand Up @@ -145,7 +145,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a

```sh Example request: list all glossaries
curl -X GET 'https://api.deepl.com/v2/glossaries' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]'
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]'
```

```json Example response
Expand All @@ -170,7 +170,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: list all glossaries
GET /v2/glossaries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```
```json Example response
Expand Down Expand Up @@ -220,7 +220,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: retrieve glossary details
GET /v2/glossaries/{glossary_id} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```
```json Example response
Expand Down Expand Up @@ -260,7 +260,7 @@ Hello! Guten Tag!
```http Example request: retrieve glossary entries
GET /v2/glossaries/{glossary_id}/entries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
'Accept: text/tab-separated-values'
User-Agent: YourApp/1.2.3
```
Expand Down Expand Up @@ -289,7 +289,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: delete a glossary
DELETE /v2/glossaries/{glossary_id} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```
</Tab>
Expand Down Expand Up @@ -333,7 +333,7 @@ The example below uses our API Pro endpoint `https://api.deepl.com`. If you're a
```http Example request: get glossary language pairs
GET /v2/glossary-language-pairs HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```
```json Example response (partial—one language pair)
Expand Down
10 changes: 7 additions & 3 deletions api-reference/improve-text.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ curl -X POST 'https://api.deepl.com/v2/write/rephrase' \
Text to be improved. Only UTF-8-encoded plain text is supported. Improvements are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences.
</ParamField>
<ParamField body="target_lang" type="string">
The language of the improved text. A list of supported languages have not yet been added to the `/languages` endpoint. Currently, the following languages are supported:
The language of the improved text. Currently, the following languages are supported:

* `de` (German)
* `en-GB` (British English)
Expand All @@ -76,6 +76,8 @@ curl -X POST 'https://api.deepl.com/v2/write/rephrase' \
* `pt-PT` (Portuguese)
* `zh`/`zh-Hans` (simplified Chinese)

You can also retrieve supported languages programmatically via <a href="/api-reference/languages/retrieve-supported-languages-by-resource"><code>GET /v3/languages?resource=write</code></a>.

The language of the source texts sent in the `text` parameter must match the target language (translating and improving text simultaneously is not yet supported).

Note that it is possible to convert text from one variant to another within a language. For example, if American English is sent in an API request with `target_lang` set to `EN-GB`, the submitted text will be improved and also converted to British English.
Expand Down Expand Up @@ -111,6 +113,8 @@ curl -X POST 'https://api.deepl.com/v2/write/rephrase' \
Styles prefixed with `prefer_` will fall back to the `default` style when used with a language that does not support styles (this is recommended for cases where no `target_lang` is set), the non-prefixed writing styles (except `default`) will return a HTTP 400 error in that case.

It’s not possible to include both `writing_style` and `tone` in a request; only one or the other can be included.

To check writing style support dynamically, call <a href="/api-reference/languages/retrieve-supported-languages-by-resource"><code>GET /v3/languages?resource=write</code></a> and look for the <code>writing_style</code> feature key on the target language.
</ParamField>
<ParamField body="tone" type="enum">
Changes the tone of your improvements.
Expand Down Expand Up @@ -142,7 +146,7 @@ curl -X POST 'https://api.deepl.com/v2/write/rephrase' \

Tones prefixed with `prefer_` will fall back to the `default` tone when used with a language that does not support tones (this is recommended for cases where no `target_lang` is set), the non-prefixed tones (except `default`) will return a HTTP 400 error in that case.

It’s not possible to include both `writing_style` and `tone` in a request; only one or the other can be included.
It’s not possible to include both `writing_style` and `tone` in a request; only one or the other can be included. To check tone support dynamically, call <a href="/api-reference/languages/retrieve-supported-languages-by-resource"><code>GET /v3/languages?resource=write</code></a> and look for the <code>tone</code> feature key on the target language.
</ParamField>

### Response body descriptions
Expand Down Expand Up @@ -179,6 +183,6 @@ We've added a new column to the [API key-level usage report](/docs/getting-start

#### Is "Corrections Only" mode available in the API?

No. "Corrections Only" is a mode that fixes spelling and grammatical errors only without broader rephrasing. It is currently only available in the DeepL Translator UI.
No. "Corrections Only" is a mode that fixes spelling and grammatical errors only without broader rephrasing. It is currently only available in the DeepL Translator UI.

If you make an API request to `/write/rephrase` and omit both `writing_style` and `tone`, the API uses its default improvement mode. This corrects grammar and spelling but may also make broader changes than the "Corrections Only" mode in the UI.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Get information about all currently supported languages across all DeepL API res

We also provide auto-generated API specs from DeepL's OpenAPI file, for use with API clients and code generation tools:
- [Retrieve languages](/api-reference/languages/retrieve-languages-by-resource)
- [Retrieve resources](/api-reference/languages/retrieve-products)
- [Retrieve resources](/api-reference/languages/retrieve-resources)

To understand how we'll update these endpoints when we add translation support for a new language or language variant, please see [this article](/docs/resources/language-release-process).

Expand Down
36 changes: 19 additions & 17 deletions api-reference/multilingual-glossaries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ description: "Manage and use DeepL glossaries"
---

<Info>
This page documents `v3` glossary endpoints, which let you **edit** glossaries and allow for **multilingual** functionality.
This page documents `v3` glossary endpoints, which let you **edit** glossaries and allow for **multilingual** functionality.

The current`v3` endpoints are used for working with **both multilingual and monolingual** glossaries. Thus, we recommend you start using the `v3` endpoints described below for all glossary needs.

The previously used [v2 glossary endpoints](/api-reference/glossaries) can only be used with **monolingual** glossaries. [See here](/api-reference/glossaries/v2-vs-v3-endpoints) for more on the difference between `v2` and `v3` glossary endpoints.
</Info>

Expand All @@ -34,7 +34,7 @@ Note that this mapping occurs only in one direction, which is all you need durin
| exquisito | delicieux |
| mouse | mouse |

Both glossaries and style rules are unique to each of DeepL's global data centers and are not shared between them. Clients using the `api-us.deepl.com` endpoint will not be able to access glossaries or style rules created in the UI at this time.
Both glossaries and style rules are unique to each of DeepL's global data centers and are not shared between them. Clients using the `api-us.deepl.com` endpoint will not be able to access glossaries or style rules created in the UI at this time.


## Creating glossaries
Expand Down Expand Up @@ -132,11 +132,11 @@ This example creates a modest glossary with two dictionaries. One maps "Hello" i
```http Example request: create a glossary
POST /v3/glossaries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 1234
Content-Type: application/json

{
"name": "My Glossary",
"dictionaries": [
Expand Down Expand Up @@ -199,11 +199,11 @@ To use a glossary in a translation request, include its `glossary_id` . You must
```http Example request: translate including glossary
POST /v2/translate HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 111
Content-Type: application/json

{
"text": [
"Hello there"
Expand Down Expand Up @@ -245,7 +245,7 @@ Use this endpoint to list all your glossaries, basic information about each glos

```sh Example request: list glossaries
curl -X GET 'https://api.deepl.com/v3/glossaries' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]'
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]'
```

```json Example response
Expand Down Expand Up @@ -276,7 +276,7 @@ Use this endpoint to list all your glossaries, basic information about each glos
```http Example request: list all glossaries
GET /v3/glossaries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```

Expand Down Expand Up @@ -345,7 +345,7 @@ Use this endpoint to retrieve basic information about a given glossary's diction
```http Example request: retrieve glossary details
GET /v3/glossaries/{glossary_id} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```

Expand Down Expand Up @@ -406,7 +406,7 @@ Currently you can only retrieve glossary contents in TSV format.
```http Example request: get glossary entries
GET /v3/glossaries/{glossary_id}/entries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```

Expand Down Expand Up @@ -467,7 +467,7 @@ Use this method to add a new dictionary to a glossary or replace an existing one
```http Example request: replace a dictionary
PUT /v3/glossaries/{glossaryId}/dictionaries HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 210
Content-Type: application/json
Expand Down Expand Up @@ -529,7 +529,7 @@ For example, this `PATCH` changes a glossary's name.
```http Example request: update glossary entries
PATCH /v3/glossaries/{glossaryId} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 147
Content-Type: application/json
Expand Down Expand Up @@ -600,7 +600,7 @@ This example makes two changes. It changes the glossary's name, and it adds a ne
```http Example request: update glossary entries
PATCH /v3/glossaries/{glossaryId} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
Content-Length: 147
Content-Type: application/json
Expand Down Expand Up @@ -652,7 +652,7 @@ This method deletes the specified glossary in its entirety.
```http Example request: delete a glossary
DELETE /v3/glossaries/{glossary_id} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```
</Tab>
Expand All @@ -679,7 +679,7 @@ Use this method to delete a dictionary for a specific language pair.
```http Example request: delete a dictionary
DELETE /v3/glossaries/{glossary_id}/dictionaries?source_lang={source_lang}&target_lang={target_lang} HTTP/2
Host: api.deepl.com
Authorization: DeepL-Auth-Key [yourAuthKey]
Authorization: DeepL-Auth-Key [yourAuthKey]
User-Agent: YourApp/1.2.3
```
</Tab>
Expand All @@ -691,6 +691,8 @@ Use this method to delete a dictionary for a specific language pair.

The DeepL API supports [these languages for glossaries](/docs/getting-started/supported-languages).

To retrieve supported glossary languages programmatically, call [`GET /v3/languages?resource=glossary`](/api-reference/languages/retrieve-supported-languages-by-resource).

### Language variants

Glossaries apply to languages, not specific language variants. A glossary for a language applies to any variant of that language.
Expand Down
Loading