-
Notifications
You must be signed in to change notification settings - Fork 46
/
openapi.yaml
4591 lines (4576 loc) · 142 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.1
info:
title: MAGE (Mobile Awareness GEOINT Environment) API
description: MAGE API
contact:
name: MAGE Support
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0
version: 6.0.1
servers: []
security:
- mageToken: []
tags:
- name: Auth
- name: Authentication & Authorization
- name: Authentication Configuration
description: Authentication configurations define the strategies used to authenticate users into the system.
- name: Device
- name: Event
- name: Export
- name: Feed
description: >
Feeds are supplemental data sets that participants can add to their active event context.
Feed content could have any combination of spatial, temporal, or informational dimensions.
- name: Icon
- name: Layer
- name: Location
- name: Observation
- name: Role
- name: Settings
- name: Team
- name: User
paths:
/api/logins:
get:
tags: [ Auth ]
description: >
Return an array of user login events. This operation requires
`READ_USER` permission.
operationId: getUserLogins
parameters:
- name: userId
in: query
description: Return only logins for the given `userId`
schema: { $ref: '#/components/schemas/User/properties/id' }
- name: deviceId
in: query
description: Return only logins from the given `deviceId`
schema: { $ref: '#/components/schemas/Device/properties/id' }
- name: startDate
in: query
description: ISO 8601 start date to filter (inclusive)
schema:
type: string
format: date-time
- name: endDate
in: query
description: ISO 8601 end date filter (exclusive)
schema:
type: string
format: date-time
- name: limit
in: query
description: >
Limit the number of results to the given value. The default value
is `10`.
schema:
type: integer
- name: firstLoginId
in: query
description: The ID of the first login in the range of results
schema: { $ref: '#/components/schemas/Login/properties/id' }
- name: lastLoginId
in: query
description: The ID of the last login in the range of results
schema: { $ref: '#/components/schemas/Login/properties/id' }
responses:
200:
description: >
Success - return the array of login events according to the given
query parameters.
content:
application/json:
schema:
type: object
required: [ logins ]
properties:
next:
type: string
format: uri
description: Link to the next chunk of results
prev:
type: string
format: uri
description: Link to the previous chunk of results
logins:
type: array
items: { $ref: '#/components/schemas/Login' }
/api/logout:
post:
tags:
- Auth
description: Invaldate the auth token for the requesting user.
operationId: logout
responses:
200:
description: logout response
/auth/{authenticationStrategy}/signin:
post:
tags: [ Authentication & Authorization ]
summary: Authentication
description: Authenticate a user using a given strategy.
operationId: authenticate
security:
[]
parameters:
- name: authenticationStrategy
in: path
description: Authentication strategy.
required: true
schema:
type: string
enum: [ local, ldap, saml, oauth, openidconnect ]
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/UserIn' }
multipart/form-data:
schema: { $ref: '#/components/schemas/UserIn' }
responses:
200:
description: Successfully signed in.
content:
application/json:
schema: { $ref: '#/components/schemas/Authentication' }
/auth/token:
post:
tags: [ Authentication & Authorization ]
summary: Device Authorization
description: Authorize a device. If device does not exist, it may also be created via this method.
operationId: authorize
security:
- authenticationToken: []
parameters:
- name: uid
in: query
description: Id of the device that requires provisioning
required: true
schema: { $ref: '#/components/schemas/Device/properties/id' }
- name: name
in: query
description: Name of the device
schema: { $ref: '#/components/schemas/Device/properties/name' }
- name: description
in: query
description: Description of the device
schema: { $ref: '#/components/schemas/Device/properties/description' }
- name: appVersion
in: query
description: Application version of the device (required if creating a new device)
schema: { $ref: '#/components/schemas/Device/properties/appVersion' }
requestBody:
required: false
content:
application/json:
schema: { $ref: '#/components/schemas/DeviceIn' }
multipart/form-data:
schema: { $ref: '#/components/schemas/DeviceIn' }
responses:
200:
description: Successful device authorization, MAGE api token is returned.
401:
description: User is not authorized. Typically this means you need to authenticate `/auth/local/signin`.
403:
description: Failure to provision the device. This typically means the device needs to be registered.
/api/authentication/configuration/:
get:
tags: [Authentication Configuration]
summary: Get an array of all authentication configurations
description: Get all authentication configurations. The client must have `READ_AUTH_CONFIG` permission.
operationId: getAllAuthConfigs
parameters:
- { $ref: '#/components/parameters/authenticationConfigurationIncludeDisabled' }
responses:
200:
description: A list of all authentication configurations.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AuthenticationConfiguration'
401:
description: User is not authorized to view authentication configurations.
post:
tags: [Authentication Configuration]
summary: Create a new authentication configuration
description: Create a new authentication configuration. If enabled, it will allow users to use this method.
The client must have `UPDATE_AUTH_CONFIG` permission.
operationId: createNewAuthConfig
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/AuthenticationConfiguration' }
responses:
200:
description: The created authentication configuration
content:
application/json:
schema:
$ref: '#/components/schemas/AuthenticationConfiguration'
401:
description: User is not authorized to create authentication configurations.
/api/authentication/configuration/{id}:
parameters:
- { $ref: '#/components/parameters/authenticationConfigurationIdInPath' }
put:
tags: [ Authentication Configuration ]
summary: Update an authentication configuration
description: >
Update the authentication configuration.
The client must have `UPDATE_AUTH_CONFIG` permission.
operationId: updateAuthConfigById
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/AuthenticationConfiguration' }
responses:
200:
description: authentication configuration update response
content:
application/json:
schema:
$ref: '#/components/schemas/AuthenticationConfiguration'
delete:
tags: [ Authentication Configuration ]
summary: Delete an authentication configuration
description: >
Delete the authentiction configuration document by `id`.
The client must have `UPDATE_AUTH_CONFIG` permission.
operationId: deleteAutheConfig
responses:
204:
description: Success - authentication configuration
/api/authentication/configuration/count/{id}:
parameters:
- { $ref: '#/components/parameters/authenticationConfigurationIdInPath' }
get:
tags: [ Authentication Configuration ]
summary: Count the number of users for a given configuration
description: >
Count the number of users for a given configuration.
The client must have `READ_AUTH_CONFIG` permission.
operationId: countUsersByAuthConfig
responses:
200:
description: The number of users created from the provided authentication.
/api/users:
post:
tags: [ User ]
description: >
Create a new user. Duplicate usernames are not allowed.
If the requesting user is an admin, i.e., has the `CREATE_USER`
permission, the user record will be active. Otherwise, the user will
be inactive and an admin must activate the user later. Additionally,
the `roleId` key is required when the requesting user is an admin.
Otherwise, the created user receives a default role. When the request
body contains `multipart/form-data`, MAGE will handle the `icon` and/or
`avatar` file form parameters. The server only sets the user's map
icon if the requesting user has the `CREATE_USER` permission.
operationId: createUser
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/UserCreate' }
multipart/form-data:
schema: { $ref: '#/components/schemas/UserCreate' }
responses:
200:
description: The created user document
content:
application/json:
schema:
$ref: '#/components/schemas/User'
get:
tags: [ User ]
description: >
Return an array of all users. The client must have `READ_USER` permission.
summary: Get an array of users.
operationId: getUsers
parameters:
- in: query
name: active
description: Return only active or inactive users.
schema:
type: boolean
- in: query
name: enabled
description: Return only enabled or disabled users.
schema:
type: boolean
- in: query
name: start
description: Used with pagination. Indicates the record number to start (leave blank for initial set of results).
schema:
type: integer
- in: query
name: limit
description: Used with pagination. Maximum number of records to return.
schema:
type: integer
- in: query
name: sort
description: Describes the sort order. Values allowed are asc, desc, ascending, descending, 1, and -1.
content:
application/json:
schema:
type: object
required:
- displayName
- _id
properties:
displayName:
type: string
_id:
type: string
- in: query
name: populate
description: >
Pre-populate the given relation keys in the result user documents.
Currently, this only supports 'roleId'.
schema: { $ref: '#/components/schemas/CommaSeparatedTokens' }
responses:
200:
description: An array of user documents
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
/api/users/count:
get:
tags: [ User ]
description: >
Return the number of users in the database. The client must
have `READ_USER` permission.
summary: Count the number of users in the database.
operationId: getUserCount
parameters:
- in: query
name: active
schema:
type: boolean
- in: query
name: enabled
schema:
type: boolean
responses:
200:
description: A successful request
content:
application/json:
schema: { $ref: '#/components/schemas/Count' }
/api/next-users/search:
get:
tags: [ User ]
description: Search for users. The client must have `READ_USER` permission.
summary: User search.
operationId: userSearch
parameters:
- in: query
name: term
schema:
type: string
- in: query
name: page_size
schema:
type: integer
- in: query
name: page
schema:
type: integer
- in: query
name: total
schema:
type: boolean
responses:
200:
description: Users matching the search
content:
application/json:
schema: { $ref: '#/components/schemas/PageOfUsers' }
/api/users/myself:
get:
tags: [ User ]
description: >
Return the user document for the requesting user based on the
provided authentication token.
operationId: getMyself
responses:
200:
description: The user document for the requesting user
content:
application/json:
schema:
$ref: '#/components/schemas/User'
put:
tags: [ User ]
description: >
Update the user document for the requesting user based on the
provided authentication token. This operation does not support
changing the requesting user's password; use
`PUT /api/users/myself/password` for that.
operationId: updateMyself
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/UserUpdateSelf' }
multipart/form-data:
schema: { $ref: '#/components/schemas/UserUpdateSelf' }
responses:
200:
description: The updated user document
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/api/users/myself/password:
put:
tags: [ User ]
description: Update the password for the requesting user.
operationId: updateMyPassword
requestBody:
content:
application/json:
schema:
type: object
properties:
newPassword:
type: string
format: password
newPasswordConfirm:
type: string
format: password
responses:
200:
description: Successful password update; return the user document
content:
application/json:
schema: { $ref: '#/components/schemas/User' }
/api/users/myself/status:
put:
tags: [ User ]
description: Update the status of the requesting user.
operationId: updateMyStatus
requestBody:
content:
application/json:
schema:
type: object
properties:
status:
type: string
required: [ status ]
responses:
200:
description: Successful status update
content:
application/json:
schema: { $ref: '#/components/schemas/User' }
delete:
tags: [ User ]
description: Delete the status of the requesting user.
operationId: deleteMyStatus
responses:
200:
description: Successfully deleted status
content:
application/json:
schema: { $ref: '#/components/schemas/User' }
/api/users/{userId}:
parameters:
- { $ref: '#/components/parameters/userIdInPath' }
get:
tags:
- User
description: >
Return the user document whose `id` equals the `userId` path parameter.
The client must have `READ_USER` permission.
operationId: getUserById
responses:
200:
description: The updated user document
content:
application/json:
schema:
$ref: '#/components/schemas/User'
put:
tags: [ User ]
description: >
Update the user document whose `id` equals the `userId` path parameter.
The client must have `UPDATE_USER` permission.
operationId: updateUserById
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/UserIn' }
multipart/form-data:
schema: { $ref: '#/components/schemas/UserIn' }
responses:
200:
description: user update response
content:
application/json:
schema:
$ref: '#/components/schemas/User'
delete:
tags: [ User ]
description: >
Delete the user document whose `id` equals the `userId` path parameter.
The client must have `DELETE_USER` permission.
operationId: deleteUser
responses:
204:
description: Success - user deleted
/api/users/{userId}/avatar:
parameters:
- { $ref: '#/components/parameters/userIdInPath' }
get:
tags: [ User ]
description: Returns users avatar based on user id
operationId: getUserAvatar
responses:
200:
description: user avatar response
content:
image/*:
schema:
type: string
format: binary
/api/users/{userId}/icon:
parameters:
- { $ref: '#/components/parameters/userIdInPath' }
get:
tags: [ User ]
description: Returns users map icon based on user id
operationId: getUserIcon
responses:
200:
description: user icon response
content:
image/*:
schema:
type: string
format: binary
/api/users/{userId}/events/{eventId}/recent:
parameters:
- { $ref: '#/components/parameters/userIdInPath' }
- { $ref: '#/components/parameters/eventIdInPath' }
post:
tags: [ User ]
description: >
Add the given event to top of recent list for the given user. The list
is capped at 5.
operationId: addRecentEventForUser
responses:
200:
description: user response
content:
application/json:
schema:
$ref: '#/components/schemas/User'
/api/devices:
post:
tags:
- Device
summary: Create a device
description: >
Save a new device document in the database. The request client must
have `CREATE_DEVICE` permission. `DEPRECATED`: Clients should be creating devices via authorize `/auth/{strategy}/authorize`
operationId: createDevice
requestBody:
$ref: '#/components/requestBodies/DeviceIn'
deprecated:
true
responses:
200:
description: new device response
content:
application/json:
schema:
$ref: '#/components/schemas/Device'
get:
tags:
- Device
description: >
Return an array of all the device documents in the database. The
requesting client must have `READ_DEVICE` permission.
summary: Get all the device documents in the database.
operationId: getDevices
parameters:
- in: query
name: registered
description: Return only registered or unregistered devices.
schema: { $ref: '#/components/schemas/Device/properties/registered' }
- in: query
name: start
description: Used with pagination. Indicates the record number to start (leave blank for initial set of results).
schema:
type: integer
- in: query
name: limit
description: Used with pagination. Maximum number of records to return.
schema:
type: integer
- in: query
name: sort
description: Describes the sort order. Values allowed are asc, desc, ascending, descending, 1, and -1.
content:
application/json:
schema:
type: object
required:
- userAgent
- _id
properties:
userAgent:
type: string
_id:
type: string
- in: query
name: expand
description: >
Comma-separated list of relation keys to populate with related
documents. Currently the API only supports the `user` key.
schema: { $ref: '#/components/schemas/CommaSeparatedTokens' }
responses:
200:
description: Success - an array of device documents
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Device'
/api/devices/count:
get:
tags:
- Device
operationId: getDeviceCount
description: Return the number of devices in the database.
summary: Count the number of devices in the database.
parameters:
- in: query
name: registered
schema:
type: boolean
responses:
200:
description: Success - return the device count
content:
application/json:
schema:
$ref: '#/components/schemas/Count'
/api/devices/{deviceId}:
parameters:
- $ref: '#/components/parameters/deviceIdInPath'
get:
tags:
- Device
description: >
Return the device document whose ID matches the path parameter for the
device ID. The requesting client must have READ_DEVICE permission.
operationId: getDeviceById
responses:
200:
description: device response
content:
application/json:
schema:
$ref: '#/components/schemas/Device'
put:
tags:
- Device
description: >
Update a device document whose ID matches the path parameter for the
device ID. The requesting client must have `UPDATE_DEVICE` permission.
operationId: updateDeviceById
requestBody:
$ref: '#/components/requestBodies/DeviceIn'
responses:
200:
description: device update response
content:
application/json:
schema:
$ref: '#/components/schemas/Device'
delete:
tags:
- Device
description: >
Delete a device document whose ID matches the path parameter for the
device ID. The requesting client must have `DELETE_DEVICE` permission.
operationId: deleteDeviceByIds
responses:
204:
description: user deleted
/api/teams:
post:
tags: [ Team ]
description: >
Save a new team document to the database. The requesting user must
have `CREATE_TEAM` permission.
operationId: createTeam
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/TeamCreate' }
application/x-www-form-urlencoded:
schema: { $ref: '#/components/schemas/TeamCreate' }
responses:
200:
description: Success - the created team document
content:
application/json:
schema:
$ref: '#/components/schemas/Team'
get:
tags: [ Team ]
description: >
Return all the teams. The requesting client must have `READ_TEAM`
permission.
operationId: getTeams
parameters:
- in: query
name: start
description: Used with pagination. Indicates the record number to start (leave blank for initial set of results).
schema:
type: integer
- in: query
name: limit
description: Used with pagination. Maximum number of records to return.
schema:
type: integer
- in: query
name: sort
description: Describes the sort order. Values allowed are asc, desc, ascending, descending, 1, and -1.
content:
application/json:
schema:
type: object
required:
- name
- _id
properties:
name:
type: string
_id:
type: string
- in: query
name: omit_event_teams
description: >
Whether to omit the event's implicit team that MAGE automatically
creates for adding individual users to an event.
schema:
type: boolean
- in: query
name: with_members
description: >
Return only teams that have the given user IDs as members.
schema:
type: array
items:
$ref: '#/components/schemas/User/properties/id'
- in: query
name: without_members
description: >
Return only teams that do not have the given user IDs as members.
schema:
type: array
items:
$ref: '#/components/schemas/User/properties/id'
- in: query
name: term
description: >
Return teams whose name or description field contains the given search term.
schema:
type: string
responses:
200:
description: Success - an array of team documents
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Team'
/api/teams/count:
get:
tags: [ Team ]
description: >
Get the number of teams in the database. The requesting user must have
have `READ_TEAM` permission.
operationId: getTeamCount
responses:
200:
description: Success - return the number of teams
content:
application/json:
schema: { $ref: '#/components/schemas/Count' }
/api/teams/{teamId}:
parameters:
- $ref: '#/components/parameters/teamIdInPath'
get:
tags: [ Team ]
description: >
Return the team document whose ID matches the team ID path parameter.
The requesting client must have `READ_TEAM` permission.
operationId: getTeamById
responses:
200:
description: Success - a team document
content:
application/json:
schema:
$ref: '#/components/schemas/Team'
put:
tags: [ Team ]
description: >
Update the team document whose ID matches the team ID in the path.
The requesting user must have `UPDATE_TEAM` permission.
operationId: updateTeamById
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/TeamIn' }
application/x-www-form-urlencoded:
schema: { $ref: '#/components/schemas/TeamIn' }
responses:
200:
description: Success - return the updated team document.
content:
application/json:
schema:
$ref: '#/components/schemas/Team'
delete:
tags: [ Team ]
description: >
Delete the team document whose ID matches the team ID in the path. The
request user must have `DELETE_TEAM` permission.
operationId: deleteTeam
responses:
204:
description: Success - team deleted
/api/teams/{teamId}/users:
parameters:
- { $ref: '#/components/parameters/teamIdInPath' }
post:
tags: [ Team ]
operationId: addUserToTeam
description: >
Add a user to a team. The request user must have `UPDATE_TEAM`
permission as well as an ACL entry in the team document with `update`
permission.
requestBody:
description: The user ID reference to add to the target team
content:
application/json:
schema:
$ref: '#/components/schemas/UserRef'
required: true
responses:
200:
description: Success - return the updated team document.
content:
application/json:
schema: { $ref: '#/components/schemas/Team' }
/api/teams/{teamId}/users/{userId}:
parameters:
- { $ref: '#/components/parameters/teamIdInPath' }
- { $ref: '#/components/parameters/userIdInPath' }
delete:
tags: [ Team ]
operationId: removeUserFromTeam
description: >
Remove a user from a team. The requesting user must have `UPDATE_TEAM`
permission as well as an ACL entry in the team document with `update`
permission.
responses:
200:
description: Success - return the updated team document.
content:
application/json:
schema: { $ref: '#/components/schemas/Team' }
/api/teams/{teamId}/acl/{userId}:
parameters:
- { $ref: '#/components/parameters/teamIdInPath' }
- { $ref: '#/components/parameters/userIdInPath' }
put:
tags: [ Team ]
operationId: setUserAccessForTeam
description: >
Update a team ACL entry. The requesting user must have `UPDATE_TEAM`
permission, as well as an ACL entry in the team document with `update`
permission.
requestBody:
$ref: '#/components/requestBodies/ACLRoleUpdate'
responses:
200:
description: Success - return the updated team document.
content:
application/json:
schema: { $ref: '#/components/schemas/Team' }
delete:
tags: [ Team ]
operationId: removeUserAccessFromTeam
description: >
Delete a team ACL entry. The requesting user must have `UPDATE_TEAM`
permission, as well as an ACL entry in the team document with `update`
permission.
responses:
200:
description: Success - return the updated team document.
content:
application/json:
schema: { $ref: '#/components/schemas/Team' }
/api/events:
post:
tags: [ Event ]
operationId: createEvent
description: >
Create a new event. The requesting user must have `CREATE_EVENT`
permission. MAGE assigns the requesting user to the event's ACL with
the `OWNER` role. Creating a new event implicitly creates a team
coupled to the event by the team's `teamEventId` property. One can
add users to this team to allow access to the event on an individual
basis. This allows team and user access management to remain
consistent across the API without having to maintain a list of users
separately for each event.
requestBody:
description: The new event document
content:
application/json:
schema:
$ref: '#/components/schemas/EventCreate'
required: true
responses:
201:
description: Success - return the created event.
content:
application/json:
schema:
$ref: '#/components/schemas/Event'
get:
tags: [ Event ]
description: >
Get all of the MAGE server's events. The requesting user must have
`READ_EVENT_ALL` permission and an ACL entry on the even with `read`
permission.
operationId: getEvents
parameters:
- in: query
name: projection
schema:
type: string
- in: query
name: state
schema:
type: string
enum: [ active, complete ]
- in: query
name: userId
schema:
$ref: '#/components/schemas/User/properties/id'
description: >
Return only events the given user can access.
- in: query
name: populate
schema:
type: boolean
description: >