Universal Consent
Web endpoints
Section titled “Web endpoints”POST /api/universalconsent
Section titled “POST /api/universalconsent”[Authentication required]
Section titled “[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
Section titled “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
Section titled “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
Section titled “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"}Custom consent integration endpoints
Section titled “Custom consent integration endpoints”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”[Authentication required]
Section titled “[Authentication required]”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"}Consent management endpoints
Section titled “Consent management endpoints”GET /api/universalconsent
Section titled “GET /api/universalconsent”[Authentication required]
Section titled “[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
Section titled “POST /api/universalconsent/subscribe”[Authentication required]
Section titled “[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
API Demo
Section titled “API Demo”Test the API endpoints directly from your browser. Select an endpoint, configure the request, and click "Run" to see the response.
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}Modify the request parameters as needed.