-
Notifications
You must be signed in to change notification settings - Fork 4
/
gmail-api-openapi-spec.yaml
1630 lines (1630 loc) · 44 KB
/
gmail-api-openapi-spec.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
agger: "2.0"
info:
title: Gmail
description: Access Gmail mailboxes including sending user email.
contact:
name: Google
url: https://google.com
version: v1
host: www.googleapis.com
basePath: /gmail/v1/users
schemes:
- http
produces:
- application/json
consumes:
- application/json
paths:
/{userId}/drafts:
get:
summary: Get Drafts
description: Lists the drafts in the user's mailbox
operationId: gmail.users.drafts.list
parameters:
- in: query
name: includeSpamTrash
description: Include drafts from SPAM and TRASH in the results
- in: query
name: maxResults
description: Maximum number of drafts to return
- in: query
name: pageToken
description: Page token to retrieve a specific page of results in the list
- in: query
name: q
description: Only return draft messages matching the specified query
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
post:
summary: Update Draft
description: Creates a new draft with the DRAFT label
operationId: gmail.users.drafts.create
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/drafts/send:
post:
summary: Send Draft
description: Sends the specified, existing draft to the recipients in the To,
Cc, and Bcc headers
operationId: gmail.users.drafts.send
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/drafts/{id}:
delete:
summary: Delete Draft
description: Immediately and permanently deletes the specified draft
operationId: gmail.users.drafts.delete
parameters:
- in: path
name: id
description: The ID of the draft to delete
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
get:
summary: Get Draft
description: Gets the specified draft
operationId: gmail.users.drafts.get
parameters:
- in: query
name: format
description: The format to return the draft in
- in: path
name: id
description: The ID of the draft to retrieve
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
put:
summary: Update Draft
description: Replaces a draft's content
operationId: gmail.users.drafts.update
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: id
description: The ID of the draft to update
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/history:
get:
summary: Get History
description: Lists the history of all changes to the given mailbox
operationId: gmail.users.history.list
parameters:
- in: query
name: historyTypes
description: History types to be returned by the function
- in: query
name: labelId
description: Only return messages with a label matching the ID
- in: query
name: maxResults
description: The maximum number of history records to return
- in: query
name: pageToken
description: Page token to retrieve a specific page of results in the list
- in: query
name: startHistoryId
description: Required
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- History
/{userId}/labels:
get:
summary: Get Labels
description: Lists all labels in the user's mailbox
operationId: gmail.users.labels.list
parameters:
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Label
post:
summary: Create Label
description: Creates a new label
operationId: gmail.users.labels.create
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Label
/{userId}/labels/{id}:
delete:
summary: Delete Lbel
description: Immediately and permanently deletes the specified label and removes
it from any messages and threads that it is applied to
operationId: gmail.users.labels.delete
parameters:
- in: path
name: id
description: The ID of the label to delete
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Label
get:
summary: Get Label
description: Gets the specified label
operationId: gmail.users.labels.get
parameters:
- in: path
name: id
description: The ID of the label to retrieve
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Label
patch:
summary: Update Label
description: Updates the specified label
operationId: gmail.users.labels.patch
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: id
description: The ID of the label to update
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Label
put:
summary: Update Label
description: Updates the specified label
operationId: gmail.users.labels.update
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: id
description: The ID of the label to update
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Label
/{userId}/messages:
get:
summary: Get Message
description: Lists the messages in the user's mailbox
operationId: gmail.users.messages.list
parameters:
- in: query
name: includeSpamTrash
description: Include messages from SPAM and TRASH in the results
- in: query
name: labelIds
description: Only return messages with labels that match all of the specified
label IDs
- in: query
name: maxResults
description: Maximum number of messages to return
- in: query
name: pageToken
description: Page token to retrieve a specific page of results in the list
- in: query
name: q
description: Only return messages matching the specified query
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
post:
summary: Create Message
description: Directly inserts a message into only this user's mailbox similar
to IMAP APPEND, bypassing most scanning and classification
operationId: gmail.users.messages.insert
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: query
name: deleted
description: Mark the email as permanently deleted (not TRASH) and only visible
in Google Vault to a Vault administrator
- in: query
name: internalDateSource
description: Source for Gmail's internal date of the message
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/batchDelete:
post:
summary: Delete Messages
description: Deletes many messages by message ID
operationId: gmail.users.messages.batchDelete
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/batchModify:
post:
summary: Update Label
description: Modifies the labels on the specified messages
operationId: gmail.users.messages.batchModify
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/import:
post:
summary: Import Message
description: Imports a message into only this user's mailbox, with standard
email delivery scanning and classification similar to receiving via SMTP
operationId: gmail.users.messages.import
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: query
name: deleted
description: Mark the email as permanently deleted (not TRASH) and only visible
in Google Vault to a Vault administrator
- in: query
name: internalDateSource
description: Source for Gmail's internal date of the message
- in: query
name: neverMarkSpam
description: Ignore the Gmail spam classifier decision and never mark this
email as SPAM in the mailbox
- in: query
name: processForCalendar
description: Process calendar invites in the email and add any extracted meetings
to the Google Calendar for this user
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/send:
post:
summary: Send Message
description: Sends the specified message to the recipients in the To, Cc, and
Bcc headers
operationId: gmail.users.messages.send
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/{id}:
delete:
summary: Delete Message
description: Immediately and permanently deletes the specified message
operationId: gmail.users.messages.delete
parameters:
- in: path
name: id
description: The ID of the message to delete
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
get:
summary: Get Message
description: Gets the specified message
operationId: gmail.users.messages.get
parameters:
- in: query
name: format
description: The format to return the message in
- in: path
name: id
description: The ID of the message to retrieve
- in: query
name: metadataHeaders
description: When given and format is METADATA, only include headers specified
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/{id}/modify:
post:
summary: Modify message
description: Modifies the labels on the specified message
operationId: gmail.users.messages.modify
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: id
description: The ID of the message to modify
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/{id}/trash:
post:
summary: Trash Message
description: Moves the specified message to the trash
operationId: gmail.users.messages.trash
parameters:
- in: path
name: id
description: The ID of the message to Trash
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/{id}/untrash:
post:
summary: UnTrash Message
description: Removes the specified message from the trash
operationId: gmail.users.messages.untrash
parameters:
- in: path
name: id
description: The ID of the message to remove from Trash
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/messages/{messageId}/attachments/{id}:
get:
summary: Get Attachments
description: Gets the specified message attachment
operationId: gmail.users.messages.attachments.get
parameters:
- in: path
name: id
description: The ID of the attachment
- in: path
name: messageId
description: The ID of the message containing the attachment
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- Email
/{userId}/profile:
get:
summary: Get Profile
description: Gets the current user's Gmail profile
operationId: gmail.users.getProfile
parameters:
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- User
/{userId}/settings/autoForwarding:
get:
summary: Get Auto-Forwarding Settings
description: Gets the auto-forwarding setting for the specified account
operationId: gmail.users.settings.getAutoForwarding
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Settings
put:
summary: Update Auto-Forwarding Settings
description: Updates the auto-forwarding setting for the specified account
operationId: gmail.users.settings.updateAutoForwarding
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Settings
/{userId}/settings/filters:
get:
summary: Get Message Filters
description: Lists the message filters of a Gmail user
operationId: gmail.users.settings.filters.list
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Filters
post:
summary: Create Message Filters
description: Creates a filter
operationId: gmail.users.settings.filters.create
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Filters
/{userId}/settings/filters/{id}:
delete:
summary: Delete Message Filter
description: Deletes a filter
operationId: gmail.users.settings.filters.delete
parameters:
- in: path
name: id
description: The ID of the filter to be deleted
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Filters
get:
summary: Get Message Filter
description: Gets a filter
operationId: gmail.users.settings.filters.get
parameters:
- in: path
name: id
description: The ID of the filter to be fetched
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Filters
/{userId}/settings/forwardingAddresses:
get:
summary: Get Forward Addresses
description: Lists the forwarding addresses for the specified account
operationId: gmail.users.settings.forwardingAddresses.list
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Forwarding Address
post:
summary: Create Forward Addresse
description: Creates a forwarding address
operationId: gmail.users.settings.forwardingAddresses.create
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Forwarding Address
/{userId}/settings/forwardingAddresses/{forwardingEmail}:
delete:
summary: Delete Forward Address
description: Deletes the specified forwarding address and revokes any verification
that may have been required
operationId: gmail.users.settings.forwardingAddresses.delete
parameters:
- in: path
name: forwardingEmail
description: The forwarding address to be deleted
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Forwarding Address
get:
summary: GGetet Forward Address
description: Gets the specified forwarding address
operationId: gmail.users.settings.forwardingAddresses.get
parameters:
- in: path
name: forwardingEmail
description: The forwarding address to be retrieved
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Forwarding Address
/{userId}/settings/imap:
get:
summary: Gets IMAP Settings
description: Gets IMAP settings
operationId: gmail.users.settings.getImap
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- IMAP Settings
put:
summary: Update IMAP Setting
description: Updates IMAP settings
operationId: gmail.users.settings.updateImap
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- IMAP Settings
/{userId}/settings/pop:
get:
summary: Gets POP Settings
description: Gets POP settings
operationId: gmail.users.settings.getPop
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- ""
put:
summary: Update IMAP Setting
description: Updates POP settings
operationId: gmail.users.settings.updatePop
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- POP Settings
/{userId}/settings/sendAs:
get:
summary: Send As Alias
description: Lists the send-as aliases for the specified account
operationId: gmail.users.settings.sendAs.list
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Alias
post:
summary: Create Alias
description: Creates a custom "from" send-as alias
operationId: gmail.users.settings.sendAs.create
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Alias
/{userId}/settings/sendAs/{sendAsEmail}:
delete:
summary: Delete Alias
description: Deletes the specified send-as alias
operationId: gmail.users.settings.sendAs.delete
parameters:
- in: path
name: sendAsEmail
description: The send-as alias to be deleted
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Alias
get:
summary: Get Alias
description: Gets the specified send-as alias
operationId: gmail.users.settings.sendAs.get
parameters:
- in: path
name: sendAsEmail
description: The send-as alias to be retrieved
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Alias
patch:
summary: Update Alias
description: Updates a send-as alias
operationId: gmail.users.settings.sendAs.patch
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: sendAsEmail
description: The send-as alias to be updated
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Alias
put:
summary: Update Alias
description: Updates a send-as alias
operationId: gmail.users.settings.sendAs.update
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: sendAsEmail
description: The send-as alias to be updated
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Alias
/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo:
get:
summary: Get S/MIME Configurations
description: Lists S/MIME configs for the specified send-as alias
operationId: gmail.users.settings.sendAs.smimeInfo.list
parameters:
- in: path
name: sendAsEmail
description: The email address that appears in the "From:" header for mail
sent using this alias
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- S/MIME Configuration
post:
summary: Create S/MIME Configurations
description: Insert (upload) the given S/MIME config for the specified send-as
alias
operationId: gmail.users.settings.sendAs.smimeInfo.insert
parameters:
- in: body
name: body
schema:
$ref: '#/definitions/holder'
- in: path
name: sendAsEmail
description: The email address that appears in the "From:" header for mail
sent using this alias
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- S/MIME Configuration
/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}:
delete:
summary: Delete S/MIME Configurations
description: Deletes the specified S/MIME config for the specified send-as alias
operationId: gmail.users.settings.sendAs.smimeInfo.delete
parameters:
- in: path
name: id
description: The immutable ID for the SmimeInfo
- in: path
name: sendAsEmail
description: The email address that appears in the "From:" header for mail
sent using this alias
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- S/MIME Configuration
get:
summary: Get S/MIME Configuration
description: Gets the specified S/MIME config for the specified send-as alias
operationId: gmail.users.settings.sendAs.smimeInfo.get
parameters:
- in: path
name: id
description: The immutable ID for the SmimeInfo
- in: path
name: sendAsEmail
description: The email address that appears in the "From:" header for mail
sent using this alias
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- S/MIME Configuration
/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault:
post:
summary: Create Default S/MIME Configurations
description: Sets the default S/MIME config for the specified send-as alias
operationId: gmail.users.settings.sendAs.smimeInfo.setDefault
parameters:
- in: path
name: id
description: The immutable ID for the SmimeInfo
- in: path
name: sendAsEmail
description: The email address that appears in the "From:" header for mail
sent using this alias
- in: path
name: userId
description: The user's email address
responses:
200:
description: OK
tags:
- S/MIME Configuration
/{userId}/settings/sendAs/{sendAsEmail}/verify:
post:
summary: Send Verification Email
description: Sends a verification email to the specified send-as alias address
operationId: gmail.users.settings.sendAs.verify
parameters:
- in: path
name: sendAsEmail
description: The send-as alias to be verified
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Verification
/{userId}/settings/vacation:
get:
summary: Get Vacation Settings
description: Gets vacation responder settings
operationId: gmail.users.settings.getVacation
parameters:
- in: path
name: userId
description: User's email address
responses:
200:
description: OK
tags:
- Vacation Settings