Skip to content
Merged
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
63 changes: 62 additions & 1 deletion api-reference/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1111,11 +1111,72 @@
}
},
"style_profile_id": {
"description": "Translate with a [style profile](/api-reference/style-profiles/list-all-style-profiles): its glossaries,\nstyle rule lists and translation memories through one ID. The profile is applied per text once the\nsource language is known: the glossaries with a dictionary for the text's language pair, the style\nrule list for the target language, and the translation memories whose source language matches the\ntext. A component that does not fit a text's language pair is left out for that text; this is not an\nerror.\n\nCannot be combined with `glossary_id`, `glossary_ids`, `style_id`, `translation_memory_id`,\n`translation_memory_threshold` or `custom_instructions`. A request that combines them is rejected\nwith `400 Bad Request`. A style profile that does not exist or that your account cannot access is\nrejected with `404 Not Found`.",
"description": "Translate with a [style profile](/api-reference/style-profiles/list-all-style-profiles): its glossaries, style rule lists and translation memories through one ID. The profile is applied per text once the source language is known: the glossaries with a dictionary for the text's language pair, the style rule list for the target language, and the translation memories whose source language matches the text. A component that does not fit a text's language pair is left out for that text; this is not an error.\n\nCannot be combined with `customizations`, `glossary_id`, `glossary_ids`, `style_id`, `translation_memory_id`, `translation_memory_threshold` or `custom_instructions`. A request that combines them is rejected with `400 Bad Request`. A style profile that does not exist or that your account cannot access is rejected with `404 Not Found`.",
"type": "string",
"format": "uuid",
"example": "3f1c9d0e-7a24-4b58-9c31-8f0e5d2a1b47"
},
"customizations": {
"description": "All customizations of the request in one object: glossaries, a style rule list, custom instructions, a translation memory and example documents. For new integrations we recommend this object over the individual customization parameters. Each field behaves like the parameter it corresponds to.\n\nCannot be used together with `style_profile_id`, `glossary_id`, `glossary_ids`, `style_id`, `translation_memory_id`, `translation_memory_threshold` or `custom_instructions`. A request that combines them is rejected with `400 Bad Request` naming the conflicting parameter.\n\nAccepted in JSON request bodies only. In a form-encoded request the object is ignored and the text is translated without these customizations.",
"type": "object",
"properties": {
"glossary_ids": {
"description": "Up to 5 glossaries to use for the translation, in the order they should be applied. Corresponds to `glossary_ids`: every listed glossary must contain a dictionary for the language pair of the request. If `source_lang` is omitted, DeepL detects the source language and uses the dictionaries for the detected language pair.",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7"
}
},
"style_rule_id": {
"description": "The [style rule list](/docs/customize/using-style-rules) to use for the translation. Corresponds to `style_id`: the target language has to match the language of the style rule list.",
"type": "string",
"format": "uuid",
"example": "7ff9bfd6-cd85-4190-8503-d6215a321519"
},
"custom_instructions": {
"description": "Up to 10 instructions of at most 300 characters each. Corresponds to `custom_instructions`, including its target language restriction.",
"type": "array",
"items": {
"type": "string",
"example": "Use a friendly, diplomatic tone"
}
},
"translation_memories": {
"description": "The translation memory to use for the translation, with an optional matching threshold. Corresponds to `translation_memory_id` and `translation_memory_threshold`. Currently one entry is supported; a request with more is rejected with `400 Bad Request`.",
"type": "array",
"items": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"$ref": "#/components/schemas/TranslationMemoryId"
},
"threshold": {
"description": "The minimum matching percentage required for a translation memory segment to be applied, between 50 and 100. Defaults to 75. A value outside this range is rejected with `400 Bad Request`.",
"type": "integer",
"minimum": 50,
"maximum": 100,
"default": 75,
"example": 75
}
}
}
},
"example_document_ids": {
"description": "Up to 10 [example documents](/docs/customize/using-example-documents) whose style, tone and terminology the translation adapts to, in the order they should be applied. A document must be fully imported and written in the target language; a document in another language is left out without an error. An ID your account cannot access is rejected with `404 Not Found`.",
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"example": "9e7b41c2-58da-4a03-b6f1-3c85e0d97a26"
}
}
}
},
"tag_handling": {
"$ref": "#/components/schemas/TagHandlingOption"
},
Expand Down
69 changes: 59 additions & 10 deletions api-reference/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -916,20 +916,69 @@ paths:
example: "Use a friendly, diplomatic tone"
style_profile_id:
description: |-
Translate with a [style profile](/api-reference/style-profiles/list-all-style-profiles): its glossaries,
style rule lists and translation memories through one ID. The profile is applied per text once the
source language is known: the glossaries with a dictionary for the text's language pair, the style
rule list for the target language, and the translation memories whose source language matches the
text. A component that does not fit a text's language pair is left out for that text; this is not an
error.
Translate with a [style profile](/api-reference/style-profiles/list-all-style-profiles): its glossaries, style rule lists and translation memories through one ID. The profile is applied per text once the source language is known: the glossaries with a dictionary for the text's language pair, the style rule list for the target language, and the translation memories whose source language matches the text. A component that does not fit a text's language pair is left out for that text; this is not an error.

Cannot be combined with `glossary_id`, `glossary_ids`, `style_id`, `translation_memory_id`,
`translation_memory_threshold` or `custom_instructions`. A request that combines them is rejected
with `400 Bad Request`. A style profile that does not exist or that your account cannot access is
rejected with `404 Not Found`.
Cannot be combined with `customizations`, `glossary_id`, `glossary_ids`, `style_id`, `translation_memory_id`, `translation_memory_threshold` or `custom_instructions`. A request that combines them is rejected with `400 Bad Request`. A style profile that does not exist or that your account cannot access is rejected with `404 Not Found`.
type: string
format: uuid
example: 3f1c9d0e-7a24-4b58-9c31-8f0e5d2a1b47
customizations:
description: |-
All customizations of the request in one object: glossaries, a style rule list, custom instructions, a translation memory and example documents. For new integrations we recommend this object over the individual customization parameters. Each field behaves like the parameter it corresponds to.

Cannot be used together with `style_profile_id`, `glossary_id`, `glossary_ids`, `style_id`, `translation_memory_id`, `translation_memory_threshold` or `custom_instructions`. A request that combines them is rejected with `400 Bad Request` naming the conflicting parameter.

Accepted in JSON request bodies only. In a form-encoded request the object is ignored and the text is translated without these customizations.
type: object
properties:
glossary_ids:
description: |-
Up to 5 glossaries to use for the translation, in the order they should be applied. Corresponds to `glossary_ids`: every listed glossary must contain a dictionary for the language pair of the request. If `source_lang` is omitted, DeepL detects the source language and uses the dictionaries for the detected language pair.
type: array
items:
type: string
format: uuid
example: def3a26b-3e84-45b3-84ae-0c0aaf3525f7
style_rule_id:
description: |-
The [style rule list](/docs/customize/using-style-rules) to use for the translation. Corresponds to `style_id`: the target language has to match the language of the style rule list.
type: string
format: uuid
example: 7ff9bfd6-cd85-4190-8503-d6215a321519
custom_instructions:
description: |-
Up to 10 instructions of at most 300 characters each. Corresponds to `custom_instructions`, including its target language restriction.
type: array
items:
type: string
example: "Use a friendly, diplomatic tone"
translation_memories:
description: |-
The translation memory to use for the translation, with an optional matching threshold. Corresponds to `translation_memory_id` and `translation_memory_threshold`. Currently one entry is supported; a request with more is rejected with `400 Bad Request`.
type: array
items:
type: object
required:
- id
properties:
id:
$ref: '#/components/schemas/TranslationMemoryId'
threshold:
description: |-
The minimum matching percentage required for a translation memory segment to be applied, between 50 and 100. Defaults to 75. A value outside this range is rejected with `400 Bad Request`.
type: integer
minimum: 50
maximum: 100
default: 75
example: 75
example_document_ids:
description: |-
Up to 10 [example documents](/docs/customize/using-example-documents) whose style, tone and terminology the translation adapts to, in the order they should be applied. A document must be fully imported and written in the target language; a document in another language is left out without an error. An ID your account cannot access is rejected with `404 Not Found`.
type: array
items:
type: string
format: uuid
example: 9e7b41c2-58da-4a03-b6f1-3c85e0d97a26
tag_handling:
$ref: '#/components/schemas/TagHandlingOption'
tag_handling_version:
Expand Down
2 changes: 2 additions & 0 deletions docs/customize/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ DeepL's customization features let you control terminology, style, and consisten

Glossaries, style rules, custom instructions, and translation memories work with both [text translation](/docs/translate/translate-text-quickstart) and [document translation](/docs/translate/translate-documents-quickstart), support all `model_type` values, and can be combined in a single request. A style profile bundles glossaries, style rules, and translation memories under one ID for both text and document translation, and is used in place of the individual parameters. Spoken terms apply to [Voice API](/docs/voice/overview) sessions, where they can be combined with glossaries.

On the text translation endpoint you can also send all of them in one [`customizations` object](/api-reference/translate/request-translation#body-customizations) instead of the individual parameters. We recommend the object for new integrations.

<Warning>
Glossaries and style rules are unique to each of DeepL's global data centers and are not shared between them. Clients using [regional endpoints](/docs/getting-started/regional-endpoints) can't access glossaries or style rules created in the UI at this time.
</Warning>
Expand Down
Loading