Skip to content

Universal Consent

Web endpoints

POST /api/universalconsent

[Authentication required]

Record the consent of a user to the object. Object metadata is passed in the Metadata. Object reference (e.g. Id) can be passed in Reference to sort out that people are consenting to the same entity.

Request:

{
"ConsentGiven": "string", // either of 'All', 'Partial', 'None'
"CustomUserId": "string", // Optional, e.g. user email or any custom Id
"URI": "string", // Optional, derived from Origin header if not passed
"Metadata": "string", // JSON model of the consent object, max. 200 characters
"Reference": "string", // Identifier of the consent target, URL, Id or Anything else
"ConsentType": "string" // Customer-defined type of consent, e.g. Call, Chatbot, Dealership
}

Response:

{
"Created": "string" // Date,
"ClientId": "string" // Unique id for the user who has given the consent
// the same CustomUserId always leads to the same ClientId
}

PATCH /api/universalconsent

Update the consent to the given object (reference) associated with user id.

Request:

{
"ClientId": "string",
"Reference": "string",
"ConsentGiven": "string",
"Metadata": "string"
}

Response: 200 OK

GET /api/universalconsent/:clientId

Get the full universal user consent record for the given object (reference).

Response:

{
"Id": "string",
"Created": "string",
"LastUpdated": "string",
"URI": "string",
"ConsentGiven": "string",
"ConsentType": "string",
"Metadata": "string",
"Reference": "string",
"CustomUserId": "string", // Optional
"ClientId": "string"
}

GET /api/universalconsent/consent-given

Checks if a user has already consented to the given consent object (reference).

Request:

{
"ClientId": "string",
"Reference": "string"
}

Response:

{
"ConsentGiven": "string"
}

GET /api/universalconsent

[Authentication required]

Get consents by the given filters. By default selects all consents for the last week.

Request:

{
"CustomUserId": "string", // Optional, e.g. user email or any custom Id
"Reference": "string", // Optional
"ConsentType": "string", // Optional
"FromDate": "DateTime", // Optional
"ToDate": "DateTime", // Optional
"ConsentGiven": "boolean", // Optional
"IP": "string", // Optional
"UserAgent": "string", // Optional
"City": "string", // Optional
"State": "string", // Optional
"Country": "string" // Optional
}

Response: The list of consents in the following format:

{
"Id": "string",
"Created": "string",
"LastUpdated": "string",
"ConsentGiven": "boolean",
"URI": "string",
"ConsentType": "string",
"Metadata": "string",
"Reference": "string",
"ClientId": "string",
"Fingerprint": {
"CustomUserId": "string",
"IP": "string",
"ProxifiedIP": "string",
"UserAgent": "string",
"City": "string",
"State": "string",
"Country": "string"
}
}

POST /api/universalconsent/subscribe

[Authentication required]

Subscribe to the consent updates by specified criteria.

Request:

{
"CustomUserId": "string", // Optional
"Reference": "string", // Optional
"ConsentType": "string", // Optional
"WebhookUrl": "string"
}

Response: 200 OK