-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.v3.yaml
995 lines (944 loc) · 26.1 KB
/
openapi.v3.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
openapi: 3.0.0
info:
title: Morgen API
description: Morgen REST Api definitions
version: 3.0.0
servers:
- url: https://api.morgen.so
description: Production endpoint
tags:
- name: User
description: Operations on the current user
- name: Accounts
description: Operations on the authenticated accounts
- name: Tasks
description: Operations on Morgen Tasks
- name: Task Lists
description: Operations on Morgen Task Lists
- name: Calendars
description: Operations on calendars
- name: Events
description: Operations on calendar events
- name: Availability
description: Operations on user availability
paths:
"/identity":
get:
operationId: getUserIdentityV1
summary: Get user profile
tags:
- User
security:
- userToken: []
- apiKey: []
responses:
"200":
description: OK
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/UserPropertiesImmutable"
- $ref: "#/components/schemas/UserProperties"
"/identity/update":
post:
operationId: updateUserProfileV1
summary: Update user profile
tags:
- User
security:
- userToken: []
- apiKey: []
requestBody:
description: User fields to be updated
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UserProperties"
responses:
"200":
description: OK
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/UserPropertiesImmutable"
- $ref: "#/components/schemas/UserProperties"
# NOTE: This API makes more sense with account connection routes
"/v3/integrations/list":
get:
operationId: listIntegrationsV3
summary: Get a list of supported services
tags:
- Accounts
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
groups:
$ref: "#/components/schemas/IntegrationGroups"
integrations:
$ref: "#/components/schemas/Integrations"
"/v3/integrations/accounts/list":
get:
operationId: listAccountsV3
summary: Retrieve accounts list
description: Retrieve a list of accounts the user has access to
tags:
- Accounts
security:
- userToken: []
- apiKey: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
accounts:
type: array
items:
$ref: "#/components/schemas/AccountProperties"
"/v3/calendars/list":
get:
operationId: listCalendarsV3
summary: Retrieve a list of calendars the user has access to
description: List all the calendars connected to Morgen.
tags:
- Calendars
security:
- userToken: []
- apiKey: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
accounts:
type: array
items:
$ref: "#/components/schemas/AccountProperties"
calendars:
type: array
items:
allOf:
- $ref: "#/components/schemas/DocumentId"
- $ref: "#/components/schemas/CalendarContextId"
- $ref: "#/components/schemas/CalendarProperties"
"/v3/calendars/update":
post:
operationId: updateCalendarMetadataV3
summary: Update calendar metadata
tags:
- Calendars
security:
- userToken: []
- apiKey: []
requestBody:
description: An calendar update object
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/DocumentId"
- $ref: "#/components/schemas/CalendarContextId"
- $ref: "#/components/schemas/CalendarProperties"
responses:
"204":
description: Update successful
"/v3/events/list":
get:
operationId: listEventsV3
summary: Retrieve events from all calendars
description: >
Retrieve events from all connected calendars, occurring within a given a [`start`, `end`] time window.
tags:
- Events
security:
- userToken: []
- apiKey: []
parameters:
- in: query
name: start
required: true
schema:
type: string
format: datetime
- in: query
name: end
required: true
schema:
type: string
format: datetime
- in: query
name: accountId
required: true
schema:
type: string
- in: query
name: calendarIds
description: >
If a `calendarIds` is specific, only events in the corresponding calendar are returned.
To filter for multiple calendars, use calendar ids separated by a comma, i.e. "calendarId_1,calendarId_2".
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
events:
type: array
items:
allOf:
- $ref: "#/components/schemas/EventProperties"
- $ref: "#/components/schemas/EventContextId"
- $ref: "#/components/schemas/DocumentId"
"/v3/events/create":
post:
operationId: createEventV3
summary: Create a calendar event
tags:
- Events
security:
- userToken: []
- apiKey: []
requestBody:
description: An event object
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/EventContextId"
- $ref: "#/components/schemas/EventProperties"
responses:
"200":
description: OK
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/EventContextId"
- "$ref": "#/components/schemas/EventPropertiesImmutable"
- "$ref": "#/components/schemas/EventProperties"
- "$ref": "#/components/schemas/DocumentId"
- type: object
properties:
"morgen.so:requestVirtualRoom":
type: string
description: "If specified, a virtual video conferencing room will be added to the event. Only supported for O365/Google events."
enum:
- default
"/v3/events/update":
post:
operationId: updateEventV3
summary: Update a calendar event
tags:
- Events
security:
- userToken: []
- apiKey: []
# TODO: Add seriesUpdateMode parameter (currently only single supported anyway)
requestBody:
description: An event object
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/DocumentId"
- "$ref": "#/components/schemas/EventContextId"
- "$ref": "#/components/schemas/EventProperties"
responses:
"204":
description: OK
"/v3/events/delete":
post:
operationId: deleteEventV3
summary: Delete a calendar event
tags:
- Events
security:
- userToken: []
- apiKey: []
requestBody:
description: The identifier of the event to delete
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/EventContextId"
- "$ref": "#/components/schemas/DocumentId"
responses:
"204":
description: OK
"/v2/tasks/list":
get:
operationId: listTasksV2
summary: Retrieve tasks
tags:
- Tasks
security:
- userToken: []
- apiKey: []
parameters:
- in: query
name: title
description: Filter on the title of the task. Optional.
schema:
type: string
- in: query
name: limit
description: Limit the numer of tasks returned. Optional.
schema:
type: number
default: 1
- in: query
name: showCompleted
description: Flag indicating whether deleted tasks are returned in
the result. Value of true NOT supported for 3rd-parties. Optional.
The default is False.
schema:
type: boolean
- in: query
name: updatedAfter
description:
Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by.
Optional. When used, `summary` and `showCompleted` are ignored.
schema:
type: string
format: datetime
- in: query
name: serviceName
description: Required for external tasks. Optional. By default returns Morgen tasks.
schema:
type: string
enum:
- googleTasks
- microsoftOutlook
- microsoftToDo
- morgen
- todoist
- in: query
name: accountId
description: Required for external tasks. Optional. By default returns Morgen tasks.
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
allOf:
- "$ref": "#/components/schemas/DocumentId"
- "$ref": "#/components/schemas/TaskContextId"
- "$ref": "#/components/schemas/TaskProperties"
"/v2/tasks/create":
post:
operationId: createTaskV2
summary: Create a Morgen task
tags:
- Tasks
security:
- userToken: []
- apiKey: []
requestBody:
description: Create a task in Morgen
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/TaskCreateProperties"
responses:
"200":
description: OK
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/DocumentId"
- "$ref": "#/components/schemas/TaskContextId"
"/v2/tasks/update":
post:
operationId: updateTaskV2
summary: Update a task
tags:
- Tasks
security:
- userToken: []
- apiKey: []
requestBody:
description: A task patch object. All properties are optional. Only "status" can be updated for external tasks.
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/DocumentId"
- "$ref": "#/components/schemas/TaskContextId"
- "$ref": "#/components/schemas/TaskProperties"
responses:
"204":
description: OK
"/v2/tasks/delete":
post:
operationId: deleteTaskV2
summary: Delete a task
tags:
- Tasks
security:
- userToken: [ ]
- apiKey: [ ]
requestBody:
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/DocumentId"
responses:
"204":
description: OK
"/v2/tasks/close":
post:
operationId: closeTaskV2
summary: Close a task
tags:
- Tasks
security:
- userToken: []
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/DocumentId"
- "$ref": "#/components/schemas/TaskContextId"
responses:
"204":
description: OK
"/v2/tasks/reopen":
post:
operationId: reopenTaskV2
summary: Reopen a task
tags:
- Tasks
security:
- userToken: []
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/TaskContextId"
- "$ref": "#/components/schemas/DocumentId"
responses:
"204":
description: OK
"/v2/taskLists/list":
get:
operationId: listTaskListsV2
summary: Retrieve task lists
description:
Retrieve task lists from Morgen or third-party tasks providers (e.g. Todoist).
Notice that the notion of a list might map to a different entity on other providers.
tags:
- Task Lists
security:
- userToken: []
- apiKey: []
parameters:
- in: query
name: title
schema:
type: string
- in: query
name: limit
schema:
type: number
default: 1
- in: query
name: updatedAfter
description:
Lower bound for a task list's last modification time (as a RFC 3339 timestamp) to filter by.
Optional. When used, `summary` is ignored.
schema:
type: string
format: datetime
- in: query
name: serviceName
description: Required for external task services
schema:
type: string
- in: query
name: accountId
description: Required for external task services
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
allOf:
- $ref: "#/components/schemas/DocumentId"
- $ref: "#/components/schemas/TaskListContextId"
- $ref: "#/components/schemas/TaskListProperty"
"/v2/taskLists/create":
post:
operationId: createTaskListV2
summary: Create a task list in Morgen
description: Create a new task list in Morgen. Currently it is not possible to create lists on third-party task apps with this API.
tags:
- Task Lists
security:
- userToken: []
- apiKey: []
requestBody:
description: A task list
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/TaskListProperty"
responses:
"200":
description: OK
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/DocumentId"
- $ref: "#/components/schemas/TaskListContextId"
"/v2/taskLists/update":
post:
operationId: updateTaskListV2
summary: Update a task list in Morgen
description: Update a Morgen task list.
tags:
- Task Lists
security:
- userToken: [ ]
- apiKey: [ ]
requestBody:
description: A task list
required: true
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/DocumentId"
- $ref: "#/components/schemas/TaskListUpdateProperty"
responses:
"204":
description: OK
"/v2/taskLists/delete":
post:
operationId: deleteTaskListV2
summary: Delete a task list
tags:
- Task Lists
security:
- userToken: [ ]
- apiKey: [ ]
requestBody:
required: true
content:
application/json:
schema:
allOf:
- "$ref": "#/components/schemas/DocumentId"
responses:
"204":
description: OK
"/v3/availability/list":
get:
operationId: listAvailabilityV3
summary: List availability of team members or the requesting user
tags:
- Availability
security:
- userToken: [ ]
- apiKey: [ ]
parameters:
- in: query
name: start
description: ISO datetime string, with no time zone information e.g. "2023-09-04T15:11:22"
schema:
type: string
- in: query
name: end
description: ISO datetime string, with no time zone information e.g. "2023-09-04T15:11:22"
schema:
type: string
- in: query
name: queryIds
description: The IDs of users to query, must be the current user or members of the user's team.
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
required:
- participants
properties:
participants:
type: object
additionalProperties:
type: object
properties:
events:
type: array
items:
allOf:
- $ref: "#/components/schemas/DocumentId"
- $ref: "#/components/schemas/EventContextId"
- $ref: "#/components/schemas/EventPropertiesImmutable"
- $ref: "#/components/schemas/EventProperties"
components:
securitySchemes:
userToken:
type: http
scheme: bearer
bearerFormat: JWT
apiKey:
type: apiKey
in: header
name: Authorization
description: Use format "ApiKey XXXXXXXXXX"
responses:
UnauthorizedError:
description: Credentials missing or invalid
schemas:
DocumentId:
type: object
required:
- id
properties:
id:
type: string
EventContextId:
type: object
required:
- calendarId
- accountId
properties:
calendarId:
type: string
accountId:
type: string
EventPropertiesImmutable:
type: object
properties:
# TODO: Add other IDs
uid:
type: string
serviceName:
type: string
enum:
- google
- o365
EventProperties:
type: object
properties:
title:
type: string
description:
type: string
locations:
type: object
additionalProperties:
type: object
properties:
name:
type: string
start:
# TODO: Mark as ISO datetime string
type: string
description: ISO datetime string, with no time zone information e.g. "2023-09-04T15:11:22"
duration:
# TODO: Mark as ISO duration string
type: string
description: ISO duration string e.g. "PT10M"
timeZone:
type: string
description: ISO timezone e.g. "Europe/Zurich"
showWithoutTime:
type: boolean
description: If true, this is an all-day event
participants:
type: object
# TODO: Specify JSCalendar participants here
#status:
# type: string
# enum:
# - confirmed
# - tentative
# - cancelled
freeBusyStatus:
description: Indicates whether the participants are available during the event.
type: string
# TODO: Expand these
enum:
- free
- busy
- ooo
privacy:
type: string
enum:
- public
- private
"morgen.so:metadata":
type: object
properties:
taskId:
type: string
TaskContextId:
type: object
properties:
serviceName:
description: Required for external tasks
type: string
accountId:
description: Required for external tasks
type: string
TaskCreateProperties:
type: object
required:
- title
properties:
title:
type: string
description:
type: string
descriptionContentType:
type: string
enum:
- text/plain
- text/html
due:
type: string
estimatedDuration:
type: string
priority:
type: number
maximum: 9
minimum: 0
progress:
type: string
enum:
- needs-action
- completed
taskListId:
type: string
TaskProperties:
type: object
properties:
title:
type: string
description:
type: string
descriptionContentType:
type: string
enum:
- text/plain
- text/html
due:
type: string
estimatedDuration:
type: string
priority:
type: number
maximum: 9
minimum: 0
progress:
type: string
enum:
- needs-action
- completed
position:
type: number
taskListId:
type: string
CalendarContextId:
type: object
required:
- serviceName
- accountId
properties:
serviceName:
type: string
accountId:
type: string
CalendarProperties:
type: object
properties:
name:
type: string
color:
type: string
defaultAlertsWithoutTime:
type: object
defaultAlertsWithTime:
type: object
'morgen.so:metadata':
type: object
properties:
busy:
type: boolean
description: Indiciates whether an event in this calendar
represents an interval where the user is busy.
overrideName:
type: string
description: Name of the calendar as provided in the Morgen
interface, overriding the name provided by the external
provider
overrideColor:
type: string
description: Hex color as provided in the Morgen interface,
overriding the color provided by the external provider
TaskListProperty:
type: object
required:
- name
properties:
name:
type: string
color:
type: string
TaskListUpdateProperty:
type: object
required:
# TODO: Not sure why this is mandatory, but it is
- name
properties:
name:
type: string
color:
type: string
TaskListContextId:
type: object
properties:
serviceName:
description: Required for external tasks
type: string
accountId:
description: Required for external tasks
type: string
UserPropertiesImmutable:
# TODO: Add more fields here
type: object
required:
- _id
- email
- username
properties:
_id:
type: string
username:
type: string
email:
type: string
UserProperties:
type: object
properties:
firstName:
type: string
lastName:
type: string
company:
type: string
preferences:
nullable: true
type: object
properties:
workingHours:
nullable: true
type: array
items:
type: string
example: 'MO/0900/1800'
IntegrationGroups:
type: array
items:
properties:
type:
type: string
enum:
- webhooks
- video_conf
- tasks
displayName:
type: string
Integrations:
type: array
items:
type: object
properties:
id:
type: string
authId:
type: string
displayName:
type: string
iconData:
type: string
AccountProperties:
type: object
properties:
id:
type: string
description: Morgen ID for the account object
integrationId:
type: string
description: The identifier of the third-party service
providerId:
type: string
description: The user account id for the third-party service
providerUserId:
type: string
description: The user id on the third-party service