Skip to main content

Adding a new Consent Type version

This guide explains how to add a new version of an existing consent type in your Consent Catalog using the POST /open-api/v1/consent-catalog/{consentCatalogId}/version endpoint.

Overview

Consent types may need to be updated periodically due to changes in policies, terms, or regulatory requirements. To do this, you can add a new version to preserve historical consents granted while implementing the latest updates.

Endpoint

POST /open-api/v1/consent-catalog/{consentCatalogId}/version

Purpose

This endpoint allows you to create a new version of an existing consent type by specifying its unique ID (consentCatalogId). Adding a new version ensures that previous consents remain intact and that the most current version is available for users.

Request Structure

URL

POST https://api.platform.illow.io/open-api/v1/consent-catalog/{consentCatalogId}/version

Replace {consentCatalogId} with the unique ID of the consent type you want to version.

Headers

HeaderTypeRequiredDescription
X-API-KeyStringYesAPI Key for your account

Payload

The request body should be in JSON format and contain the following fields:

{
"url": "string",
"description": "string"
}

Payload Details

  • url (required): The URL of the updated policy or terms associated with the new version.
  • description (optional): A description of the changes made in this new version.

Example Request

curl -X POST https://api.platform.illow.io/open-api/v1/consent-catalog/44499771-03fb-4f0c-8620-88f538385446/version \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/updated-policy-v2",
"description": "Updated policy to reflect new data handling procedures."
}'

Example Response

{
"companyId": "b830b5fa-9180-4cb6-9f40-4cbe4729d0ac",
"consentCatalogId": "44499771-03fb-4f0c-8620-88f538385446",
"version": "2",
"type": "privacyPolicy",
"createdAt": 1622470423,
"url": "https://example.com/updated-policy-v2",
"description": "Updated policy to reflect new data handling procedures.",
"isUsed": false
}

Response Codes

  • 200 OK: The new version was successfully created.
  • 400 Bad Request: Invalid or missing parameters.
  • 404 Not Found: The specified consent type was not found.
  • 500 Internal Server Error: An unexpected error occurred.

Best Practices

  • Clearly describe changes in the description field to maintain a detailed version history of each consent type.
  • Use descriptive and accurate URLs to ensure users can access the correct policy or terms.
  • Regularly review and update consent types to stay compliant with the latest legal and regulatory requirements.