Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Consent management API

Download OpenAPI (YAML)Version 1.0.0

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)

List Consents​

GET /consents

This API is used to list consent elements based on the filtered attributes.

Parameters

NameInTypeRequiredDescription
limitqueryinteger

Number of search results

offsetqueryinteger

Start index of the search

piiPrincipalIdquerystring

Subject identifier

spTenantDomainquerystring

Service provider tenant domain

servicequerystring

Service name

statequerystring

State (ACTIVE/REVOKED)

Responses

CodeDescriptionSchema
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
NameTypeRequiredDescription
servicesarray of service
collectionMethodstring
jurisdictionstring
languagestring
policyURLstring
propertiesarray of Property

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
receiptIdpathstringYes

The unique identifier of a receipt

Responses

CodeDescriptionSchema
200

OK

ConsentReceipt
400

Bad Request

Error
401

Unauthorized

Error
404

Not Found

Error
500

Server Error

Error

Revoke consent​

DEL /consents/receipts/{receiptId}

This API is used to revoke consent.

Parameters

NameInTypeRequiredDescription
receiptIdpathstringYes

This represents the Revoke Receipt ID.

Responses

CodeDescriptionSchema
200

OK

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

NameInTypeRequiredDescription
groupquerystring

Purpose group

groupTypequerystring

Type of the purpose group

limitqueryinteger

Number of search results

offsetqueryinteger

Start index of the search

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
purposeIdpathstringYes

Id of the purpose

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
limitqueryinteger

Number of search results

offsetqueryinteger

Start index of the search

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
purposeCategoryIdpathstringYes

Unique ID of the purpose category

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
limitqueryinteger

Number of search results

offsetqueryinteger

Start index of the search

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
piiCategoryIdpathstringYes

Unique ID of the PII category

Responses

CodeDescriptionSchema
200

OK

piiCategoryListResponse
400

Bad Request

Error
401

Unauthorized

Error
404

Not Found

Error
500

Server Error

Error

Schemas​

Error​

Type: object

3 properties
NameTypeRequiredDescription
codestring
messagestring
descriptionstring

ConsentRequest​

Type: object

6 properties
NameTypeRequiredDescription
servicesarray of service
collectionMethodstring
jurisdictionstring
languagestring
policyURLstring
propertiesarray of Property

PurposeRequest​

Type: object

5 properties
NameTypeRequiredDescription
purposestringYes
descriptionstring
groupstring
groupTypestring
piiCategoriesarray of purposePiiCategoryRequest

purposePiiCategoryRequest​

Type: object

2 properties
NameTypeRequiredDescription
piiCategoryIdinteger
mandatoryboolean

PIIcategoryRequest​

Type: object

4 properties
NameTypeRequiredDescription
piiCategorystringYes
descriptionstring
displayNamestring
sensitiveboolean

purposes​

Type: array of purposeListResponse

purpseCategories​

Type: array of purposeCategoryListResponse

piiCategories​

Type: array of piiCategoryListResponse

Property​

Type: object

2 properties
NameTypeRequiredDescription
keystring
valuestring

ConsentAddResponse​

Type: object

4 properties
NameTypeRequiredDescription
consentReceiptIDstringYes
languagestring
piiPrincipalIdstringYes
tenantDomainstringYes

ConsentResponse​

Type: object

7 properties
NameTypeRequiredDescription
consentReceiptIDstringYes
languagestring
piiPrincipalIdstringYes
tenantDomainstringYes
statestring
spDisplayNamestring
spDescriptionstring

ConsentReceipt​

Type: object

15 properties
NameTypeRequiredDescription
versionstringYes

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.

jurisdictionstringYes

The jurisdiction(s) applicable to this transaction.

consentTimestampinteger (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

collectionMethodstringYes

A description of the method by which consent was obtained.

consentReceiptIDstringYes

A unique number for each Consent Receipt.

publicKeystring

The PII Controller’s public key.

languagestring

Language in which the consent was obtained as for ISO 639-1:2002 [ISO 639].

piiPrincipalIdstringYes

PII Principal-provided identifier. E.g., email address.

tenantDomainstring

Tenant domain of the service (SP).

statestring

Current state of the receipt.

piiControllersarray of piiControllerYes

An array that contains one or more items where each item represents one PII Controller.

policyUrlstringYes

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.

servicesarray of serviceResponseYes

An array that contains one or more items where each item represents one Service.

sensitivebooleanYes

Indicates whether the consent interaction contains PII that is designated sensitive or not sensitive.

spiCatarray of stringYes

A listing of categories where PII data collected is sensitive.

service​

Type: object

5 properties
NameTypeRequiredDescription
servicestring

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.

serviceDisplayNamestring

display name of the service

serviceDescriptionstring

Description about the service

tenantDomainstring

Tenant domain of the SP

purposesarray of purpose

serviceResponse​

Type: object

5 properties
NameTypeRequiredDescription
servicestring

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.

serviceDisplayNamestring

display name of the service

serviceDescriptionstring

Description about the service

tenantDomainstring

Tenant domain of the SP

purposesarray of purposeResponse

purpose​

Type: object

8 properties
NameTypeRequiredDescription
purposeIdinteger

A unique Id of purpose

purposeCategoryIdarray of integerYes

The reason the PII Controller is collecting the PII.

consentTypestring

The type of the consent used by the PII Controller as their authority to collect, use or disclose PII.

piiCategoryarray of piiCategoryList

A list of defined PII categories Ids.

primaryPurposeboolean

Indicates if a purpose is part of the core service of the PII Controller. Possible values are TRUE or FALSE.

terminationstringYes

Conditions for the termination of consent. Link to policy defining how consent or purpose is terminated.

thirdPartyDisclosurebooleanYes

Indicates if the PII Controller is disclosing PII to a third party. Possible values are TRUE or FALSE.

thirdPartyNamestringYes

The name or names of the third party to which the PII Processor may disclose the PII.

purposeResponse​

Type: object

9 properties
NameTypeRequiredDescription
purposestring

A short, clear explanation of why the PII item is required.

purposeIdinteger

Id of the purpose.

purposeCategoryarray of stringYes

The reason the PII Controller is collecting the PII.

consentTypestring

The type of the consent used by the PII Controller as their authority to collect, use or disclose PII.

piiCategoryarray of piiCategoryNameListYes

A list of defined PII categories Ids. PII Category should reflect the category that will be shared as understood by the PII Principal.

primaryPurposeboolean

Indicates if a purpose is part of the core service of the PII Controller. Possible values are TRUE or FALSE.

terminationstringYes

Conditions for the termination of consent. Link to policy defining how consent or purpose is terminated.

thirdPartyDisclosurebooleanYes

Indicates if the PII Controller is disclosing PII to a third party. Possible values are TRUE or FALSE.

thirdPartyNamestringYes

The name or names of the third party to which the PII Processor may disclose the PII.

purposeListResponse​

Type: object

5 properties
NameTypeRequiredDescription
purposeIdinteger
purposestring
descriptionstring
groupstring
groupTypestring

purposeGetResponse​

Type: object

6 properties
NameTypeRequiredDescription
purposeIdinteger
purposestring
descriptionstring
groupstring
groupTypestring
piiCategoriesarray of purposePiiCategoryListResponse

purposeCategoryListResponse​

Type: object

3 properties
NameTypeRequiredDescription
purposeCategoryIdinteger
purposeCategorystring
descriptionstring

piiCategoryList​

Type: object

2 properties
NameTypeRequiredDescription
piiCategoryIdinteger
validitystring

piiCategoryNameList​

Type: object

4 properties
NameTypeRequiredDescription
piiCategoryNamestring
piiCategoryIdinteger
validitystring
piiCategoryDisplayNamestring

piiCategoryListResponse​

Type: object

5 properties
NameTypeRequiredDescription
piiCategoryIdinteger
piiCategorystring
descriptionstring
displayNamestring
sensitiveboolean

purposePiiCategoryListResponse​

Type: object

6 properties
NameTypeRequiredDescription
piiCategoryIdinteger
piiCategorystring
descriptionstring
displayNamestring
sensitiveboolean
mandatoryboolean

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
NameTypeRequiredDescription
addressCountrystring
addressLocalitystring
addressRegionstring
postOfficeBoxNumberstring
postalCodestring
streetAddressstring

piiController​

Type: object

7 properties
NameTypeRequiredDescription
piiControllerstringYes

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.

contactstringYes

Contact name of the PII Controller. This field MUST contain a non-empty string.

addressaddressYes

The physical address of PII controller. Postal address for contacting the PII Controller. This is compliant with the schema https://schema.org/PostalAddress.

emailstringYes

Contact email address of the PII Controller. The direct email to contact the PII Controller regarding the consent or privacy contract.

phonestringYes

Contact phone number of the PII Controller. The business phone number to contact the PII Controller regarding the consent.

onBehalfboolean

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.

piiControllerUrlstring

A URL for contacting the PII Controller.

Was this page helpful?