-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathauth.v1.yaml
More file actions
1100 lines (1099 loc) · 33.6 KB
/
auth.v1.yaml
File metadata and controls
1100 lines (1099 loc) · 33.6 KB
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.0
info:
title: Authentication API
version: '1.0'
description: |-
The Tidepool API is an HTTP REST API used by Tidepool clients use to communicate with the Tidepool Platform.
For more information, see the [Getting Started](../docs/quick-start.md) section.
termsOfService: 'https://developer.tidepool.org/terms-of-use'
contact:
name: API Support
url: 'https://support.tidepool.org/'
email: support@tidepool.org
license:
name: BSD-2-Clause
url: 'https://github.com/tidepool-org/shoreline/blob/master/LICENSE'
x-tidepool-service: 'https://github.com/tidepool-org/shoreline'
servers:
- url: 'https://external.integration.tidepool.org'
description: integration
- url: 'https://api.tidepool.org'
description: production
- url: 'https://dev1.dev.tidepool.org'
description: dev1
- url: 'https://qa1.development.tidepool.org'
description: qa1
- url: 'https://qa2.development.tidepool.org'
description: qa2
tags:
- name: Internal
description: APIs intended for internal use by Tidepool.
- name: Users
description: List and manage users.
paths:
/auth/login:
post:
operationId: CreateSessionToken
summary: Create New Session Token
description: |-
**This API is deprecated and will be removed by end of 2023.**
Creates a new session token.
responses:
'200':
$ref: '#/components/responses/UserWithToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/ServerError'
security:
- basicAuth: []
tags:
- Authentication
- Internal
deprecated: true
x-internal: true
get:
operationId: RefreshSessionToken
summary: Refresh Session Token
description: |-
**This API is deprecated and will be removed by end of 2023.**
Refreshes an existing session token.
responses:
'200':
$ref: '#/components/responses/TokenData'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/ServerError'
security:
- sessionToken: []
tags:
- Authentication
- Internal
deprecated: true
x-internal: true
/auth/logout:
post:
operationId: Logout
summary: Logout
description: |-
**This API is deprecated and will be removed by end of 2023.**
Removes an existing session token. Returns success even if the session token does not exist.
responses:
'200':
description: Success
security: []
tags:
- Authentication
- Internal
deprecated: true
x-internal: true
/auth/user:
get:
operationId: GetCurrentUserInfo
summary: Get Current User
description: Returns user account information for the logger-in user.
responses:
'200':
$ref: '#/components/responses/User'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/ServerError'
security:
- sessionToken: []
tags:
- Users
post:
operationId: CreateNewUser
summary: Create New User Account
description: |-
**This API is deprecated and will be removed by end of 2023.**
Creates a new user account.
requestBody:
content:
application/json:
schema:
$ref: ./auth/models/newuser.v1.yaml
responses:
'201':
$ref: '#/components/responses/UserWithToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'409':
$ref: '#/components/responses/Conflict'
'500':
$ref: '#/components/responses/ServerError'
security: []
tags:
- Users
- Internal
deprecated: true
x-internal: true
put:
operationId: UpdateCurrentUser
summary: Update Current User Account
description: Updates user account details of the logged-in user.
requestBody:
$ref: '#/components/requestBodies/UpdateUser'
responses:
'200':
$ref: '#/components/responses/User'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'409':
$ref: '#/components/responses/Conflict'
'500':
$ref: '#/components/responses/ServerError'
security:
- sessionToken: []
tags:
- Users
/auth/users:
get:
operationId: GetUsers
summary: Get Users
description: 'Returns user accounts that match either the `role` or one of the Tidepool User IDs listed in the `id` list. The `role` and `id` parameters are mutually exclusive, and cannot be used together. The `role` parameter can be optionally combined with the `createdFrom` and/or `createdTo` parameters to limit the results to user accounts created within those dates.'
parameters:
- name: role
in: query
description: Filter users with the specific role
schema:
$ref: ./auth/models/role.v1.yaml
- name: id
in: query
description: Filter users with one or more Tidepool User IDs
style: form
explode: false
schema:
type: array
items:
$ref: ./common/models/tidepooluserid.yaml
minItems: 1
maxItems: 200
uniqueItems: true
- name: createdFrom
in: query
description: Filter users created since specified date (inclusive)
schema:
$ref: ./auth/models/date.v1.yaml
- name: createdTo
in: query
description: Filter users created until specified date (inclusive)
schema:
$ref: ./auth/models/date.v1.yaml
responses:
'200':
$ref: '#/components/responses/Users'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
security:
- serverToken: []
tags:
- Users
- Internal
'/auth/user/{userId}':
parameters:
- $ref: ./common/parameters/tidepooluserid.yaml
get:
operationId: GetUserInfo
summary: Get User
description: Get information for the user identified by `userId`.
responses:
'200':
$ref: '#/components/responses/User'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
security:
- sessionToken: []
tags:
- Users
put:
operationId: UpdateUser
summary: Update User
description: Updates the user identified by `userId`.
requestBody:
$ref: '#/components/requestBodies/UpdateUser'
responses:
'200':
$ref: '#/components/responses/User'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'500':
$ref: '#/components/responses/ServerError'
security:
- sessionToken: []
tags:
- Users
delete:
operationId: DeleteUser
summary: Delete User
description: 'Deletes the user identified by `userId`. The request body must provide the current password of the account to be deleted, unless the session token is a server token, or the account being deleted is a custodial account managed by the authenticated user.'
requestBody:
content:
application/json:
schema:
$ref: ./auth/models/deleteuser.v1.yaml
responses:
'202':
description: Success
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
description: ''
security:
- sessionToken: []
- serverToken: []
tags:
- Users
'/auth/user/{userId}/user':
parameters:
- $ref: ./common/parameters/tidepooluserid.yaml
post:
operationId: CreateCustodialUser
summary: Create Custodial User
description: 'Creates a custodial user, that is, a user that has no independent login (no username, no password). The user identified by `userId` will be the `custodian` of this new custodial account. It will be granted the `custodial` permission on the new custodial user account.'
requestBody:
content:
application/json:
schema:
$ref: ./auth/models/newcustodialuser.v1.yaml
responses:
'201':
$ref: '#/components/responses/User'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'409':
$ref: '#/components/responses/Conflict'
'500':
$ref: '#/components/responses/ServerError'
security:
- sessionToken: []
tags:
- Users
'/auth/login/{longtermkey}':
parameters:
- name: longtermkey
in: path
required: true
schema:
type: string
post:
operationId: LongTermLogin
summary: Login with a long term key
description: Creates a long-lived session token.
responses:
'200':
$ref: '#/components/responses/UserWithToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'500':
$ref: '#/components/responses/ServerError'
security: []
tags:
- Authentication
- Internal
/auth/serverlogin:
post:
operationId: ServerLogin
summary: Server to Server Login
description: Server-to-server login
parameters:
- $ref: ./auth/parameters/tidepoolservername.v1.yaml
responses:
'200':
$ref: '#/components/responses/ServerToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Authentication
- Internal
security:
- serverSecret: []
/auth/token:
get:
operationId: CheckSessionToken
summary: Check Session Token
description: Checks the validity of a session token.
responses:
'200':
$ref: '#/components/responses/TokenData'
'401':
$ref: '#/components/responses/Unauthorized'
tags:
- Authentication
- Internal
security:
- sessionToken: []
'/auth/token/{token}':
parameters:
- name: token
in: path
required: true
schema:
$ref: ./common/models/tidepoolsessiontoken.v1.yaml
get:
operationId: ServerCheckToken
summary: Server Check Token
description: 'Checks the validity of a server token, provided via the `X-Tidepool-Session-Token` header, and then checks the validity of the session token provided via the `token` path parameter.'
responses:
'200':
$ref: '#/components/responses/TokenData'
'401':
$ref: '#/components/responses/Unauthorized'
tags:
- Authentication
- Internal
security:
- serverToken: []
/v1/device_check/verify:
get:
operationId: VerifyDeviceToken
summary: Verify Device Token
description: 'Checks the validity of Apple''s DeviceCheck token by calling Apple''s server to verify it. For more details, see Apple''s [developer documentation](https://developer.apple.com/documentation/devicecheck).'
requestBody:
$ref: '#/components/requestBodies/VerifyDeviceToken'
responses:
'200':
$ref: '#/components/responses/DeviceTokenVerification'
'401':
$ref: '#/components/responses/Unauthorized'
tags:
- Authentication
- Internal
security:
- sessionToken: []
'/v1/users/{userId}/restricted_tokens':
parameters:
- $ref: ./common/parameters/tidepooluserid.yaml
get:
operationId: ListUserRestrictedTokens
summary: List All Restricted Tokens
description: Lists all restricted tokens associated with the user `userId`. The list can be optionally paginated.
parameters:
- $ref: ./common/parameters/paginationpage.v1.yaml
- $ref: ./common/parameters/paginationsize.v1.yaml
responses:
'200':
$ref: '#/components/responses/RestrictedTokens'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
post:
operationId: CreateUserRestrictedToken
summary: Create New Restricted Token
description: Creates a new restricted token associated with the user `userId`.
requestBody:
$ref: '#/components/requestBodies/NewRestrictedToken'
responses:
'200':
$ref: '#/components/responses/RestrictedToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
delete:
operationId: DeleteAllUserRestrictedTokens
summary: Delete All Restricted Tokens
description: Deletes all restricted tokens associated with the user `userId`.
responses:
'204':
description: Success
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
'/v1/restricted_tokens/{tokenId}':
parameters:
- $ref: ./auth/parameters/restricted/tokenid.v1.yaml
get:
operationId: GetRestrictedToken
summary: Get Restricted Token
description: Returns the restricted token specified by the `tokenId`.
responses:
'200':
$ref: '#/components/responses/RestrictedToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
put:
operationId: UpdateRestrictedToken
summary: Update Restricted Token
description: Updates the restricted token specified by the `tokenId`.
requestBody:
$ref: '#/components/requestBodies/UpdateRestrictedToken'
responses:
'200':
$ref: '#/components/responses/RestrictedToken'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
delete:
operationId: DeleteRestrictedToken
summary: Delete Restricted Token
description: Delete the restricted token specified by `tokenId`.
responses:
'200':
description: Success
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
'/auth/v1/users/{userId}/provider_sessions':
parameters:
- $ref: ./common/parameters/tidepooluserid.yaml
get:
operationId: ListUserDataProviderSessions
summary: List Data Provider Sessions
description: 'Lists all data provider sessions associated with the user `userId`. The list can be optionally paginated, and filtered by provider name and/or type.'
parameters:
- $ref: ./common/parameters/paginationpage.v1.yaml
- $ref: ./common/parameters/paginationsize.v1.yaml
- $ref: ./auth/parameters/providers/providerName.v1.yaml
- $ref: ./auth/parameters/providers/provider-type.v1.yaml
responses:
'200':
$ref: '#/components/responses/ProviderSessions'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
post:
operationId: CreateUserDataProviderSession
summary: Create New Data Provider Sessions
description: Creates a new data provider session associated with the user `userId`.
requestBody:
$ref: '#/components/requestBodies/NewProviderSession'
responses:
'200':
$ref: '#/components/responses/ProviderSession'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
delete:
operationId: DeleteAllUserDataProviderSessions
summary: Delete All Data Provider Sessions
description: Deletes all data provider sessions associated with the user `userId`.
responses:
'204':
description: Success
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
'/auth/v1/provider_sessions/{sessionId}':
parameters:
- $ref: ./auth/parameters/providers/sessionid.v1.yaml
get:
operationId: GetUserDataProviderSession
summary: Get Data Provider Session
description: Returns the data provider session specified by the `sessionId`.
responses:
'200':
$ref: '#/components/responses/ProviderSession'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
put:
operationId: UpdateUserDataProviderSession
summary: Update Data Provider Session
description: Updates the data provider session specified by the `sessionId`.
requestBody:
$ref: '#/components/requestBodies/UpdateProviderSession'
responses:
'200':
$ref: '#/components/responses/ProviderSession'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
delete:
operationId: DeleteUserDataProviderSession
summary: Delete Data Provider Session
description: Delete the data provider session specified by `sessionId`.
responses:
'200':
description: Success
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
tags:
- Authentication
- Internal
security:
- serverToken: []
'/v1/users/{userId}/device_tokens':
parameters:
- $ref: ./common/parameters/tidepooluserid.yaml
post:
operationId: CreateDeviceTokenForUser
summary: Post Device Token
description: Stores a token used to send notifications to a device such as a mobile phone.
requestBody:
$ref: '#/components/requestBodies/DeviceToken'
responses:
'200':
description: 200 OK
'400':
$ref: ./common/responses/badrequest.v1.yaml
'403':
$ref: ./common/responses/forbidden.v1.yaml
security:
- sessionToken: []
tags:
- Internal
/v1/consents:
get:
summary: List Consents
tags:
- Internal
- Consent
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./auth/models/consent/consents.v1.yaml
operationId: ListConsents
description: 'Retrieves the list of all different consent types and their content. '
requestBody:
content: {}
parameters: []
x-internal: true
parameters: []
'/v1/consents/{consentType}':
parameters:
- $ref: '#/components/parameters/consentType'
get:
summary: Get Latest Consent By Type
tags:
- Consent
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./auth/models/consent/consent.v1.yaml
operationId: GetLatestConsentByType
description: Returns the latest consent version for the given type
'/v1/consents/{consentType}/versions':
parameters:
- $ref: '#/components/parameters/consentType'
get:
summary: Get Consent Versions
tags:
- Consent
- Internal
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./auth/models/consent/consents.v1.yaml
operationId: GetConsentVersions
description: Returns a list of all consent versions for a given type
x-internal: true
'/v1/users/{userId}/consents':
parameters:
- $ref: '#/components/parameters/userId'
get:
summary: Get User Consent Records
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./auth/models/consent/records.v1.yaml
operationId: GetUserConsentRecords
description: Returns a list of all user consent records. By default only the most recent consent record for a given consent type will be returned. This can be overriden by setting the `latest` query parameter to `false`.
parameters:
- schema:
type: boolean
enum:
- 'true'
- 'false'
default: 'true'
in: query
name: latest
description: Whether to return all versions or only the most recent one.
- schema:
type: string
in: query
name: type
post:
summary: Create User Consent Record
operationId: CreateUserConsentRecord
responses:
'200':
description: Created
content:
application/json:
schema:
$ref: ./auth/models/consent/record.v1.yaml
description: Creates a user consent record
requestBody:
content:
application/json:
schema:
$ref: ./auth/models/consent/recordcreate.v1.yaml
'/v1/users/{userId}/consents/{recordId}':
parameters:
- $ref: '#/components/parameters/userId'
- $ref: '#/components/parameters/recordId'
get:
summary: Get User Consent Record
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./auth/models/consent/record.v1.yaml
operationId: GetUserConsentRecord
description: Retrieves a consent record by ID for a given user.
patch:
summary: Update User Consent Record
operationId: UpdateUserConsentRecord
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./auth/models/consent/record.v1.yaml
description: ''
requestBody:
content:
application/json:
schema:
$ref: ./auth/models/consent/recordupdate.v1.yaml
delete:
summary: 'Revoke User Consent Record'
operationId: RevokeConsent
responses:
'204':
description: OK
description: Revokes a consent record
components:
securitySchemes:
basicAuth:
$ref: ./common/security/basicauth.v1.yaml
sessionToken:
$ref: ./common/security/tidepoolsessiontoken.v1.yaml
serverToken:
$ref: ./common/security/tidepoolservertoken.v1.yaml
serverSecret:
$ref: ./common/security/tidepoolserversecret.v1.yaml
requestBodies:
UpdateUser:
description: Updated user details
content:
application/json:
schema:
$ref: ./auth/models/updateuser.v1.yaml
VerifyDeviceToken:
description: Verify device token
content:
application/json:
schema:
type: object
properties:
device_token:
type: string
minLength: 1
required:
- device_token
NewRestrictedToken:
description: New restricted token
content:
application/json:
schema:
$ref: ./auth/models/restricted/newtoken.v1.yaml
UpdateRestrictedToken:
description: Updated restricted token
content:
application/json:
schema:
$ref: ./auth/models/restricted/updatetoken.v1.yaml
NewProviderSession:
description: New provider session
content:
application/json:
schema:
$ref: ./auth/models/providers/newsession.v1.yaml
UpdateProviderSession:
description: Updated provider session
content:
application/json:
schema:
$ref: ./auth/models/providers/updatesession.v1.yaml
DeviceToken:
description: Device token used for sending push notifications to a mobile device.
content:
application/json:
schema:
oneOf:
- $ref: ./auth/models/devicetoken-apple.v1.yaml
responses:
User:
description: Tidepool User Account
content:
application/json:
schema:
$ref: ./auth/models/user.v1.yaml
Users:
description: Tidepool User Accounts
content:
application/json:
schema:
$ref: ./auth/models/users.v1.yaml
UserWithToken:
description: Tidepool User Account with Token
headers:
X-Tidepool-Session-Token:
$ref: ./common/headers/tidepoolsessiontoken.v1.yaml
content:
application/json:
schema:
$ref: ./auth/models/user.v1.yaml
TokenData:
description: Token Data
headers:
X-Tidepool-Session-Token:
$ref: ./common/headers/tidepoolsessiontoken.v1.yaml
content:
application/json:
schema:
$ref: ./auth/models/tokendata.v1.yaml
ServerToken:
description: Server Token
headers:
X-Tidepool-Session-Token:
$ref: ./common/headers/tidepoolsessiontoken.v1.yaml
DeviceTokenVerification:
description: Device token verification response
content:
application/json:
schema:
type: object
properties:
valid:
type: boolean
required:
- valid
RestrictedToken:
description: Restricted Token
content:
application/json:
schema:
$ref: ./auth/models/restricted/token.v1.yaml
RestrictedTokens:
description: Restricted Tokens
content:
application/json:
schema:
$ref: ./auth/models/restricted/tokens.v1.yaml
ProviderSession:
description: Provider Session
content:
application/json:
schema:
$ref: ./auth/models/providers/session.v1.yaml
ProviderSessions:
description: Provider Sessions
content:
application/json:
schema:
$ref: ./auth/models/providers/sessions.v1.yaml
Unauthorized:
description: Unauthorized
content:
application/json:
schema:
allOf:
- $ref: ./auth/models/error.v1.yaml
- type: object
properties:
code:
type: integer
enum:
- 401
reason:
type: string
enum:
- No user matched the given details
- A server token is required
- Not authorized for requested operation
- Wrong password
- No X-Tidepool-Session-Token was found
required:
- code
- reason
BadRequest:
description: Bad Request
content:
application/json:
schema:
allOf:
- $ref: ./auth/models/error.v1.yaml
- type: object
properties:
code:
type: integer
enum:
- 400
reason:
type: string
enum:
- The role specified is invalid
- Not all required details were given
- Invalid user details were given
- Missing id and/or password
required:
- code
- reason
Forbidden:
description: Forbidden