-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathopenapi.json
More file actions
7311 lines (7311 loc) · 269 KB
/
openapi.json
File metadata and controls
7311 lines (7311 loc) · 269 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.0.3",
"info": {
"title": "DeepL API Documentation",
"description": "The DeepL API provides programmatic access to DeepL’s language AI technology.\n\nNote: this OpenAPI spec is embedded into our API documentation and has shortened descriptions.",
"termsOfService": "https://www.deepl.com/pro-license",
"contact": {
"name": "DeepL - Contact us",
"url": "https://www.deepl.com/contact-us"
},
"version": "3.9.0"
},
"externalDocs": {
"description": "DeepL Pro - Plans and pricing",
"url": "https://www.deepl.com/pro#developer"
},
"servers": [
{
"url": "https://api.deepl.com",
"description": "DeepL API Pro"
},
{
"url": "https://api-free.deepl.com",
"description": "DeepL API Free"
}
],
"tags": [
{
"name": "beta",
"description": "Experimental features that are under testing and not yet intended for production use."
},
{
"name": "TranslateText",
"description": "The text-translation API currently consists of a single endpoint, `translate`, which is described below."
},
{
"name": "TranslateDocuments",
"description": "The document translation API allows you to translate whole documents and supports the following file types and extensions:\n * `docx` - Microsoft Word Document\n * `pptx` - Microsoft PowerPoint Document\n * `xlsx` - Microsoft Excel Document\n * `pdf` - Portable Document Format\n * `htm / html` - HTML Document\n * `txt` - Plain Text Document\n * `xlf / xliff` - XLIFF Document, version 2.1\n * `srt` - SRT Document\n * `jpeg` / `jpg` / `png` - Image (currently in beta)"
},
{
"name": "RephraseText",
"description": "The `rephrase` endpoint is used to make corrections and adjustments to texts based on style or tone."
},
{
"name": "ManageMultilingualGlossaries",
"description": "The *glossary* functions allow you to create, inspect, edit and delete glossaries.\nGlossaries created with the glossary function can be used in translate requests by specifying the\n`glossary_id` parameter. A glossary contains (several) dictionaries.\nA dictionary is a mapping of source phrases to target phrases for a single language pair.\nIf you encounter issues, please let us know at support@DeepL.com.\n\nCurrently you can create glossaries with any of the languages DeepL supports (with the exception of Thai).\n\nThe maximum size limit for a glossary is 10 MiB = 10485760 bytes and each source/target text,\nas well as the name of the glossary, is limited to 1024 UTF-8 bytes.\nA total of 1000 glossaries are allowed per account.\n\nWhen creating a dictionary with target language `EN`, `PT`, or `ZH`, it's not necessary to specify a variant\n(e.g. `EN-US`, `EN-GB`, `PT-PT`, `PT-BR`, or `ZH-HANS`).\nDictionaries with target language `EN` can be used in translations with either English variant.\nSimilarly `PT`, and `ZH` dictionaries can be used in translations with their corresponding variants.\n(When you provide the ID of a glossary to a translation, the appropriate dictionary is automatically applied. Currently glossaries can not yet be used with source language detection.)\n\nGlossaries created via the DeepL API are now unified with glossaries created via the DeepL website and DeepL apps.\nPlease only use the v3 glossary API in conjunction with multilingual or edited glossaries from the website."
},
{
"name": "ManageGlossaries",
"description": "Please note that this is the spec for the (old) v2 glossary endpoint.\nWe recommend users switch to the newer v3 glossary endpoints, which support editability and multilinguality.\n\nThe *glossary* functions allow you to create, inspect, and delete glossaries.\nGlossaries created with the glossary function can be used in translate requests by specifying the\n`glossary_id` parameter.\nIf you encounter issues, please let us know at support@DeepL.com.\n\nCurrently you can create glossaries with any of the languages DeepL supports (with the exception of Thai)."
},
{
"name": "MetaInformation",
"description": "Information about API usage and value ranges"
},
{
"name": "TranslationMemories",
"description": "The translation memory endpoints allow you to interact with your account's translation memories, used to store\nand reuse previously created translations. Translation memories can be used in text translation requests by\nspecifying the `translation_memory_id` parameter to denote a specific translation memory and the\n`translation_memory_threshold` which defines the minimum matching percentage required for a translation memory\nsegment to be applied (recommended to be 75% or higher)."
},
{
"name": "VoiceAPI",
"description": "The Voice API provides real-time voice transcription and translation services.\nUse a two-step flow: first request a streaming URL via REST, then establish a WebSocket connection for streaming audio and receiving transcriptions."
}
],
"x-hideTryItPanel": true,
"x-codeSamples": false,
"paths": {
"/v2/admin/analytics": {
"get": {
"tags": [
"AdminApi"
],
"summary": "Get usage statistics as an admin",
"operationId": "adminGetAnalytics",
"description": "Retrieve usage statistics for the organization within a specified date range.\nOptionally group the results by API key or by API key and day.",
"parameters": [
{
"name": "start_date",
"in": "query",
"required": true,
"description": "Start date for the usage report (ISO 8601 date format).",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-09-29"
},
{
"name": "end_date",
"in": "query",
"required": true,
"description": "End date for the usage report (ISO 8601 date format).",
"schema": {
"type": "string",
"format": "date"
},
"example": "2025-10-01"
},
{
"name": "group_by",
"in": "query",
"required": false,
"description": "Optional parameter to group usage statistics. Possible values:\n * `key` - Group by API key\n * `key_and_day` - Group by API key and usage date",
"schema": {
"type": "string",
"enum": [
"key",
"key_and_day"
]
},
"example": "key_and_day"
}
],
"responses": {
"200": {
"description": "The usage statistics for the specified date range.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AdminUsageReport"
},
"examples": {
"withGrouping": {
"summary": "Usage report grouped by key and day",
"value": {
"usage_report": {
"total_usage": {
"total_characters": 9619,
"text_translation_characters": 4892,
"document_translation_characters": 0,
"text_improvement_characters": 4727,
"speech_to_text_minutes": 107.46
},
"group_by": "key_and_day",
"start_date": "2025-09-29T00:00:00",
"end_date": "2025-10-01T00:00:00",
"key_and_day_usages": [
{
"api_key": "dc88****3a2c",
"api_key_label": "Staging API Key",
"usage_date": "2025-09-29T00:00:00Z",
"usage": {
"total_characters": 315,
"text_translation_characters": 159,
"document_translation_characters": 0,
"text_improvement_characters": 156,
"speech_to_text_minutes": 11.94
}
}
]
}
}
},
"withoutGrouping": {
"summary": "Usage report without grouping",
"value": {
"usage_report": {
"total_usage": {
"total_characters": 9619,
"text_translation_characters": 4892,
"document_translation_characters": 0,
"text_improvement_characters": 4727,
"speech_to_text_minutes": 107.46
},
"start_date": "2025-09-29T00:00:00",
"end_date": "2025-10-01T00:00:00"
}
}
}
}
}
}
},
"400": {
"description": "Bad request. Please check error message and your parameters.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error message describing the issue."
}
}
},
"examples": {
"dateRangeExceeded": {
"summary": "Date range exceeds maximum allowed",
"value": {
"message": "Bad request. Reason: Date range cannot exceed 366 days"
}
},
"invalidGroupBy": {
"summary": "Invalid group_by parameter value",
"value": {
"message": "Value for 'group_by' not supported. Allowed: '', 'key', 'key_and_day'."
}
}
}
}
}
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/admin/developer-keys": {
"post": {
"tags": [
"AdminApi"
],
"summary": "Create a developer key as an admin",
"operationId": "adminCreateDeveloperKey",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"label": {
"$ref": "#/components/schemas/ApiKeyLabel"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The create function returns a JSON representation of the created API key.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"auth_header": []
}
]
},
"get": {
"tags": [
"AdminApi"
],
"summary": "Get all developer keys as an admin",
"operationId": "adminGetDeveloperKeys",
"responses": {
"200": {
"description": "The get function returns a JSON representation of all developer API keys in the organization.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/admin/developer-keys/deactivate": {
"put": {
"tags": [
"AdminApi"
],
"summary": "Deactivate a developer key as an admin",
"operationId": "adminDeactivateDeveloperKey",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"key_id"
],
"properties": {
"key_id": {
"$ref": "#/components/schemas/ApiKeyId"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The deactivate function returns a JSON representation of the deactivated API key.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/admin/developer-keys/label": {
"put": {
"tags": [
"AdminApi"
],
"summary": "Rename a developer key as an admin",
"operationId": "adminRenameDeveloperKey",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"key_id",
"label"
],
"properties": {
"key_id": {
"$ref": "#/components/schemas/ApiKeyId"
},
"label": {
"type": "string",
"description": "API key label.",
"example": "developer key prod"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The set label function returns a JSON representation of the renamed API key.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/admin/developer-keys/limits": {
"put": {
"tags": [
"AdminApi"
],
"summary": "Set developer key usage limits as an admin",
"operationId": "adminSetDeveloperKeyUsageLimits",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"key_id"
],
"properties": {
"key_id": {
"$ref": "#/components/schemas/ApiKeyId"
},
"characters": {
"$ref": "#/components/schemas/ApiKeyUsageCharacters"
},
"speech_to_text_milliseconds": {
"$ref": "#/components/schemas/ApiKeyUsageSpeechToTextMilliseconds"
}
}
}
}
}
},
"responses": {
"200": {
"description": "The set usage limits function returns a JSON representation of the modified API key.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKey"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/translate": {
"post": {
"tags": [
"TranslateText"
],
"summary": "Request Translation",
"operationId": "translateText",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"text",
"target_lang"
],
"properties": {
"text": {
"description": "Text to be translated. Only UTF-8-encoded plain text is supported. The parameter may be specified\nmany times in a single request, within the request size limit (128KiB). Translations are returned\nin the same order as they are requested. Each text in the array is translated independently — texts\ndo not share context with each other.",
"type": "array",
"items": {
"type": "string",
"example": "Hello, World!"
}
},
"source_lang": {
"$ref": "#/components/schemas/SourceLanguage"
},
"target_lang": {
"$ref": "#/components/schemas/TargetLanguage"
},
"context": {
"$ref": "#/components/schemas/Context"
},
"show_billed_characters": {
"$ref": "#/components/schemas/ShowBilledCharacters"
},
"split_sentences": {
"$ref": "#/components/schemas/SplitSentencesOption"
},
"preserve_formatting": {
"$ref": "#/components/schemas/PreserveFormattingOption"
},
"formality": {
"$ref": "#/components/schemas/Formality"
},
"model_type": {
"$ref": "#/components/schemas/ModelType"
},
"glossary_id": {
"description": "Specify the glossary to use for the translation. **Important:** This requires the `source_lang`\nparameter to be set. The language pair of the glossary has to match the language pair of the\nrequest.",
"type": "string",
"example": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7"
},
"style_id": {
"description": "Specify the [style rule list](/api-reference/style-rules) to use for the translation. \n\n**Important:** The target language has to match the language of the style rule list. \n\n**Note:** Any request with the `style_id` parameter enabled will use `quality_optimized` models. Requests combining `style_id` and `model_type: latency_optimized` will be rejected.",
"type": "string",
"example": "7ff9bfd6-cd85-4190-8503-d6215a321519"
},
"translation_memory_id": {
"$ref": "#/components/schemas/TranslationMemoryId"
},
"translation_memory_threshold": {
"$ref": "#/components/schemas/TranslationMemoryThreshold"
},
"custom_instructions": {
"description": "Specify a list of instructions to customize the translation behavior. Up to 10 custom instructions can be specified, each with a maximum of 300 characters.\n\n**Important:** The target language must be `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `zh` or any variants of these languages.\n\n**Note:** Any request with the `custom_instructions` parameter enabled will default to use the `quality_optimized` model type. Requests combining `custom_instructions` and `model_type: latency_optimized` will be rejected.",
"type": "array",
"items": {
"type": "string",
"example": "Use a friendly, diplomatic tone"
}
},
"tag_handling": {
"$ref": "#/components/schemas/TagHandlingOption"
},
"tag_handling_version": {
"$ref": "#/components/schemas/TagHandlingVersionOption"
},
"outline_detection": {
"$ref": "#/components/schemas/OutlineDetectionOption"
},
"enable_beta_languages": {
"description": "No languages are currently in beta. This parameter is maintained for backward compatibility and has no effect.",
"type": "boolean",
"default": false
},
"non_splitting_tags": {
"description": "Comma-separated list of XML tags which never split sentences.",
"type": "array",
"items": {
"type": "string",
"example": "non_splitting_tag"
}
},
"splitting_tags": {
"description": "Comma-separated list of XML tags which always cause splits.",
"type": "array",
"items": {
"type": "string",
"example": "splitting_tag"
}
},
"ignore_tags": {
"description": "Comma-separated list of XML tags that indicate text not to be translated.",
"type": "array",
"items": {
"type": "string",
"example": "ignore_tag"
}
}
}
}
},
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"required": [
"text",
"target_lang"
],
"properties": {
"text": {
"description": "Text to be translated. Only UTF-8-encoded plain text is supported. The parameter may be specified many times in a single request, within the request size limit (128KiB). Translations are returned in the same order as they are requested. Each text in the array is translated independently — texts do not share context with each other.",
"type": "array",
"items": {
"type": "string",
"example": "Hello, World!"
}
},
"source_lang": {
"$ref": "#/components/schemas/SourceLanguage"
},
"target_lang": {
"$ref": "#/components/schemas/TargetLanguage"
},
"context": {
"$ref": "#/components/schemas/Context"
},
"show_billed_characters": {
"$ref": "#/components/schemas/ShowBilledCharacters"
},
"split_sentences": {
"$ref": "#/components/schemas/SplitSentencesOption"
},
"preserve_formatting": {
"$ref": "#/components/schemas/PreserveFormattingOptionStr"
},
"formality": {
"$ref": "#/components/schemas/Formality"
},
"model_type": {
"$ref": "#/components/schemas/ModelType"
},
"glossary_id": {
"description": "Specify the glossary to use for the translation. **Important:** This requires the `source_lang`\nparameter to be set. The language pair of the glossary has to match the language pair of the\nrequest.",
"type": "string",
"example": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7"
},
"translation_memory_id": {
"$ref": "#/components/schemas/TranslationMemoryId"
},
"translation_memory_threshold": {
"$ref": "#/components/schemas/TranslationMemoryThreshold"
},
"tag_handling": {
"$ref": "#/components/schemas/TagHandlingOption"
},
"outline_detection": {
"$ref": "#/components/schemas/OutlineDetectionOptionStr"
},
"enable_beta_languages": {
"description": "No languages are currently in Beta. This parameter is maintained for backward compatibility and has no effect. Previously enabled 81 languages that are now part of the standard language list. See the [full list](/docs/getting-started/supported-languages).",
"type": "boolean",
"default": false
},
"non_splitting_tags": {
"description": "Comma-separated list of XML tags which never split sentences.",
"type": "array",
"items": {
"type": "string",
"example": "non_splitting_tag"
}
},
"splitting_tags": {
"description": "Comma-separated list of XML tags which always cause splits.",
"type": "array",
"items": {
"type": "string",
"example": "splitting_tag"
}
},
"ignore_tags": {
"description": "Comma-separated list of XML tags that indicate text not to be translated.",
"type": "array",
"items": {
"type": "string",
"example": "ignore_tag"
}
}
}
},
"encoding": {
"text": {
"style": "form",
"explode": true
}
}
}
}
},
"responses": {
"200": {
"description": "The translate function returns a JSON representation of the translations in the order the text parameters have been specified.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"translations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"detected_source_language": {
"description": "The language detected in the source text. It reflects the value of the `source_lang` parameter, when specified.",
"type": "string",
"example": "EN"
},
"text": {
"description": "The translated text.",
"type": "string",
"example": "Hallo, Welt!"
},
"billed_characters": {
"description": "Number of characters counted by DeepL for billing purposes. Only present if the show_billed_characters parameter is set to true.",
"type": "integer",
"example": 42
},
"model_type_used": {
"description": "Indicates the translation model used. Only present if model_type parameter is included in the request.",
"type": "string",
"example": "quality_optimized"
}
}
}
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"414": {
"$ref": "#/components/responses/URITooLong"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/document": {
"post": {
"tags": [
"TranslateDocuments"
],
"summary": "Upload and Translate a Document",
"operationId": "translateDocument",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"examples": {
"Basic": {
"summary": "Basic Document Translation",
"value": {
"target_lang": "DE",
"file": "@document.docx"
}
},
"Glossary": {
"summary": "Using a Glossary",
"value": {
"source_lang": "EN",
"target_lang": "DE",
"file": "@document.docx",
"glossary_id": "[yourGlossaryId]"
}
}
},
"schema": {
"type": "object",
"required": [
"target_lang",
"file"
],
"properties": {
"source_lang": {
"$ref": "#/components/schemas/SourceLanguage"
},
"target_lang": {
"$ref": "#/components/schemas/TargetLanguage"
},
"file": {
"type": "string",
"format": "binary",
"description": "The document file to be translated. The file name should be included in this part's content disposition. As an alternative, the filename parameter can be used. The following file types and extensions are supported:\n * `docx` - Microsoft Word Document\n * `pptx` - Microsoft PowerPoint Document\n * `xlsx` - Microsoft Excel Document\n * `pdf` - Portable Document Format\n * `htm / html` - HTML Document\n * `txt` - Plain Text Document\n * `xlf / xliff` - XLIFF Document, version 2.1\n * `srt` - SRT Document\n * `jpeg` / `jpg` / `png` - Image (currently in beta)"
},
"filename": {
"type": "string",
"description": "The name of the uploaded file. Can be used as an alternative to including the file name in the file part's content disposition."
},
"output_format": {
"type": "string",
"description": "File extension of desired format of translated file, for example: `docx`. If unspecified, by default the translated file will be in the same format as the input file.\n"
},
"formality": {
"$ref": "#/components/schemas/Formality"
},
"glossary_id": {
"$ref": "#/components/schemas/GlossaryId"
},
"enable_beta_languages": {
"description": "No languages are currently in Beta. This parameter is maintained for backward compatibility and has no effect. Previously enabled 81 languages that are now part of the standard language list. See the [full list](/docs/getting-started/supported-languages).",
"type": "boolean",
"default": false
}
}
}
}
}
},
"responses": {
"200": {
"description": "The document function returns a JSON object containing the ID and encryption key assigned to the uploaded document. Once received by the server, uploaded documents are immediately encrypted using a uniquely generated encryption key. This key is not persistently stored on the server. Therefore, it must be stored by the client and sent back to the server with every subsequent request that refers to this particular document.",
"headers": {
"X-Trace-ID": {
"$ref": "#/components/headers/X-Trace-ID"
}
},
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"document_id": {
"description": "A unique ID assigned to the uploaded document and the translation process. Must be used when referring to this particular document in subsequent API requests.",
"type": "string",
"example": "04DE5AD98A02647D83285A36021911C6"
},
"document_key": {
"description": "A unique key that is used to encrypt the uploaded document as well as the resulting translation on the server side. Must be provided with every subsequent API request regarding this particular document.",
"type": "string",
"example": "0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
}
}
},
"example": {
"document_id": "04DE5AD98A02647D83285A36021911C6",
"document_key": "0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"504": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/v2/document/{document_id}": {
"post": {
"tags": [
"TranslateDocuments"
],
"summary": "Check Document Status",
"operationId": "getDocumentStatus",
"parameters": [
{
"$ref": "#/components/parameters/DocumentID"
}
],
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/DocumentKey"
},
"examples": {
"basic": {
"summary": "Basic",
"value": {
"document_key": "0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
}
}
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DocumentKey"
}
}
}
},
"responses": {
"200": {
"description": "The document status request returns a JSON object containing the document ID that was used in the request as well as string indicating the current status of the translation process. While the translation is running, the estimated number of seconds remaining until the process is done is also included in the response.",