Skip to content

Universal Consent

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
}

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 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"
}

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

Request:

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

Response:

{
"ConsentGiven": "string"
}

POST /api/universalconsent/integration/:IntegrationId

Section titled “POST /api/universalconsent/integration/:IntegrationId”

Create or update a universal consent via integration. This endpoint is designed for integrations to record consents without authentication using the Integration ID.

Request:

{
"CustomUserId": "string", // Optional, e.g. user email or any custom Id
"ConsentGiven": "string", // either of 'All', 'Partial', 'None'
"ConsentType": "string" // e.g., EmailMarketing, EmailLink, Newsletter
}

Response:

{
"Created": "string", // Date
"ClientId": "string", // Unique id for the user who has given the consent
"Reference": "string", // Integration name
"CustomUserId": "string" // Optional
}

GET /api/universalconsent/integration/:ClientId

Section titled “GET /api/universalconsent/integration/:ClientId”

Check if a consent exists for the integration, defined by the client ID.

Query Parameters:

  • IntegrationId (required): The ID of the integration

Response:

{
"ClientId": "string",
"Reference": "string",
"ConsentGiven": "string", // either of 'All', 'Partial', 'None'
"Created": "string",
"Metadata": "string"
}

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"
}
}

Subscribe to the consent updates by specified criteria.

Request:

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

Response: 200 OK

Test the API endpoints directly from your browser. Select an endpoint, configure the request, and click "Run" to see the response.

Endpoints

POST

Update Consent via Integration

Create or update a universal consent via integration using Integration ID. No authentication required.

https://api-prod.secureprivacy.ai/api/universalconsent/integration/{IntegrationId}
Warning: Authentication required: Add your API key below

Modify the request parameters as needed.