Consent management API
Base URL: https://api.asgardeo.io/t/<ORGANIZATION_NAME>/api/identity/consent-mgt/v1.0
The WSO2 Identity Platform Consent Management Rest API (version 1.0.0).
Download the OpenAPI definition (YAML)
Consent
List Consents
GET /consents
This API is used to list consent elements based on the filtered attributes.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | Number of search results | |
offset | query | integer | Start index of the search | |
piiPrincipalId | query | string | Subject identifier | |
spTenantDomain | query | string | Service provider tenant domain | |
service | query | string | Service name | |
state | query | string | State (ACTIVE/REVOKED) |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | ConsentResponse |
400 | Bad Request | Error |
401 | Unauthorized | Error |
500 | Server Error | Error |
Add consent
POST /consents
This API is used to store consent information given by the user.
Request body (required): application/json
This represents the consent element that needs to be stored.
Schema: ConsentRequest
6 properties
Responses
| Code | Description | Schema |
|---|---|---|
201 | Successful response | ConsentAddResponse |
400 | Bad Request | Error |
401 | Unauthorized | Error |
409 | Conflict | Error |
500 | Server Error | Error |
Retrieve a consent receipt
GET /consents/receipts/{receiptId}
This API is used to retrieve consent using the conset receipt ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
receiptId | path | string | Yes | The unique identifier of a receipt |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | ConsentReceipt |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
Purpose
Retrieve all purposes
GET /consents/purposes
This API is used to retrieve all purposes.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
group | query | string | Purpose group | |
groupType | query | string | Type of the purpose group | |
limit | query | integer | Number of search results | |
offset | query | integer | Start index of the search |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | purposes |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
Retrieve a purpose
GET /consents/purposes/{purposeId}
This API is used to retrieve a specific purpose using the purpose ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
purposeId | path | string | Yes | Id of the purpose |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | purposeGetResponse |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
Purpose Category
Retrieve all purpose categories
GET /consents/purpose-categories
This API is used to retrieve all purpose categories.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | Number of search results | |
offset | query | integer | Start index of the search |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | purpseCategories |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
Retrieve a purpose category
GET /consents/purpose-categories/{purposeCategoryId}
This API is used to retrieve a purpose category using the purpose category ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
purposeCategoryId | path | string | Yes | Unique ID of the purpose category |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | purposeCategoryListResponse |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
PII Category
Retrieve all PII categories
GET /consents/pii-categories
This API is used to retrieve all PII categories.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | integer | Number of search results | |
offset | query | integer | Start index of the search |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | piiCategories |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
Retrieve a PII category
GET /consents/pii-categories/{piiCategoryId}
This API is used to retrieve a specific PII category using the PII category ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
piiCategoryId | path | string | Yes | Unique ID of the PII category |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | piiCategoryListResponse |
400 | Bad Request | Error |
401 | Unauthorized | Error |
404 | Not Found | Error |
500 | Server Error | Error |
Schemas
ConsentRequest
Type: object
PurposeRequest
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
purpose | string | Yes | |
description | string | ||
group | string | ||
groupType | string | ||
piiCategories | array of purposePiiCategoryRequest |
purposePiiCategoryRequest
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiCategoryId | integer | ||
mandatory | boolean |
PIIcategoryRequest
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiCategory | string | Yes | |
description | string | ||
displayName | string | ||
sensitive | boolean |
purposes
Type: array of purposeListResponse
purpseCategories
Type: array of purposeCategoryListResponse
piiCategories
Type: array of piiCategoryListResponse
ConsentAddResponse
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
consentReceiptID | string | Yes | |
language | string | ||
piiPrincipalId | string | Yes | |
tenantDomain | string | Yes |
ConsentResponse
Type: object
7 properties
| Name | Type | Required | Description |
|---|---|---|---|
consentReceiptID | string | Yes | |
language | string | ||
piiPrincipalId | string | Yes | |
tenantDomain | string | Yes | |
state | string | ||
spDisplayName | string | ||
spDescription | string |
ConsentReceipt
Type: object
15 properties
| Name | Type | Required | Description |
|---|---|---|---|
version | string | Yes | The version of this specification to which a receipt conforms. The value MUST be “KI-CR-v1.1.0” for this version of the specification. |
jurisdiction | string | Yes | The jurisdiction(s) applicable to this transaction. |
consentTimestamp | integer (int64) | Yes | Date and time of the consent transaction. The JSON value is expressed as the number of seconds since 1970-01-01 00:00:00 GMT |
collectionMethod | string | Yes | A description of the method by which consent was obtained. |
consentReceiptID | string | Yes | A unique number for each Consent Receipt. |
publicKey | string | The PII Controller’s public key. | |
language | string | Language in which the consent was obtained as for ISO 639-1:2002 [ISO 639]. | |
piiPrincipalId | string | Yes | PII Principal-provided identifier. E.g., email address. |
tenantDomain | string | Tenant domain of the service (SP). | |
state | string | Current state of the receipt. | |
piiControllers | array of piiController | Yes | An array that contains one or more items where each item represents one PII Controller. |
policyUrl | string | Yes | A link to the PII Controller’s privacy statement/policy and applicable terms of use in effect when the consent was obtained, and the receipt was issued. |
services | array of serviceResponse | Yes | An array that contains one or more items where each item represents one Service. |
sensitive | boolean | Yes | Indicates whether the consent interaction contains PII that is designated sensitive or not sensitive. |
spiCat | array of string | Yes | A listing of categories where PII data collected is sensitive. |
service
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
service | string | The service or group of services being provided for which PII is collected. The name of the service for which consent for the collection, use, and disclosure of PII is being provided. | |
serviceDisplayName | string | display name of the service | |
serviceDescription | string | Description about the service | |
tenantDomain | string | Tenant domain of the SP | |
purposes | array of purpose |
serviceResponse
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
service | string | The service or group of services being provided for which PII is collected. The name of the service for which consent for the collection, use, and disclosure of PII is being provided. | |
serviceDisplayName | string | display name of the service | |
serviceDescription | string | Description about the service | |
tenantDomain | string | Tenant domain of the SP | |
purposes | array of purposeResponse |
purpose
Type: object
8 properties
| Name | Type | Required | Description |
|---|---|---|---|
purposeId | integer | A unique Id of purpose | |
purposeCategoryId | array of integer | Yes | The reason the PII Controller is collecting the PII. |
consentType | string | The type of the consent used by the PII Controller as their authority to collect, use or disclose PII. | |
piiCategory | array of piiCategoryList | A list of defined PII categories Ids. | |
primaryPurpose | boolean | Indicates if a purpose is part of the core service of the PII Controller. Possible values are TRUE or FALSE. | |
termination | string | Yes | Conditions for the termination of consent. Link to policy defining how consent or purpose is terminated. |
thirdPartyDisclosure | boolean | Yes | Indicates if the PII Controller is disclosing PII to a third party. Possible values are TRUE or FALSE. |
thirdPartyName | string | Yes | The name or names of the third party to which the PII Processor may disclose the PII. |
purposeResponse
Type: object
9 properties
| Name | Type | Required | Description |
|---|---|---|---|
purpose | string | A short, clear explanation of why the PII item is required. | |
purposeId | integer | Id of the purpose. | |
purposeCategory | array of string | Yes | The reason the PII Controller is collecting the PII. |
consentType | string | The type of the consent used by the PII Controller as their authority to collect, use or disclose PII. | |
piiCategory | array of piiCategoryNameList | Yes | A list of defined PII categories Ids. PII Category should reflect the category that will be shared as understood by the PII Principal. |
primaryPurpose | boolean | Indicates if a purpose is part of the core service of the PII Controller. Possible values are TRUE or FALSE. | |
termination | string | Yes | Conditions for the termination of consent. Link to policy defining how consent or purpose is terminated. |
thirdPartyDisclosure | boolean | Yes | Indicates if the PII Controller is disclosing PII to a third party. Possible values are TRUE or FALSE. |
thirdPartyName | string | Yes | The name or names of the third party to which the PII Processor may disclose the PII. |
purposeListResponse
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
purposeId | integer | ||
purpose | string | ||
description | string | ||
group | string | ||
groupType | string |
purposeGetResponse
Type: object
6 properties
| Name | Type | Required | Description |
|---|---|---|---|
purposeId | integer | ||
purpose | string | ||
description | string | ||
group | string | ||
groupType | string | ||
piiCategories | array of purposePiiCategoryListResponse |
purposeCategoryListResponse
Type: object
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
purposeCategoryId | integer | ||
purposeCategory | string | ||
description | string |
piiCategoryList
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiCategoryId | integer | ||
validity | string |
piiCategoryNameList
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiCategoryName | string | ||
piiCategoryId | integer | ||
validity | string | ||
piiCategoryDisplayName | string |
piiCategoryListResponse
Type: object
5 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiCategoryId | integer | ||
piiCategory | string | ||
description | string | ||
displayName | string | ||
sensitive | boolean |
purposePiiCategoryListResponse
Type: object
6 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiCategoryId | integer | ||
piiCategory | string | ||
description | string | ||
displayName | string | ||
sensitive | boolean | ||
mandatory | boolean |
address
Type: object
The physical address of PII controller. Postal address for contacting the PII Controller. This is compliant with the schema https://schema.org/PostalAddress.
6 properties
| Name | Type | Required | Description |
|---|---|---|---|
addressCountry | string | ||
addressLocality | string | ||
addressRegion | string | ||
postOfficeBoxNumber | string | ||
postalCode | string | ||
streetAddress | string |
piiController
Type: object
7 properties
| Name | Type | Required | Description |
|---|---|---|---|
piiController | string | Yes | Name of the first PII Controller who collects the data. This entity is accountable for compliance with the management of PII. The PII Controller determines the purpose(s) and type(s) of PII processing. |
contact | string | Yes | Contact name of the PII Controller. This field MUST contain a non-empty string. |
address | address | Yes | The physical address of PII controller. Postal address for contacting the PII Controller. This is compliant with the schema https://schema.org/PostalAddress. |
email | string | Yes | Contact email address of the PII Controller. The direct email to contact the PII Controller regarding the consent or privacy contract. |
phone | string | Yes | Contact phone number of the PII Controller. The business phone number to contact the PII Controller regarding the consent. |
onBehalf | boolean | A PII Processor acting on behalf of a PII Controller or PII Processor. For example, a third-party analytics service would be a PII Processor on behalf of the PII Controller, or a site operator acting on behalf of the PII Controller. | |
piiControllerUrl | string | A URL for contacting the PII Controller. |
Was this page helpful?