forked from wso2/openfgc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsent-management-API.yaml
More file actions
5027 lines (4966 loc) · 198 KB
/
Copy pathconsent-management-API.yaml
File metadata and controls
5027 lines (4966 loc) · 198 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:
version: v1.0
title: Consent Management API
description: |
This API provides a comprehensive set of endpoints for managing consent elements, consent purposes and consents.
**Key Concepts:**
- **Consent Element**: The most granular unit—a specific data point (e.g., email address) or processing action (e.g., sharing with third parties).
- **Consent Purpose**: A logical grouping of elements under a single objective. Instead of asking users about each data point, you present the reason for the request (e.g., "Marketing Communications" includes email and phone).
- **Consent**: The record of a user's decision. Tracks who approved what, when, and maintains the full status lifecycle (Created → Active → Expired/Revoked) with audit trail.
contact:
name: WSO2
url: 'https://wso2.com/solutions/financial-services/'
email: "architecture@wso2.com"
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://localhost:8060/api/v1
tags:
- name: Consent Elements
description: Manage Consent Elements
- name: Consent Purposes
description: Manage Consent Purposes
- name: Consents
description: Manage Consents
paths:
/consents:
post:
summary: Initiate a new consent resource
description: |
This endpoint is used to initiate a new consent resource.
Upon success, the system creates a **consent resource** with: A unique `consentId`
**Purpose Access Rules:**
When a purpose is referenced in a consent, the server validates that the consent is allowed to use it:
- **Allowed** if `purpose.groupId == consent.groupId` — the purpose belongs to the same group as the consent.
- **Allowed** if `purpose.groupId == orgId` — the purpose is an org-level purpose, available to all consents in the organization.
- **Rejected** otherwise — a group-specific purpose from a different group cannot be used.
**Element Resolution:**
- `elements` within each purpose is optional. If omitted, all elements defined in the purpose
are automatically included with `approved: false`.
- If a subset of elements is provided, any unmentioned elements are resolved the same way —
added to the response with `approved: false`.
operationId: consents-POST
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "The unique identifier for the organization (e.g., the bank) that this consent belongs to."
schema:
type: string
example: "ORG-001"
- in: header
name: group-id
required: true
description: "An identifier used to group related purposes and consents."
schema:
type: string
example: "group-001"
requestBody:
description: The payload containing the consent data.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentCreatePayload"
example:
type: "marketing"
expirationTime: 1766383796000
recurringIndicator: true
dataAccessValidityDuration: 0
frequency: 0
purposes:
- name: "marketing_communication_preferences"
version: "v1"
elements:
- name: "user_email"
approved: true
value: {}
- name: "user_mobile"
approved: true
value: {}
attributes:
department: "marketing"
authorizations:
- userId: "user1@example.com"
type: "authorisation"
status: "APPROVED"
resources:
accountIds: ["acc-123", "acc-456"]
responses:
"201":
description: Successfully initiated the consent. The response body contains the details of the newly created consent resource, including its `id`.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentCreatedResponse"
"400":
description: Bad Request. The request was malformed. This could be due to missing required headers or an invalid request body.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server while trying to create the consent.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
get:
summary: Search for consents
description: |
Provides a powerful search capability to find consents based on various filter criteria like consent type, status, group ID, user ID, purpose, and element. Supports pagination.
By default (`details=false`), purpose and element entries contain only their identifiers,
versions, and consent approval state. Set `details=true` to include the display name and
description for every purpose and element version.
If purposeVersion is specified, purposeName must also be provided.
If elementVersion is specified, at least one of elementName or elementNamespace must also be provided.
operationId: consents-search-GET
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "Organisation ID."
schema:
type: string
example: "ORG-001"
- name: consentTypes
in: query
description: A comma-separated list of consent types to filter by (e.g., 'accounts,payments').
schema:
type: string
example: "accounts,payments"
- name: consentStatuses
in: query
description: "A comma-separated list of consent statuses to filter by (e.g., 'ACTIVE,REVOKED'). Valid values are: CREATED, ACTIVE, REJECTED, REVOKED, EXPIRED."
schema:
type: string
example: "ACTIVE,CREATED"
- name: groupIds
in: query
description: A comma-separated list of group IDs to filter by.
schema:
type: string
example: "group-001,group-002"
- name: userIds
in: query
description: A comma-separated list of end-user IDs to filter by.
schema:
type: string
example: "user1@example.com,user2@example.com"
- name: purposeName
in: query
description: Filter by consent purpose name. Returns consents that contain this purpose.
schema:
type: string
example: "marketing_communication_preferences"
- name: purposeVersion
in: query
description: Filter by a specific purpose version (e.g. "v2"). Requires purposeName to also be specified.
schema:
type: string
example: "v2"
- name: elementName
in: query
description: Filter by element name — returns consents that include this element.
schema:
type: string
example: "user_email"
- name: elementNamespace
in: query
description: Filter by element namespace — used together with elementName.
schema:
type: string
example: "personal"
- name: elementVersion
in: query
description: |
Filter by a specific element version (e.g. "v2"). Requires at least one of elementName or elementNamespace to also be specified.
schema:
type: string
example: "v2"
- name: fromTime
in: query
description: The start of the time window for the search, as a Unix timestamp in milliseconds (integer).
schema:
type: integer
format: int64
example: 1702800000000
- name: toTime
in: query
description: The end of the time window for the search, as a Unix timestamp in milliseconds (integer).
schema:
type: integer
format: int64
example: 1734422400000
- name: sort
in: query
description: Sort results using a comma-separated list of sort items. Each item can be either `{field}:{direction}` or `{field}`, which defaults to `desc`. Supported fields are `createdTime`, `updatedTime`, `validityTime`, `status`, `groupId`, and `consentType`. Supported directions are `asc` and `desc`. A maximum of 3 sort items is allowed. If `validityTime` is used, consents without an expiry are treated as having the latest validity time. If omitted, results are sorted by `createdTime:desc`.
schema:
type: string
default: createdTime:desc
example: "status:asc,createdTime:desc"
- name: limit
in: query
description: The maximum number of results to return in a single page. Used for pagination.
schema:
type: integer
format: int32
example: 10
- name: offset
in: query
description: The number of results to skip. Used for pagination.
schema:
type: integer
format: int32
example: 0
- name: details
in: query
description: Include purpose and element display names and descriptions when set to `true`.
schema:
type: boolean
default: false
responses:
"200":
description: OK. Returns a list of consents matching the search criteria, along with pagination metadata.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentSearchResponse"
examples:
minimal:
summary: Search response with details=false (default)
value:
data:
- id: "30000001-0003-0003-0003-000000000002"
groupId: "app-group-001"
type: "Account management"
status: "ACTIVE"
createdTime: 1702900000000
updatedTime: 1702900000000
purposes:
- purposeId: "550e8400-e29b-41d4-a716-446655440000"
name: "account_management"
version: "v1"
elements:
- elementId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
name: "user_email"
namespace: "default"
version: "v1"
mandatory: true
approved: true
metadata:
total: 1
offset: 0
count: 1
limit: 10
detailed:
summary: Search response with details=true
value:
data:
- id: "30000001-0003-0003-0003-000000000002"
groupId: "app-group-001"
type: "Account management"
status: "ACTIVE"
createdTime: 1702900000000
updatedTime: 1702900000000
purposes:
- purposeId: "550e8400-e29b-41d4-a716-446655440000"
name: "account_management"
version: "v1"
displayName: "Account management"
description: "Manage account access"
elements:
- elementId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
name: "user_email"
namespace: "default"
version: "v1"
displayName: "User email address"
description: "The user's email address"
mandatory: true
approved: true
metadata:
total: 1
offset: 0
count: 1
limit: 10
"400":
description: Bad Request. The search parameters provided are invalid.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
/consents/attributes:
get:
summary: Search consents by attribute key and value
description: |
Searches for consent IDs that have a specific attribute key, optionally filtered by value.
**Search Modes:**
- **By key only** (`?key=department`): Returns all consents with the specified attribute key
- **By key and value** (`?key=department&value=sales`): Returns consents with exact key-value match
Results are organization-scoped and sorted by consent ID.
operationId: consents-attributes-GET
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "The unique identifier for the organization."
schema:
type: string
example: "ORG-001"
- name: key
in: query
required: true
description: The attribute key to search for (required).
schema:
type: string
example: "department"
- name: value
in: query
required: false
description: The attribute value to search for (optional). If provided, only consents with exact key-value match are returned.
schema:
type: string
example: "sales"
responses:
"200":
description: Successfully retrieved consent IDs matching the search criteria.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentAttributeSearchResponse"
"400":
description: Bad Request. The key parameter is missing or invalid.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
/consents/group-ids:
get:
summary: Retrieve group IDs for a user
description: |
Retrieves the distinct group IDs associated with the specified user ID.
Results are scoped to the requesting organization and include only group IDs.
Group metadata is not returned.
operationId: consents-group-ids-GET
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "The unique identifier for the organization."
schema:
type: string
example: "ORG-001"
- name: userId
in: query
required: true
description: The user ID to search for.
schema:
type: string
example: "user1@example.com"
responses:
"200":
description: Successfully retrieved the group IDs matching the search criteria.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentGroupIDsResponse"
"400":
description: Bad Request. The userId parameter is missing, repeated, or invalid.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
/consents/{consentId}:
get:
summary: Retrieve a consent by its ID
description: |
Fetches a specific consent resource using its unique `consentID`.
By default (`details=false`), purpose and element entries contain only their
identifiers, versions, and consent approval state. Set `details=true` to include
the display name and description for every purpose and element version.
operationId: consents-GET
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "The unique identifier for the organization (e.g., the bank) that this consent belongs to."
schema:
type: string
example: "ORG-001"
- in: path
name: consentId
required: true
description: The unique identifier of the consent to retrieve.
schema:
type: string
- in: query
name: includeStatusHistory
required: false
description: Include consent status audit history in the response when set to `true`.
schema:
type: boolean
default: false
- in: query
name: details
required: false
description: Include purpose and element display names and descriptions when set to `true`.
schema:
type: boolean
default: false
responses:
"200":
description: OK. Returns the requested consent, with purpose and element definition details controlled by the `details` query parameter.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentRetrievalResponse"
examples:
withoutStatusHistory:
summary: Consent response without status history (details=false)
value:
id: "30000001-0003-0003-0003-000000000002"
purposes:
- purposeId: "550e8400-e29b-41d4-a716-446655440000"
name: "account_management"
version: "v1"
elements:
- elementId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
name: "user_email"
namespace: "default"
version: "v1"
mandatory: false
approved: false
- elementId: "b2c3d4e5-f6a7-8901-bcde-f12345678901"
name: "user_address"
namespace: "default"
version: "v1"
mandatory: false
approved: false
createdTime: 1702900000000
updatedTime: 1702900000000
groupId: "app-group-001"
type: "Account management"
status: "ACTIVE"
frequency: 0
expirationTime: 1798741800000
recurringIndicator: true
dataAccessValidityDuration: 0
attributes:
department: "customer_service"
gdpr_compliant: "true"
region: "EU"
authorizations:
- id: "a1b2c3d4-e5f6-7890-abcd-ef1234567891"
userId: "user2@example.com"
type: "authorisation"
status: "APPROVED"
updatedTime: 1702900000000
resources:
accountIds:
- "acc-789"
- "acc-101"
withStatusHistory:
summary: Consent response with status history (details=false)
value:
id: "30000001-0003-0003-0003-000000000002"
purposes:
- purposeId: "550e8400-e29b-41d4-a716-446655440000"
name: "account_management"
version: "v1"
elements:
- elementId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
name: "user_email"
namespace: "default"
version: "v1"
mandatory: false
approved: false
createdTime: 1702900000000
updatedTime: 1702900000000
groupId: "app-group-001"
type: "Account management"
status: "ACTIVE"
frequency: 0
expirationTime: 1798741800000
recurringIndicator: true
dataAccessValidityDuration: 0
attributes:
department: "customer_service"
gdpr_compliant: "true"
region: "EU"
authorizations:
- id: "a1b2c3d4-e5f6-7890-abcd-ef1234567891"
userId: "user2@example.com"
type: "authorisation"
status: "APPROVED"
updatedTime: 1702900000000
resources:
accountIds:
- "acc-789"
- "acc-101"
statusHistory:
- statusAuditId: "s3c4d5e6-f7a8-9012-abcd-ef1234567890"
previousStatus: "CREATED"
currentStatus: "ACTIVE"
actionTime: 1745050000000
actionBy: "user-001"
reason: "All authorizations approved"
- statusAuditId: "s1a2b3c4-d5e6-7890-abcd-ef1234567890"
currentStatus: "CREATED"
actionTime: 1745000000000
actionBy: "client-app-123"
reason: "Consent created"
withDetails:
summary: Consent response with details=true (status history disabled)
value:
id: "30000001-0003-0003-0003-000000000002"
purposes:
- purposeId: "550e8400-e29b-41d4-a716-446655440000"
name: "account_management"
version: "v1"
displayName: "Account management"
description: "Manage account access"
elements:
- elementId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
name: "user_email"
namespace: "default"
version: "v1"
displayName: "User email address"
description: "The user's email address"
mandatory: false
approved: false
- elementId: "b2c3d4e5-f6a7-8901-bcde-f12345678901"
name: "user_address"
namespace: "default"
version: "v1"
displayName: "User postal address"
description: "The user's postal address"
mandatory: false
approved: false
createdTime: 1702900000000
updatedTime: 1702900000000
groupId: "app-group-001"
type: "Account management"
status: "ACTIVE"
frequency: 0
expirationTime: 1798741800000
recurringIndicator: true
dataAccessValidityDuration: 0
attributes:
department: "customer_service"
gdpr_compliant: "true"
region: "EU"
authorizations:
- id: "a1b2c3d4-e5f6-7890-abcd-ef1234567891"
userId: "user2@example.com"
type: "authorisation"
status: "APPROVED"
updatedTime: 1702900000000
resources:
accountIds:
- "acc-789"
- "acc-101"
"400":
description: Bad Request. The request was invalid, possibly due to a malformed `consentID` or missing headers.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
put:
summary: Update a consent resource by its ID
description: |
Endpoint to perform a full update on a consent resource, including its authorization resources and attributes, in a single operation.
**Purpose Access Rules:**
Same groupId validation as consent creation applies — a purpose can only be used if its `groupId`
matches the consent's `groupId`, or if it is an org-level purpose (`purpose.groupId == orgId`).
**Element Resolution:**
- `elements` within each purpose is optional. If omitted, all elements defined in the purpose
are automatically included with `approved: false`.
- If a subset of elements is provided, any unmentioned elements are resolved the same way —
added to the response with `approved: false`.
operationId: consents-PUT
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "Organisation ID."
schema:
type: string
example: "ORG-001"
- in: header
name: group-id
required: true
description: "The group ID of the consent. The group ID of a consent is immutable and cannot be changed — this header is used for validation only."
schema:
type: string
example: "group-001"
- name: consentId
in: path
description: The unique identifier of the consent to update.
required: true
schema:
type: string
requestBody:
description: The full consent resource object with the desired updates.
content:
application/json:
schema:
"$ref": "#/components/schemas/ConsentUpdateRequest"
example:
type: "accounts"
expirationTime: 0
recurringIndicator: false
dataAccessValidityDuration: 86400
frequency: 0
purposes:
- name: "profile_access"
version: "v1"
elements:
- name: "first_name"
approved: true
value: {}
- name: "last_name"
approved: true
value: {}
attributes:
department: "sales"
region: "APAC"
authorizations:
- userId: "user1@example.com"
type: "authorisation"
status: "APPROVED"
resources:
accountIds: ["acc-123", "acc-456"]
required: true
responses:
"200":
description: OK. The full details of the requested consent are returned in the response body.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentUpdateResponse"
"400":
description: Bad Request. The request was malformed. This could be due to missing required headers or an invalid request body.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server while trying to update the consent.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
/consents/{consentId}/history:
get:
summary: Retrieve consent history
description: |
Retrieves the complete history for a specific consent. Each history entry represents a pre-mutation snapshot captured immediately before a modification to the consent. Snapshot payloads are excluded by default
and can be included by setting `includeSnapshots=true`.
operationId: consents-history-GET
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "The unique identifier for the organization (e.g., the bank) that this consent belongs to."
schema:
type: string
example: "ORG-001"
- in: path
name: consentId
required: true
description: The unique identifier of the consent to retrieve history for.
schema:
type: string
- in: query
name: includeSnapshots
required: false
description: Include the full pre-mutation consent snapshot on each history entry when set to `true`.
schema:
type: boolean
default: false
responses:
"200":
description: OK. Consent history is returned in descending action time order.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentHistoryResponse"
examples:
withoutSnapshots:
summary: Consent history without snapshots
value:
id: "30000001-0003-0003-0003-000000000002"
history:
- historyId: "m3c4d5e6-f7a8-9012-abcd-ef1234567890"
actionTime: 1745200000000
actionBy: "user-001"
reason: "Consent authorizations updated"
- historyId: "m2b3c4d5-e6f7-8901-abcd-ef1234567890"
actionTime: 1745100000000
actionBy: "user-001"
reason: "Consent updated"
withSnapshots:
summary: Consent history with snapshots
value:
id: "30000001-0003-0003-0003-000000000002"
history:
- historyId: "m3c4d5e6-f7a8-9012-abcd-ef1234567890"
actionTime: 1745200000000
actionBy: "user-001"
reason: "Consent authorizations updated"
snapshot:
id: "30000001-0003-0003-0003-000000000002"
purposes:
- name: "Account management"
version: "v1"
elements:
- name: "User email"
namespace: "default"
approved: false
createdTime: 1702900000000
updatedTime: 1702900000000
groupId: "app-group-001"
type: "Account management"
status: "CREATED"
expirationTime: 1798741800000
recurringIndicator: true
dataAccessValidityDuration: 0
attributes:
department: "customer_service"
gdpr_compliant: "true"
region: "EU"
authorizations:
- id: "a1b2c3d4-e5f6-7890-abcd-ef1234567891"
userId: "user2@example.com"
type: "authorisation"
status: "APPROVED"
updatedTime: 1702900000000
resources:
accountIds:
- "acc-789"
- "acc-101"
- historyId: "m2b3c4d5-e6f7-8901-abcd-ef1234567890"
actionTime: 1745100000000
actionBy: "user-001"
reason: "Consent updated"
snapshot:
id: "30000001-0003-0003-0003-000000000002"
purposes:
- name: "Account management"
version: "v1"
elements:
- name: "User email"
namespace: "default"
approved: false
createdTime: 1702900000000
updatedTime: 1702900000000
groupId: "app-group-001"
type: "Account management"
status: "ACTIVE"
expirationTime: 1798741800000
recurringIndicator: true
dataAccessValidityDuration: 0
attributes:
department: "customer_service"
gdpr_compliant: "true"
region: "EU"
authorizations:
- id: "a1b2c3d4-e5f6-7890-abcd-ef1234567891"
userId: "user2@example.com"
type: "authorisation"
status: "APPROVED"
updatedTime: 1702900000000
resources:
accountIds:
- "acc-789"
- "acc-101"
"400":
description: Bad Request. The request was invalid, possibly due to a malformed `consentID` or missing headers.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"404":
description: Not Found. Consent does not exist.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
/consents/{consentId}/revoke:
post:
summary: Revoke a consent
description: |
Allows to revoke a consent. This action typically updates the consent status to a **revoke** type of status.
operationId: consents-revoke-POST
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "The unique identifier for the organization (e.g., the bank) that this consent belongs to."
schema:
type: string
example: "ORG-001"
- name: consentId
in: path
description: The unique identifier of the consent to update.
required: true
schema:
type: string
requestBody:
description: The payload containing the revocation data.
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentRevokePayload"
responses:
"200":
description: Successfully revoked the consent.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentRevokedResponse"
"400":
description: Bad Request. The request was malformed. This could be due to missing required headers or an invalid request body.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server while trying to create the consent.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
/consents/{consentId}/authorizations:
post:
summary: Add an authorization resource to a consent
description: Creates a new authorization resource and links it to the specified consent. This is typically done when a user interacts with the consent (e.g., at the start of the authorization flow).
operationId: consents-authorizations-POST
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "Organisation ID."
schema:
type: string
example: "ORG-001"
- name: consentId
in: path
description: The unique identifier of the consent.
required: true
schema:
type: string
requestBody:
description: Details of the authorization resource to be created.
content:
application/json:
schema:
"$ref": "#/components/schemas/AuthorizationResourceRequestBody"
required: true
responses:
'200':
description: OK. Returns the details of the authorization resource.
content:
application/json:
schema:
"$ref": "#/components/schemas/ConsentAuthorizationResource"
"400":
description: Bad Request. The request was malformed. This could be due to missing required headers or an invalid request body.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server while trying to create the consent.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
security:
- basicAuth: []
get:
summary: Retrieve all authorization resources for a consent
description: Retrieves a list of all authorization resources associated with a specific consent.
operationId: consentAuthorizationGet
tags:
- Consents
parameters:
- in: header
name: org-id
required: true
description: "Organisation ID."
schema:
type: string
example: "ORG-001"
- name: consentId
in: path
description: The unique identifier of the consent.
required: true
schema:
type: string
responses:
'200':
description: OK. Returns an array of authorization resources.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ConsentAuthorizationResource"
"400":
description: Bad Request. The request was malformed. This could be due to missing required headers or an invalid request body.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsentErrorCommon"
"500":
description: Internal Server Error. An unexpected error occurred on the server while trying to create the consent.
content:
application/json: