Manage consent documents
This page explains how to create and manage consent documents, versions, and localizations using the Consent Management v2 Configuration API. All operations require administrative privileges.
Document management involves three levels, each managed through dedicated API endpoints:
| Level | Object | API base path |
|---|---|---|
| 1 | Document definition | POST /consent-management/api/v1/config/documents |
| 2 | Document version | POST /consent-management/api/v1/config/documents/{definitionId}/versions |
| 3 | Document localization | POST /consent-management/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations |
Document definitions
A document definition is the top-level object in the Consent Management v2 data model. It is the logical container for a consent document, such as a privacy policy. It identifies the document type, whether it is mandatory, and the default language.
Document definition responses
A successful response returns the document definition properties:
| Property | Description |
|---|---|
id |
Unique identifier, prefixed with DD- (for example, DD-a1b2c3d4-...) |
name |
Human-readable name, unique within the tenant (for example, Privacy Policy) |
documentType |
The document category: PRIVACY_POLICY, TERMS_OF_SERVICE, COOKIE_POLICY, MARKETING_PERMISSION, or CUSTOM |
customTypeKey |
Required when documentType is CUSTOM. It must follow UPPER_SNAKE_CASE format (for example, EMPLOYEE_HANDBOOK) |
isMandatory |
Whether user consent to this document is required to access the service |
defaultLocale |
The default language for this document (for example, en_US) |
Document types
The documentType field classifies the document. The following standard types are available:
| Type | Description |
|---|---|
PRIVACY_POLICY |
Privacy policy document |
TERMS_OF_SERVICE |
Terms of service or terms and conditions |
COOKIE_POLICY |
Cookie usage policy |
MARKETING_PERMISSION |
Consent to receive marketing communications |
CUSTOM |
Any other document type. Requires a customTypeKey in UPPER_SNAKE_CASE format (for example, EMPLOYEE_HANDBOOK). Custom type keys must be unique across the tenant. |
Create a document definition (POST)
POST /consent-management/api/v1/config/documents
To create a document definition, send a request with the following fields:
| Field | Required | Description |
|---|---|---|
name |
Yes | A human-readable name, unique within the tenant. 1–100 characters. |
documentType |
Yes | One of the standard types or CUSTOM. |
customTypeKey |
Conditional | Required when documentType is CUSTOM. |
isMandatory |
Yes | true if users must consent to access the service; false if consent is optional. |
defaultLocale |
Yes | The default language code (for example, en_US). Must be one of the tenant's configured locales. |
description |
No | Optional description, up to 1000 characters. |
Example: Mandatory privacy policy in English
{
"name": "Privacy Policy",
"documentType": "PRIVACY_POLICY",
"defaultLocale": "en_US",
"isMandatory": true,
"description": "Our privacy policy explains how we collect and protect your data."
}
Update a document definition (PATCH)
PATCH /consent-management/api/v1/config/documents/{definitionId}
Update the name, description, defaultLocale, and isMandatory fields. The documentType and customTypeKey fields are immutable after creation.
Note
Changing defaultLocale is allowed only if all ACTIVE and SCHEDULED versions already contain a localization for the new locale.
Delete a document definition
A document definition can only be deleted if it has no versions, or all of its versions are in DRAFT status. Versions in SCHEDULED, ACTIVE, SUNSET, or ARCHIVED status must be removed or transitioned before the definition can be deleted.
Document versions
A document version represents a specific revision of a document's content, along with all of its localizations.
Document version responses
A successful response returns the document version properties:
| Property | Description |
|---|---|
id |
Unique identifier, prefixed with DV- |
versionNumber |
Sequential number assigned when the version is scheduled for activation. DRAFT versions have no version number. |
versionName |
Human-readable label (for example, Q1 2025 Update) |
effectiveDate |
The date and time when the version becomes active |
sunsetDate |
The date and time when the version stops accepting new consents |
archiveDate |
The date and time when the version is archived |
Each document definition can have multiple versions, but only one version can be ACTIVE at any given time.
A document version holds the lifecycle dates for a specific revision of a document, along with all of its localizations.
Version lifecycle
Document version statuses are computed automatically from dates. Administrators do not set statuses manually. The system derives the status of each version in real time based on the current time and the version's lifecycle dates.
Status definitions
| Status | Condition |
|---|---|
DRAFT |
No effectiveDate is set, or effectiveDate is in the future without being formally scheduled |
SCHEDULED |
effectiveDate is set and is in the future |
ACTIVE |
effectiveDate has passed and sunsetDate has not yet passed (or is not set). Only one version per document can be ACTIVE at a time. |
SUNSET |
sunsetDate has passed but archiveDate has not yet passed. The version is no longer offered to new users, but existing consents to it remain valid during the grace period. |
ARCHIVED |
archiveDate has passed. The version is no longer valid for new or existing consents. |
Status transitions
Document versions transition through the following statuses:
DRAFT -> SCHEDULED -> ACTIVE -> SUNSET -> ARCHIVED
- DRAFT -> SCHEDULED: Set an
effectiveDatein the future. - SCHEDULED -> ACTIVE: Happens automatically when the clock reaches
effectiveDate. - ACTIVE -> SUNSET: Happens automatically when the clock reaches
sunsetDate. - SUNSET -> ARCHIVED: Happens automatically when the clock reaches
archiveDate. - SCHEDULED -> DRAFT: Remove the
effectiveDate(un-schedule the version).
Note
DRAFT versions can be deleted. ACTIVE, SUNSET, and ARCHIVED versions cannot be deleted to preserve the integrity of the consent ledger.
Grace period
When a new version becomes ACTIVE, the previous version transitions to SUNSET. If the previous version has an archiveDate in the future, users who already consented to it are in a grace period. During the grace period:
-
Existing users can continue to access the service without re-consenting.
-
The Runtime API returns the new
ACTIVEversion as outstanding, with apreviousVersionOnGracePeriodfield indicating when the grace period ends. -
After the
archiveDate, the grace period ends and users who have not consented to the new version are blocked from accessing the service.
Create a version (POST)
POST /consent-management/api/v1/config/documents/{definitionId}/versions
Send a request with the following fields:
| Field | Required | Description |
|---|---|---|
versionName |
Yes | A human-readable label, unique within the document. 1–100 characters. |
contentMode |
No | The content delivery mode. Only EXTERNAL_URL is supported. |
localizations |
No | An array of localizations to create together with the version. Can be added later. |
All versions are created in DRAFT status. Lifecycle dates (effectiveDate, sunsetDate, archiveDate) are set using the Update Version API after creation.
Example: Create a version
{
"versionName": "Q1 2025 Update",
"contentMode": "EXTERNAL_URL",
"localizations": [
{
"locale": "en_US",
"title": "Privacy Policy",
"lineage": "NEW_CONTENT",
"externalUrl": "https://example.com/legal/privacy-en-v3"
},
{
"locale": "fr_FR",
"title": "Politique de confidentialité",
"lineage": "DERIVED",
"derivedFromLocalizationId": "DL-..."
}
]
}
Version lifecycle management (PATCH)
PATCH /consent-management/api/v1/config/documents/{definitionId}/versions/{versionId}
After you create a DRAFT version, you can manage its lifecycle using the update version API.
| Goal | Action |
|---|---|
| Schedule for future activation | Set the effectiveDate to a future date. |
| Activate immediately | Set the effectiveDate to the current time (60-minute tolerance is applied). |
| Define the sunset period | Set the sunsetDate to the date when new consents should stop. |
| Define the archive date | Set the archiveDate to the date when all consents to this version expire. |
| Unschedule (revert to DRAFT) | Remove the effectiveDate. |
Note
Version numbers are assigned automatically when a version is scheduled (when the effectiveDate is set). DRAFT versions do not have a version number. If a version is unscheduled, its version number is removed and reassigned on the next scheduling.
Clone a version (POST)
POST /consent-management/api/v1/config/documents/{definitionId}/versions/{versionId}/clone
You can clone any existing version (regardless of status). The clone is created as a DRAFT with all localizations copied and lifecycle dates cleared.
Cloning is useful for the following scenarios:
-
Creating a new version based on an existing version with minor changes.
-
Restoring an archived version as a new draft.
Delete a version
Only DRAFT versions can be deleted. A SCHEDULED version must be unscheduled first. ACTIVE, SUNSET, and ARCHIVED versions cannot be deleted.
Document localizations
A document localization provides the language-specific content for a version. Each version can have localizations for multiple languages, but only one localization per language.
Document localization responses
A successful response returns the document localization properties:
| Property | Description |
|---|---|
id |
Unique identifier, prefixed with DL- |
locale |
The language code (for example, en_US, fr_FR, de_DE) |
title |
The localized document title shown to users |
externalUrl |
URL to the actual document content hosted externally |
lineage |
Whether this is original content (NEW_CONTENT) or derived from another localization (DERIVED) |
derivedFromLocalizationId |
For DERIVED localizations only: the ID of the source localization |
Localization fields
| Field | Required | Description |
|---|---|---|
locale |
Yes | Language code (for example, en_US, fr_FR). Must be supported by the tenant. |
title |
Yes | The localized document title shown to users. 1–100 characters. |
lineage |
Yes | NEW_CONTENT or DERIVED |
externalUrl |
Conditional | Required for NEW_CONTENT. Must be an absolute URL. |
derivedFromLocalizationId |
Conditional | Required for DERIVED. Must reference an existing localization from an ACTIVE, SUNSET, or ARCHIVED version. |
Content lineage
Content lineage determines whether a new localization represents genuinely new legal content (requiring re-consent) or is legally equivalent to an existing localization (not requiring re-consent).
NEW_CONTENT
A localization with lineage NEW_CONTENT introduces original legal content. It is the root of a lineage chain. Users must actively consent to it.
Use NEW_CONTENT when:
-
The legal text of the document has changed in this language.
-
This is the first time a document is published in this language.
Provide the externalUrl pointing to the document content. Do not provide derivedFromLocalizationId.
DERIVED
A localization with lineage DERIVED is legally equivalent to another localization (the source). A user who has consented to the source localization, or any localization that traces back to the same root, is considered to have also consented to the derived one.
Use DERIVED when:
-
You are publishing a translation of existing content without changing its meaning.
-
You are creating a new version as a minor cosmetic update (reformatting, fixed typos) in a language where the legal meaning has not changed.
Provide the derivedFromLocalizationId of the source localization. Do not provide externalUrl. It is inherited automatically from the source.
Warning
A DERIVED localization can only reference a localization whose parent version has the ACTIVE, SUNSET, or ARCHIVED status. It cannot reference a localization from a DRAFT or SCHEDULED version.
How lineage traversal works
The system traverses the lineage chain from the current active localization back to the root NEW_CONTENT localization. If the user's previously consented localization shares the same root, the user is compliant and no re-consent is required.
V1 EN (NEW_CONTENT, root A) <- user consented here
│
V2 EN (DERIVED from V1 EN) <- still root A
│
V3 EN (DERIVED from V2 EN) <- still root A -> user is compliant, no re-consent needed
If the legal content changes in a new version, a NEW_CONTENT localization must be created in the new version, establishing a new root. All users must then re-consent.
V1 EN (NEW_CONTENT, root A)
V2 EN (NEW_CONTENT, root B) <- legal content changed -> user must re-consent
Edit localizations (PATCH)
PATCH /consent-management/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations/{localizationId}
Update the title and externalUrl of a localization. The locale and lineage fields are immutable after creation.
Note
Localizations can be added and edited on DRAFT, SCHEDULED, and ACTIVE versions. Localizations on SUNSET or ARCHIVED versions are read-only.
Version invariants
The following invariants are enforced at scheduling time and when deleting localizations:
- A version must have at least one localization before it can be scheduled.
- A version must include a localization for the document's
defaultLocalebefore it can be scheduled.
Common document workflows
Publish a new consent document
-
Create a document definition with the appropriate type and
isMandatorysetting. -
Create a new version with a name (for example,
Initial Version). -
Add a localization for the
defaultLocalewithlineage: NEW_CONTENTand anexternalUrl. -
Add localizations for additional languages as needed.
-
Schedule the version. Set the
effectiveDateto the activation date that you want. -
On the
effectiveDate, the version automatically becomesACTIVEand is available to users.
Update legal content and trigger re-consent
-
Create a new version of the existing document definition.
-
Add localizations with
lineage: NEW_CONTENTfor all languages where the legal text has changed. -
For languages where only translations changed, use
lineage: DERIVED, referencing the previous version's localization. -
Set a
sunsetDateon the previous version equal to theeffectiveDateof the new version. -
Set an
archiveDateon the previous version to define the end of the grace period. -
Schedule the new version with
effectiveDate. -
When the new version becomes
ACTIVE, users who consented to the previous version enter the grace period. After thearchiveDate, they must re-consent to the new version.
Add a new language without re-consent
-
Identify the localization in the current
ACTIVEversion for which the new translation is equivalent. -
Create a new version (or add to the
ACTIVEversion directly.ACTIVEversions accept new localizations). -
Add the new localization with
lineage: DERIVEDand reference the existing localization asderivedFromLocalizationId. -
Users who consented to the source localization are automatically compliant for the new language.
API endpoints reference
For full request and response schemas, see the Config API reference.
All paths are relative to /consent-management.
| Operation | Method | Path |
|---|---|---|
| Create document definition | POST |
/api/v1/config/documents |
| List document definitions | GET |
/api/v1/config/documents |
| Get document definition | GET |
/api/v1/config/documents/{definitionId} |
| Update document definition | PATCH |
/api/v1/config/documents/{definitionId} |
| Delete document definition | DELETE |
/api/v1/config/documents/{definitionId} |
| Create version | POST |
/api/v1/config/documents/{definitionId}/versions |
| List versions | GET |
/api/v1/config/documents/{definitionId}/versions |
| Get version | GET |
/api/v1/config/documents/{definitionId}/versions/{versionId} |
| Update version | PATCH |
/api/v1/config/documents/{definitionId}/versions/{versionId} |
| Clone version | POST |
/api/v1/config/documents/{definitionId}/versions/{versionId}/clone |
| Delete version | DELETE |
/api/v1/config/documents/{definitionId}/versions/{versionId} |
| Create localization | POST |
/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations |
| List localizations | GET |
/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations |
| Get localization | GET |
/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations/{localizationId} |
| Update localization | PATCH |
/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations/{localizationId} |
| Delete localization | DELETE |
/api/v1/config/documents/{definitionId}/versions/{versionId}/localizations/{localizationId} |