-
Notifications
You must be signed in to change notification settings - Fork 30
/
openapi.yaml
2038 lines (1956 loc) · 76.2 KB
/
openapi.yaml
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.
termsOfService: https://www.deepl.com/pro-license
contact:
name: DeepL - Contact us
url: https://www.deepl.com/contact-us
version: 2.17.0
externalDocs:
description: DeepL Pro - Plans and pricing
url: https://www.deepl.com/pro#developer
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.
To 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 and supports the following file types and extensions:
* `docx` - Microsoft Word Document
* `pptx` - Microsoft PowerPoint Document
* `xlsx` - Microsoft Excel Document
* `pdf` - Portable Document Format
* `htm / html` - HTML Document
* `txt` - Plain Text Document
* `xlf / xliff` - XLIFF Document, version 2.1
* `srt` - SRT Document
Please note that with every submitted document of type .pptx, .docx, .xlsx, or .pdf,
you are billed a minimum of 50,000 characters with the DeepL API plan,
no matter how many characters are included in the document.
Translating a document usually involves three types of HTTP requests:
- [upload](https://www.deepl.com/docs-api/documents/translate-document) the document to be translated,
- periodically [check the status](https://www.deepl.com/docs-api/documents/get-document-status) of the document translation,
- once the status call reports `done`, [download](https://www.deepl.com/docs-api/documents/download-document) the translated document.
To 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.
Glossaries created with the glossary function can be used in translate requests by specifying the
`glossary_id` parameter.
If you encounter issues, please let us know at [email protected].
The DeepL API supports glossaries in any combination of two languages from the following list, enabling a total of
120 possible glossary language pairs:
- DA (Danish)
- DE (German)
- EN (English)
- ES (Spanish)
- FR (French)
- IT (Italian)
- JA (Japanese)
- KO (Korean)
- NB (Norwegian (bokmål))
- NL (Dutch)
- PL (Polish)
- PT (Portuguese)
- RO (Romanian)
- RU (Russian)
- SV (Swedish)
- ZH (Chinese)
The maximum size limit for a glossary is 10 MiB = 10485760 bytes and each source/target text,
as well as the name of the glossary, is limited to 1024 UTF-8 bytes.
A total of 1000 glossaries are allowed per account.
When creating a glossary with target language `EN`, `PT`, or `ZH`, it's not necessary to specify a variant
(e.g. `EN-US`, `EN-GB`, `PT-PT`, `PT-BR`, or `ZH-HANS`).
Glossaries with target language `EN` can be used in translations with either English variant.
Similarly `PT`, and `ZH` glossaries can be used in translations with their corresponding variants.
Glossaries created via the DeepL API are distinct from glossaries created via the DeepL website and DeepL apps.
This means API glossaries cannot be used on the website and vice versa.
Note that glossaries are immutable: once created, the glossary entries for a given glossary ID cannot be modified.
As a workaround for effectively editable glossaries, we suggest to identify glossaries by name instead of ID in your application
and then use the following procedure for modifications:
- [download](https://www.deepl.com/docs-api/glossaries/get-glossary-entries) and store the current glossary's entries,
- locally modify the glossary entries,
- [delete](https://www.deepl.com/docs-api/glossaries/delete-glossary) the existing glossary,
- [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.
The total request body size must not exceed 128 KiB (128 · 1024 bytes). Please split up your text into multiple
calls if it exceeds this limit.
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
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
example: Hello, World!
source_lang:
$ref: '#/components/schemas/SourceLanguageText'
target_lang:
$ref: '#/components/schemas/TargetLanguageText'
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:
allOf:
- $ref: '#/components/schemas/GlossaryId'
- 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:
$ref: '#/components/schemas/TagHandlingOption'
outline_detection:
$ref: '#/components/schemas/OutlineDetectionOption'
non_splitting_tags:
$ref: '#/components/schemas/NonSplittingTagList'
splitting_tags:
$ref: '#/components/schemas/SplittingTagList'
ignore_tags:
$ref: '#/components/schemas/IgnoreTagList'
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/SourceLanguageText'
target_lang:
$ref: '#/components/schemas/TargetLanguageText'
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:
allOf:
- $ref: '#/components/schemas/GlossaryId'
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.
tag_handling:
$ref: '#/components/schemas/TagHandlingOption'
outline_detection:
$ref: '#/components/schemas/OutlineDetectionOptionStr'
non_splitting_tags:
$ref: '#/components/schemas/NonSplittingTagCommaSeparatedList'
splitting_tags:
$ref: '#/components/schemas/SplittingTagCommaSeparatedList'
ignore_tags:
$ref: '#/components/schemas/IgnoreTagCommaSeparatedList'
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
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
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
examples:
Basic:
value:
translations:
- detected_source_language: EN
text: Hallo, Welt!
billed_characters: 42
Glossary:
value:
translations:
- text: Hallo, Welt!
MultipleSentences:
value:
translations:
- detected_source_language: EN
text: Der Tisch ist grün. 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.
The call returns once the upload is complete, returning a document ID and key which can be used to
[query the translation status](https://www.deepl.com/docs-api/documents/get-document-status)
and to [download the translated document](https://www.deepl.com/docs-api/documents/download-document) once translation is complete.
Because the request includes a file upload, it must be an HTTP POST request with content type `multipart/form-data`.
Please be aware that the uploaded document is automatically removed from the server once the translated document has been downloaded.
You have to upload the document again in order to restart the translation.
The maximum upload limit for documents is [available here](https://support.deepl.com/hc/articles/360020582359-Document-formats)
and may vary based on API plan and document type.
You may specify the glossary to use for the document translation using the `glossary_id` parameter.
**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:
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:
* `docx` - Microsoft Word Document
* `pptx` - Microsoft PowerPoint Document
* `xlsx` - Microsoft Excel Document
* `pdf` - Portable Document Format
* `htm / html` - HTML Document
* `txt` - Plain Text Document
* `xlf / xliff` - XLIFF Document, version 2.1
* `srt` - SRT Document
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.
Note: Not all combinations of input file and translation file extensions are permitted. See [Document Format Conversions](https://www.deepl.com/docs-api/documents/format-conversions) for the permitted combinations.
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.
If the translation is still in progress, the estimated time remaining is also included in the response.
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.
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:
* `queued` - the translation job is waiting in line to be processed
* `translating` - the translation is currently ongoing
* `done` - the translation is done and the translated document is ready for download
* `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.
This parameter is only included while `status` is `"translating"`.
type: integer
billed_characters:
description: The number of characters billed to your account.
The characters will only be billed after a successful download
request.
type: integer
error_message:
description: |-
A short description of the error, if available.
Note that the content is subject to change.
This 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.
For 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:
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 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/json:
schema:
$ref: '#/components/schemas/CreateGlossaryParameters'
examples:
Basic:
value:
name: My Glossary
source_lang: en
target_lang: de
entries: "Hello\tGuten Tag"
entries_format: tsv
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/CreateGlossaryParameters'
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'
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}/entries:
get:
tags:
- ManageGlossaries
summary: Retrieve Glossary Entries
operationId: getGlossaryEntries
description: List the entries of a single glossary in the format specified by
the `Accept` header.
parameters:
- $ref: '#/components/parameters/GlossaryID'
- name: Accept
in: header
schema:
type: string
enum:
- text/tab-separated-values
default: text/tab-separated-values
description: The requested format of the returned glossary entries. Currently,
supports only `text/tab-separated-values`.
examples:
tsv:
summary: Tab-separated Values
value:
in: header
Accept: text/tab-separated-values
responses:
200:
description: The entries in the requested format.
content:
text/tab-separated-values:
example: "Hello!\tGuten Tag!"
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: []
/usage:
get:
tags:
- MetaInformation
summary: Check Usage and Limits
description: |-
Retrieve usage information within the current billing period together with the corresponding account limits. Usage is returned for:
- translated characters
- translated documents
- translated documents, team totals (for team accounts only)
Character usage includes both text and document translations, and is measured by the source text length in Unicode code points,
so for example "A", "Δ", "あ", and "深" are each counted as a single character.
Document usage only includes document translations, and is measured in individual documents.
Depending on the user account type, some usage types will be omitted.
Character usage is only included for developer accounts.
Document usage is only included for non-developer accounts, and team-combined document usage is only included for non-developer team accounts.
operationId: getUsage
responses:
200:
description: The account's usage and limits.
content:
application/json:
schema:
type: object
properties:
character_count:
description: Characters translated so far in the current billing
period.
type: integer
format: int64
example: 180118
character_limit:
description: Current maximum number of characters that can be
translated per billing period. If cost control is set, the
cost control limit will be returned in this field.
type: integer
format: int64
example: 1250000
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'