forked from DeepLcom/openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.json
1773 lines (1773 loc) · 71 KB
/
openapi.json
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\u2019s machine translation technology.",
"termsOfService": "https://www.deepl.com/pro-license/",
"contact": {
"name": "DeepL - Contact us",
"url": "https://www.deepl.com/contact-us"
},
"version": "2.9.0"
},
"externalDocs": {
"description": "DeepL Pro - Plans and pricing",
"url": "https://www.deepl.com/pro#developer?cta=header-prices/"
},
"servers": [
{
"url": "https://api.deepl.com/v2",
"description": "DeepL API Pro"
},
{
"url": "https://api-free.deepl.com/v2",
"description": "DeepL API Free"
}
],
"tags": [
{
"name": "TranslateText",
"description": "The text-translation API currently consists of a single endpoint, `translate`, which is described below.\n\nTo learn more about context in DeepL API translations, we recommend [this article](https://www.deepl.com/docs-api/general/working-with-context)."
},
{
"name": "TranslateDocuments",
"description": "The document translation API allows you to translate whole documents.\nTranslating a document usually involves three types of HTTP requests:\n- [upload](https://www.deepl.com/docs-api/documents/translate-document) the document to be translated,\n- periodically [check the status](https://www.deepl.com/docs-api/documents/get-document-status) of the document translation,\n- once the status call reports `done`, [download](https://www.deepl.com/docs-api/documents/download-document) the translated document.\n\nPlease note that with every submitted document of type .pptx, .docx, or .pdf,\nyou are billed a minimum of 50,000 characters with the DeepL API plan,\nno matter how many characters are included in the document.\n\nTo learn more about context in DeepL API translations, we recommend [this article](https://www.deepl.com/docs-api/general/working-with-context)."
},
{
"name": "ManageGlossaries",
"description": "The *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 [email protected].\n\nThe DeepL API supports glossaries in any combination of two languages from the following list, enabling a total of\n28 possible glossary language pairs:\n\n- EN (English)\n- DE (German)\n- FR (French)\n- ES (Spanish)\n- JA (Japanese)\n- IT (Italian)\n- PL (Polish)\n- NL (Dutch)\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 glossary with target language `EN`, it's not necessary to specify a variant (e.g. `EN-US` or `EN-GB`).\nGlossaries with target language `EN` can be used in translations with either English variant.\n\n\nGlossaries created via the DeepL API are distinct from glossaries created via the DeepL website and DeepL apps.\nThis means API glossaries cannot be used on the website and vice versa.\n\n\n\nNote that glossaries are immutable: once created, the glossary entries for a given glossary ID cannot be modified.\n\nAs a workaround for effectively editable glossaries, we suggest to identify glossaries by name instead of ID in your application\nand then use the following procedure for modifications:\n- [download](https://www.deepl.com/docs-api/glossaries/get-glossary-entries) and store the current glossary's entries,\n- locally modify the glossary entries,\n- [delete](https://www.deepl.com/docs-api/glossaries/delete-glossary) the existing glossary,\n- [create a new glossary](https://www.deepl.com/docs-api/glossaries/create-glossary) with the same name."
},
{
"name": "MetaInformation",
"description": "Information about API usage and value ranges"
}
],
"paths": {
"/translate": {
"post": {
"tags": [
"TranslateText"
],
"summary": "Request Translation",
"operationId": "translateText",
"description": "The translate function.\n\n\nThe total request body size must not exceed 128 KiB (128 \u00b7 1024 bytes). Please split up your text into multiple\ncalls if it exceeds this limit.",
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"examples": {
"Basic": {
"summary": "Basic Example",
"value": {
"text": [
"Hello, world!"
],
"target_lang": "DE"
}
},
"Glossary": {
"summary": "Using a Glossary",
"value": {
"text": [
"Hello, world!"
],
"target_lang": "DE",
"source_lang": "EN",
"glossary_id": "[yourGlossaryId]"
}
},
"MultipleSentences": {
"summary": "Multiple Sentences",
"value": {
"text": [
"The table is green. The chair is black."
],
"target_lang": "DE"
}
},
"LargeVolumes": {
"summary": "Large Volumes of Text",
"value": {
"text": [
"This is the first sentence.",
"This is the second sentence.",
"This is the third sentence."
],
"target_lang": "DE"
}
}
},
"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 multiple times and translations are returned in the same order as they are requested. Each of the parameter values may contain multiple sentences.",
"type": "array",
"items": {
"type": "string"
}
},
"source_lang": {
"$ref": "#/components/schemas/SourceLanguage"
},
"target_lang": {
"$ref": "#/components/schemas/TargetLanguage"
},
"split_sentences": {
"description": "Sets whether the translation engine should first split the input into sentences. For text translations where\n`tag_handling` is not set to `html`, the default value is `1`, meaning the engine splits on punctuation and on newlines.\n\nFor text translations where `tag_handling=html`, the default value is `nonewlines`, meaning the engine splits on punctuation only, ignoring newlines.\n\nThe use of `nonewlines` as the default value for text translations where `tag_handling=html` is new behavior that was implemented in November 2022,\nwhen HTML handling was moved out of beta.\n\nPossible values are:\n\n * `0` - no splitting at all, whole input is treated as one sentence\n * `1` (default when `tag_handling` is not set to `html`) - splits on punctuation and on newlines\n * `nonewlines` (default when `tag_handling=html`) - splits on punctuation only, ignoring newlines\n\nFor applications that send one sentence per text parameter, we recommend setting `split_sentences` to `0`, in order to prevent the engine from splitting the sentence unintentionally.\n\n\nPlease note that newlines will split sentences when `split_sentences=1`. We recommend cleaning files so they don't contain breaking sentences or setting the parameter `split_sentences` to `nonewlines`.",
"type": "string",
"enum": [
"0",
"1",
"nonewlines"
],
"default": "1"
},
"preserve_formatting": {
"description": "Sets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. Possible values are:\n * `0` (default)\n * `1`\n\nThe formatting aspects affected by this setting include:\n * Punctuation at the beginning and end of the sentence\n * Upper/lower case at the beginning of the sentence",
"type": "string",
"enum": [
"0",
"1"
],
"default": "0"
},
"formality": {
"$ref": "#/components/schemas/Formality"
},
"glossary_id": {
"description": "Specify the glossary to use for the translation. **Important:** This requires the `source_lang` parameter to be set and the language pair of the glossary has to match the language pair of the request.",
"type": "string"
},
"tag_handling": {
"description": "Sets which kind of tags should be handled. Options currently available:\n * `xml`: Enable XML tag handling; see [XML Handling](https://www.deepl.com/docs-api/xml).\n * `html`: Enable HTML tag handling; see [HTML Handling](https://www.deepl.com/docs-api/html).",
"type": "string",
"enum": [
"xml",
"html"
]
},
"non_splitting_tags": {
"description": "Comma-separated list of XML tags which never split sentences.\n\n\nFor some XML files, finding tags with textual content and splitting sentences using those tags won't yield the best results. The following example shows the engine splitting sentences on `par` tags and proceeding to translate the parts separately, resulting in an incorrect translation:\n * Example request:\n```\n<par>The firm said it had been </par><par> conducting an internal investigation.</par>\n```\n * Example response:\n```\n<par>Die Firma sagte, es sei eine gute Idee gewesen.</par><par> Durchf\u00fchrung einer internen Untersuchung.</par>\n```\n\n\nAs this can lead to bad translations, this type of structure should either be avoided, or the `non_splitting_tags` parameter should be set. The following example shows the same call, with the parameter set to `par`:\n * Example request:\n```\n<par>The firm said it had been </par><par> conducting an internal investigation.</par>\n```\n * Example response:\n```\n<par>Die Firma sagte, dass sie</par><par> eine interne Untersuchung durchgef\u00fchrt</par><par> habe</par><par>.</par>\n```\n\n\nThis time, the sentence is translated as a whole. The XML tags are now considered markup and copied into the translated sentence. As the translation of the words \"had been\" has moved to another position in the German sentence, the two par tags are duplicated (which is expected here).",
"type": "string"
},
"outline_detection": {
"description": "The automatic detection of the XML structure won't yield best results in all XML files. You can disable this automatic mechanism altogether by setting the `outline_detection` parameter to `0` and selecting the tags that should be considered structure tags. This will split sentences using the `splitting_tags` parameter.\n\n\nIn the example below, we achieve the same results as the automatic engine by disabling automatic detection with `outline_detection=0` and setting the parameters manually to `tag_handling=xml`, `split_sentences=nonewlines`, and `splitting_tags=par,title`.\n * Example request:\n ```\n <document>\n <meta>\n <title>A document's title</title>\n </meta>\n <content>\n <par>This is the first sentence. Followed by a second one.</par>\n <par>This is the third sentence.</par>\n </content>\n </document>\n ```\n * Example response:\n ```\n <document>\n <meta>\n <title>Der Titel eines Dokuments</title>\n </meta>\n <content>\n <par>Das ist der erste Satz. Gefolgt von einem zweiten.</par>\n <par>Dies ist der dritte Satz.</par>\n </content>\n </document>\n ```\nWhile this approach is slightly more complicated, it allows for greater control over the structure of the translation output.",
"type": "string",
"enum": [
"0"
]
},
"splitting_tags": {
"description": "Comma-separated list of XML tags which always cause splits.\n\n\nSee the example in the `outline_detection` parameter's description.",
"type": "string"
},
"ignore_tags": {
"description": "Comma-separated list of XML tags that indicate text not to be translated.\n\n\nUse this paramter to ensure that elements in the original text are not altered in the translation (e.g., trademarks, product names) and insert tags into your original text. In the following example, the `ignore_tags` parameter is set to `keep`:\n * Example request:\n ```\n Please open the page <keep>Settings</keep> to configure your system.\n ```\n * Example response:\n ```\n Bitte \u00f6ffnen Sie die Seite <keep>Settings</keep> um Ihr System zu konfigurieren.\n ```",
"type": "string"
}
}
},
"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.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"translations": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"detected_source_language": {
"allOf": [
{
"$ref": "#/components/schemas/SourceLanguage"
},
{
"description": "The language detected in the source text. It reflects the value of the `source_lang` parameter, when specified."
}
]
},
"text": {
"description": "The translated text.",
"type": "string"
}
}
}
}
}
},
"examples": {
"Basic": {
"value": {
"translations": [
{
"detected_source_language": "EN",
"text": "Hallo, Welt!"
}
]
}
},
"Glossary": {
"value": {
"translations": [
{
"text": "Hallo, Welt!"
}
]
}
},
"MultipleSentences": {
"value": {
"translations": [
{
"detected_source_language": "EN",
"text": "Der Tisch ist gr\u00fcn. Der Stuhl ist schwarz."
}
]
}
},
"LargeVolumes": {
"value": {
"translations": [
{
"detected_source_language": "EN",
"text": "Das ist der erste Satz."
},
{
"detected_source_language": "EN",
"text": "Das ist der zweite Satz."
},
{
"detected_source_language": "EN",
"text": "Dies ist der dritte Satz."
}
]
}
}
}
}
}
},
"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": []
}
]
}
},
"/document": {
"post": {
"tags": [
"TranslateDocuments"
],
"summary": "Upload and Translate a Document",
"operationId": "translateDocument",
"description": "This call uploads a document and queues it for translation.\nThe call returns once the upload is complete, returning a document ID and key which can be used to\n[query the translation status](https://www.deepl.com/docs-api/documents/get-document-status)\nand to [download the translated document](https://www.deepl.com/docs-api/documents/download-document) once translation is complete.\n\n\n\nBecause the request includes a file upload, it must be an HTTP POST request with content type `multipart/form-data`.\n\n\nPlease be aware that the uploaded document is automatically removed from the server once the translated document has been downloaded.\nYou have to upload the document again in order to restart the translation.\n\n\nThe maximum upload limit for documents is [available here](https://support.deepl.com/hc/articles/360020582359-Document-formats)\nand may vary based on API plan and document type.\n\n\nYou may specify the glossary to use for the document translation using the `glossary_id` parameter.\n**Important:** This requires the `source_lang` parameter to be set and the language pair of the glossary has to match the language pair of the request.",
"requestBody": {
"required": true,
"content": {
"multipart/form-data": {
"example": {
"target_lang": "DE"
},
"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 * `pdf` - Portable Document Format\n * `htm / html` - HTML Document\n * `txt` - Plain Text Document\n * `xlf / xliff` - XLIFF Document, version 2.1\n\nPlease note that in order to translate PDF documents you need to give one-time consent to using the Adobe API via the account interface."
},
"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."
},
"formality": {
"$ref": "#/components/schemas/Formality"
},
"glossary_id": {
"$ref": "#/components/schemas/GlossaryId"
}
}
}
}
}
},
"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.",
"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"
},
"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": {
"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": []
}
]
}
},
"/document/{document_id}": {
"post": {
"tags": [
"TranslateDocuments"
],
"summary": "Check Document Status",
"description": "Retrieve the current status of a document translation process.\nIf the translation is still in progress, the estimated time remaining is also included in the response.",
"operationId": "getDocumentStatus",
"parameters": [
{
"$ref": "#/components/parameters/DocumentID"
}
],
"requestBody": {
"$ref": "#/components/requestBodies/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.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"document_id",
"status"
],
"properties": {
"document_id": {
"description": "A unique ID assigned to the uploaded document and the requested translation process. The same ID that was used when requesting the translation status.",
"type": "string"
},
"status": {
"description": "A short description of the state the document translation process is currently in. Possible values are:\n * `queued` - the translation job is waiting in line to be processed\n * `translating` - the translation is currently ongoing\n * `done` - the translation is done and the translated document is ready for download\n * `error` - an irrecoverable error occurred while translating the document",
"type": "string",
"enum": [
"queued",
"translating",
"done",
"error"
]
},
"seconds_remaining": {
"description": "Estimated number of seconds until the translation is done.\nThis parameter is only included while `status` is `\"translating\"`.",
"type": "integer"
},
"billed_characters": {
"description": "The number of characters billed to your account.",
"type": "integer"
},
"error_message": {
"description": "A short description of the error, if available.\nNote that the content is subject to change.\nThis parameter may be included if an error occurred during translation.",
"type": "string"
}
}
},
"examples": {
"translating": {
"summary": "Translating",
"value": {
"document_id": "04DE5AD98A02647D83285A36021911C6",
"status": "translating",
"seconds_remaining": 20
}
},
"done": {
"summary": "Done",
"value": {
"document_id": "04DE5AD98A02647D83285A36021911C6",
"status": "done",
"billed_characters": 1337
}
},
"queued": {
"summary": "Queued",
"value": {
"document_id": "04DE5AD98A02647D83285A36021911C6",
"status": "queued"
}
},
"error": {
"summary": "Error",
"value": {
"document_id": "04DE5AD98A02647D83285A36021911C6",
"status": "error",
"message": "Source and target language are equal."
}
}
}
}
}
},
"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": []
}
]
}
},
"/document/{document_id}/result": {
"post": {
"tags": [
"TranslateDocuments"
],
"summary": "Download Translated Document",
"operationId": "downloadDocument",
"description": "Once the status of the document translation process is `done`, the result can be downloaded.\n\n\nFor privacy reasons the translated document is automatically removed from the server once it was downloaded and cannot be downloaded again.",
"parameters": [
{
"$ref": "#/components/parameters/DocumentID"
}
],
"requestBody": {
"$ref": "#/components/requestBodies/DocumentKey"
},
"responses": {
"200": {
"description": "The document is provided as a download. There is no other data included in the response besides the document data. The content type used in the response corresponds to the document type.",
"content": {
"application/octet-stream": {
"schema": {
"type": "string",
"format": "binary"
},
"examples": {
"OK": {
"summary": "OK",
"description": "binary document data"
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound404DocTransDownload"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable503DocTransDownload"
},
"504": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/glossary-language-pairs": {
"get": {
"tags": [
"ManageGlossaries"
],
"summary": "List Language Pairs Supported by Glossaries",
"description": "Retrieve the list of language pairs supported by the glossary feature.",
"operationId": "listGlossaryLanguages",
"responses": {
"200": {
"description": "A JSON object containing the language pairs in its `supported_languages` property.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"supported_languages": {
"type": "array",
"description": "The list of supported languages",
"items": {
"type": "object",
"required": [
"source_lang",
"target_lang"
],
"properties": {
"source_lang": {
"description": "The language in which the source texts in the glossary are specified.",
"type": "string"
},
"target_lang": {
"description": "The language in which the target texts in the glossary are specified.",
"type": "string"
}
}
}
}
}
},
"example": {
"supported_languages": [
{
"source_lang": "de",
"target_lang": "en"
},
{
"source_lang": "en",
"target_lang": "de"
}
]
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequestGlossaries"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/ForbiddenGlossaries"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"415": {
"$ref": "#/components/responses/UnsupportedMediaTypeGlossaries"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/glossaries": {
"post": {
"tags": [
"ManageGlossaries"
],
"summary": "Create a Glossary",
"operationId": "createGlossary",
"requestBody": {
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"required": [
"name",
"source_lang",
"target_lang",
"entries",
"entries_format"
],
"properties": {
"name": {
"description": "Name to be associated with the glossary.",
"type": "string",
"example": "My Glossary"
},
"source_lang": {
"$ref": "#/components/schemas/GlossarySourceLanguage"
},
"target_lang": {
"$ref": "#/components/schemas/GlossaryTargetLanguage"
},
"entries": {
"description": "The entries of the glossary. The entries have to be specified in the format provided by the `entries_format` parameter.",
"type": "string",
"example": "Hello\tGuten Tag"
},
"entries_format": {
"description": "The format in which the glossary entries are provided. Formats currently available:\n- `tsv` (default) - tab-separated values\n- `csv` - comma-separated values\n\nSee [Supported Glossary Formats](https://www.deepl.com/docs-api/glossaries/formats) for details about each format.",
"type": "string",
"enum": [
"tsv",
"csv"
],
"example": "tsv",
"default": "tsv"
}
}
}
}
}
},
"responses": {
"201": {
"description": "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.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Glossary"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequestGlossaries"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/ForbiddenGlossaries"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"415": {
"$ref": "#/components/responses/UnsupportedMediaTypeGlossaries"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
},
"get": {
"tags": [
"ManageGlossaries"
],
"summary": "List all Glossaries",
"operationId": "listGlossaries",
"description": "List all glossaries and their meta-information, but not the glossary entries.",
"responses": {
"200": {
"description": "JSON object containing a the glossaries.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"glossaries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Glossary"
}
}
}
},
"example": {
"glossaries": [
{
"glossary_id": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7",
"name": "My Glossary",
"ready": true,
"source_lang": "EN",
"target_lang": "DE",
"creation_time": "2021-08-03T14:16:18.329Z",
"entry_count": 1
}
]
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequestGlossaries"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/ForbiddenGlossaries"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"415": {
"$ref": "#/components/responses/UnsupportedMediaTypeGlossaries"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
}
},
"/glossaries/{glossary_id}": {
"get": {
"tags": [
"ManageGlossaries"
],
"summary": "Retrieve Glossary Details",
"description": "Retrieve meta information for a single glossary, omitting the glossary entries.",
"operationId": "getGlossary",
"parameters": [
{
"$ref": "#/components/parameters/GlossaryID"
}
],
"responses": {
"200": {
"description": "JSON object containing the glossary meta-information.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Glossary"
},
"example": {
"glossary_id": "def3a26b-3e84-45b3-84ae-0c0aaf3525f7",
"name": "My Glossary",
"ready": true,
"source_lang": "EN",
"target_lang": "DE",
"creation_time": "2021-08-03T14:16:18.329Z",
"entry_count": 1
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequestGlossaries"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/ForbiddenGlossaries"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"415": {
"$ref": "#/components/responses/UnsupportedMediaTypeGlossaries"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"456": {
"$ref": "#/components/responses/QuotaExceeded"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"503": {
"$ref": "#/components/responses/ServiceUnavailable"
},
"529": {
"$ref": "#/components/responses/TooManyRequests"
}
},
"security": [
{
"auth_header": []
}
]
},
"delete": {
"tags": [
"ManageGlossaries"
],
"summary": "Delete a Glossary",
"description": "Deletes the specified glossary.",
"operationId": "deleteGlossary",
"parameters": [
{
"$ref": "#/components/parameters/GlossaryID"
}
],
"responses": {
"204": {
"description": "Returns no content upon success."
},
"400": {
"$ref": "#/components/responses/BadRequestGlossaries"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/ForbiddenGlossaries"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"413": {
"$ref": "#/components/responses/PayloadTooLarge"
},
"415": {
"$ref": "#/components/responses/UnsupportedMediaTypeGlossaries"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"