-
Notifications
You must be signed in to change notification settings - Fork 0
/
knowgo-consent-api.yaml
551 lines (551 loc) · 14.5 KB
/
knowgo-consent-api.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
---
openapi: 3.0.0
info:
title: KnowGo Consent Management API
description: The KnowGo Consent Management API, implementing the Kantara Initiative Consent Receipt Specification.
contact:
name: Adaptant Labs
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
servers:
- url: https://virtserver.swaggerhub.com/KnowGo/knowgo-consent-api/0.0.1
description: SwaggerHub API Auto Mocking
- url: https://api.knowgo.io/v1
description: Production instance
tags:
- name: consent
description: Consent Receipt Management
- name: categories
description: Data Categories
- name: purposes
description: Data Processing Purposes
paths:
/consents/categories:
get:
tags:
- categories
summary: List supported data categories
responses:
"200":
description: A JSON array of category types
content:
application/json:
schema:
type: array
items:
type: string
/consents/categories/{categoryId}:
get:
tags:
- categories
summary: Get information about a specific data category
parameters:
- name: categoryId
in: path
required: true
style: simple
explode: false
schema:
type: integer
description: ID number of data category
responses:
"200":
description: A JSON object detailing the Data Category
content:
application/json:
schema:
$ref: '#/components/schemas/DataCategoryDetail'
/consents/introspect:
post:
tags:
- consent
summary: Introspect a consent token
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Token'
responses:
"200":
description: Token valid
"401":
description: Unauthorized
"400":
description: Invalid token specification
"404":
description: Consent not found
/consents/purposes:
get:
tags:
- purposes
summary: List supported purposes of processing
responses:
"200":
description: A JSON array of processing purposes
content:
aplication/json:
schema:
type: array
items:
type: string
/consents/purposes/{purposeId}:
get:
tags:
- purposes
summary: Get information about a specific purpose of processing
parameters:
- name: purposeId
in: path
required: true
style: simple
explode: false
schema:
type: integer
description: ID number of processing purpose
responses:
"200":
description: A JSON object detailing the Purpose of Processing
content:
application/json:
schema:
$ref: '#/components/schemas/PurposeDetail'
/consents:
get:
tags:
- consent
summary: List all consent receipts
operationId: listConsentReceipts
responses:
"200":
description: List of consent receipts
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConsentReceiptDetail'
post:
tags:
- consent
summary: Add a new consent receipt
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ConsentReceipt'
required: true
responses:
"201":
description: Consent receipt successfully added
"401":
description: Unauthorized
/consents/receipts/{receiptId}:
get:
tags:
- consent
summary: Fetch a consent receipt
operationId: getConsentReceipt
parameters:
- name: receiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Consent Receipt ID
format: uuid
responses:
"200":
description: A JSON-encoded consent receipt
content:
application/json:
schema:
$ref: '#/components/schemas/ConsentReceipt'
delete:
tags:
- consent
summary: Revoke consent
operationId: revokeConsentReceipt
parameters:
- name: receiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Consent Receipt ID
format: uuid
responses:
"200":
description: Consent successfully revoked
"401":
description: Unauthorized
/consents/receipts/{receiptId}/supersede/{newReceiptId}:
post:
tags:
- consent
summary: Replace a consent receipt with a newer consent
operationId: updateConsentReceipt
parameters:
- name: receiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Consent Receipt ID
format: uuid
- name: newReceiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Replacement Consent Receipt ID
format: uuid
responses:
"200":
description: Consent receipt successfully superseded
"401":
description: Unauthorized
"404":
description: Invalid consent receipt specification
/consents/receipts/{receiptId}/token:
get:
tags:
- consent
summary: Fetch a consent receipt token
operationId: getConsentReceiptToken
parameters:
- name: receiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Consent Receipt ID
format: uuid
responses:
"200":
description: Consent token successfully generated
"401":
description: Unauthorized
components:
schemas:
ConsentReceipt:
type: object
required:
- version
- jurisdiction
- collectionMethod
- consentReceiptId
- piiPrincipalId
- piiControllers
- policyUrl
- services
- sensitive
properties:
version:
type: string
description: |
The version of the Kantara CR specification that the receipt
conforms to.
example: 'KI-CR-v1.1.0'
enum:
- 'KI-CR-v1.1.0'
jurisdiction:
type: string
description: |
The legal jurisdiction(s) under which the processing of personal
data occurs, in ISO 3166-1 alpha-2 2-character country code format.
May be a single jurisdiction, or a list of possible ones separated
by a space.
example: 'DE AT IT'
consentTimestamp:
type: integer
format: int64
description: |
Timestamp of when consent was issued, in seconds since the UNIX
epoch.
example: 1635752562
collectionMethod:
type: string
description: Method of collection describing how consent was obtained
example: "web sign-up form"
consentReceiptId:
type: string
description: Consent Receipt ID
format: uuid
example: '81b5986c-dd92-4fef-b83e-2bc013334610'
publicKey:
type: string
description: The data controller's public key.
language:
type: string
description: |
Language in which the consent was obtained. MUST use ISO
639-1:2002 if this field is used.
piiPrincipalId:
type: string
description: |
PII Principal-provided identifier, such as a user name, email
address, or claim.
piiControllers:
type: array
items:
$ref: '#/components/schemas/DataController'
policyUrl:
type: string
format: uri
description: |
Privacy policy URL of the service referred to by the receipt.
example: 'https://example.com/privacy-policy/'
services:
type: array
description: |
A service or group of services for which PII is being collected,
together with service-specific purposes of processing.
items:
$ref: '#/components/schemas/Service'
sensitive:
type: boolean
description: |
Indicates whether the consent interaction contains PII that is
designated as sensitive.
spiCat:
type: array
items:
type: string
description: List of sensitive or special-category data categories
example: '2 - Biometric'
ConsentReceiptDetail:
properties:
consentReceiptId:
type: string
description: Consent Receipt ID
format: uuid
example: '81b5986c-dd92-4fef-b83e-2bc013334610'
status:
$ref: '#/components/schemas/ConsentStatus'
ConsentStatus:
type: string
description: Possible consent states
enum:
- ACTIVE
- REVOKED
- SUPERSEDED
- EXPIRED
ConsentType:
type: string
description: Possible consent types
enum:
- EXPLICIT
- IMPLICIT
- N/A
DataCategory:
type: string
enum:
- Biographical
- Contact
- Biometric
- SocialContact
- NetworkService
- Health
- Financial
- OfficialID
- SocialBenefitData
- JudicialData
- AssetData
- HRData
- MentalHealth
- Membership
- Behavioral
- Profiling
DataCategoryDetail:
properties:
categoryId:
type: integer
description: ID of data category
category:
$ref: '#/components/schemas/DataCategory'
DataController:
type: object
required:
- piiController
- onBehalf
- contact
- address
- email
- phone
properties:
piiController:
type: string
description: Legal name of the first controller who collects the data
onBehalf:
type: boolean
description: |
Data processor working on behalf of a data controller or other data
processor.
contact:
type: string
description: Contact name of the controller
address:
$ref: '#/components/schemas/PostalAddress'
email:
type: string
format: email
description: An email address at which the controller can be reached
phone:
type: string
description: A phone number at which the controller can be reached
piiControllerURL:
type: string
format: uri
description: An optional URL for the controller's website
PostalAddress:
type: object
description: |
The postal address at which a data controller or processor can be
reached.
required:
- addressCountry
- addressLocality
- postalCode
- streetAddress
properties:
addressCountry:
type: string
addressLocality:
type: string
addressRegion:
type: string
postOfficeBoxNumber:
type: string
postalCode:
type: string
streetAddress:
type: string
PurposeDetail:
properties:
purposeId:
type: integer
description: ID of processing purpose
purpose:
type: string
description: Name of purpose
description:
type: string
description: Description of purpose
PurposeModel:
type: object
required:
- purpose
- purposeCategory
- consentType
- piiCategory
- primaryPurpose
- termination
- thirdPartyDisclosure
properties:
purpose:
type: string
purposeCategory:
$ref: '#/components/schemas/PurposeSpecification'
consentType:
$ref: '#/components/schemas/ConsentType'
piiCategory:
$ref: '#/components/schemas/DataCategory'
primaryPurpose:
type: boolean
termination:
type: string
thirdPartyDisclosure:
type: boolean
thirdPartyName:
type: string
PurposeSpecification:
type: string
enum:
- CoreFunction
- ContractedService
- Delivery
- ContactRequested
- PersonalizedExperience
- Marketing
- MarketingThirdParties
- SharingForDelivery
- SharingForMarketing
- ThirdPartySharingForCoreFunction
- ThirdPartySharingForOthers
- LegallyRequiredDataRetention
- RequiredByLawEnforcementOrGovernment
- ProtectingYourHealth
- ProtectingOurInterests
- ImprovePerformance
Service:
type: object
required:
- service
- purposes
properties:
service:
type: string
description: Service identifier
purposes:
type: array
items:
$ref: '#/components/schemas/PurposeModel'
Token:
required:
- token
type: object
properties:
token:
type: string
parameters:
receiptId:
name: receiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Consent Receipt ID
format: uuid
newReceiptId:
name: newReceiptId
in: path
required: true
style: simple
explode: false
schema:
type: string
description: Replacement Consent Receipt ID
format: uuid
categoryId:
name: categoryId
in: path
required: true
style: simple
explode: false
schema:
type: integer
description: ID number of data category
purposeId:
name: purposeId
in: path
required: true
style: simple
explode: false
schema:
type: integer
description: ID number of processing purpose