---
title: "Log Consent"
method: POST
path: "/cfw/cmp/v1/save-log-consent"
tags: ["Log Consent"]
---

# Log Consent

`POST /cfw/cmp/v1/save-log-consent`

Use this API to log consent when a user interacts with a Banner or Preference Center.

## Headers

- `OT-CDN-Location` 'cdn.cookielaw.org' | 'cdn-apac.onetrust.com' | 'cdn.au.onetrust.com' | 'cdn-ukwest.onetrust.com' | 'cookie-cdn.cookiepro.com' | 'otcc-demo.otprivacy.com' | 'otcc-training.onetrust.com', required — The location of the CDN.
- `OT-App-Id` string, required — The unique identifier for the app or domain.
- `OT-Device-Type` 'mobile' | 'ctv', required — The type of device.
- `OT-SDK-Version` string, required — The published version of the app or domain.
- `OT-SDK-Identification` string, nullable — The OT SDK identification.
- `OT-Language` string, nullable — The language in which the user interface should be displayed.
- `OT-Country-Code` string, nullable — The country code from which the user is accessing the app or website.
- `OT-Region-Code` string, nullable — The region code from which the user is accessing the app or website.
- `OT-Fetch-Type` 'APP_DATA_ONLY' | 'APP_DATA_AND_PROFILE' | 'APP_DATA_AND_SYNC_PROFILE', nullable — The type of data to download.
- `OT-Consent-String` string, nullable — The encoded consent string that contains the interface's metadata.
- `OT-Identifier` string, nullable — The unique identifier for the data subject.
- `OT-Identifier-Type` string, nullable — The identifier type associated with the unique identifier in OT-Identifier header
- `OT-Identifier-UpdateType` 'Rename-Identifier', nullable
- `OT-Sync-Profile-Auth` string, nullable — The JSON Web Token (JWT) generated using Public Keys within the OneTrust application.
- `OT-Platform` 'Apple' | 'Android', nullable — To handle platform-specific features like ATT (App Tracking Transparency for Apple) or GoogleAdId (for Android) in a structured way, you can send the platform type in the parameters of an API or request.
- `OT-Exclude-Html-Tags` boolean, nullable — This is specifically to unbold the vendor numbers only.
- `OT-Tcf-Eu2v2-Consent-String` string, nullable — The IAB TCF string that contains information on consent preferences.
- `OT-GPP-String` string, nullable — The GPP string that contains information on consent preferences.
- `OT-Explicit-Consent` boolean, nullable — If true, only the consent explicitly provided in the request body will be submitted.

## Request body

- object — Request body cannot be empty
  - `interactionType` 'BANNER_ALLOW_ALL' | 'BANNER_REJECT_ALL' | 'BANNER_CLOSE' | 'BANNER_CONTINUE_WITHOUT_ACCEPTING' | 'PREFERENCE_CENTER_ALLOW_ALL' | 'PREFERENCE_CENTER_REJECT_ALL' | 'PREFERENCE_CENTER_CONFIRM' | 'PREFERENCE_CENTER_CLOSE' | 'PREFERENCE_CENTER_CONTINUE_WITHOUT_ACCEPTING' | 'UC_PREFERENCE_CENTER_CONFIRM' | 'VENDOR_LIST_ALLOW_ALL' | 'VENDOR_LIST_REJECT_ALL' | 'VENDOR_LIST_CONFIRM' | 'VENDOR_LIST_CONTINUE_WITHOUT_ACCEPTING' | 'VENDOR_LIST_CLOSE' | 'SDK_LIST_ALLOW_ALL' | 'SDK_LIST_REJECT_ALL' | 'SDK_LIST_CONFIRM' | 'SDK_LIST_CONTINUE_WITHOUT_ACCEPTING' | 'SDK_LIST_CLOSE' | 'ATT_CONFIRM' | 'ATT_OPTOUT' | 'ATT_NOTGIVEN' | 'AGEGATE_RANGE' | 'SYNC_PROFILE' | 'TRUST_CENTER_PREFERENCE_CONSENT' | 'GOOGLE_ADS_CONFIRM' | 'GOOGLE_ADS_OPTOUT' — The type of interactions users can have with the interface.
  - `consent` object — The consent statuses for Purposes, IAB Vendors, Google Vendors, and SDKs.
    - `purposesStatus` object[] — The consent status details for a Purpose.
      - `groupId` string, required — The unique identifier for a Purpose.
      - `status` boolean, required — The consent status for a Purpose.
      - `liStatus` boolean — The Legitimate Interest status for a Purpose.
    - `iabVendorsStatus` object[] — The consent status details for an IAB Vendor.
      - `vId` string, required — The identifier for the IAB Vendor.
      - `status` boolean — The consent status for the IAB Vendor.
      - `liStatus` boolean — The Legitimate Interest status for an IAB Vendor.
    - `googleVendorsStatus` object[] — The consent status details for a Google Vendor.
      - `vId` string, required — The identifier for the Google Vendor.
      - `status` boolean, required — The consent status for the Google Vendor.
      - `liStatus` boolean — The Legitimate Interest status for a Google Vendor.
    - `generalVendorsStatus` object[] — The consent status details for a General Vendor.
      - `vId` string, required — The identifier for the General Vendor.
      - `status` boolean, required — The consent status for the General Vendor.
    - `sdkStatus` object[] — The consent status details for an SDK.
      - `sdkId` string, required — The unique identifier for the SDK.
      - `status` boolean, required — The consent status for an SDK.
    - `ucPurposesStatus` object[] — The consent status details for a UC Purpose.
      - `id` string, required — The identifier for the UC Purpose.
      - `status` boolean, required — The consent status for the UC Purpose.
      - `customPreferences` object[]
        - `id` string, required — The identifier for the Custom Preference.
        - `options` object[], required
          - `id` string, required — The identifier for the Option.
          - `status` boolean, required — The consent status for the Option
    - `bulkOperation` object
      - `purposes` boolean
      - `sdks` boolean
      - `iabVendorsConsent` boolean
      - `iabVendorsLegInt` boolean
      - `googleVendors` boolean
      - `generalVendors` boolean
      - `ucp` boolean
  - `userAgent` string — The browser details of the user that is accessing the app or website.
  - `ageGate` object — The age range information for AgeGate consent. Required when interactionType is AGEGATE_RANGE.
    - `lowerBound` number — The lower bound of the age range (optional).
    - `upperBound` number — The upper bound of the age range (optional).
  - `customDataElements` object — The additional information about the user provided during their consent interaction.

## Response `200`

Success

- object
  - `errors` object[]
    - `code` 'SUCCESS' | 'ERROR_CODE_TEXT_RESOURCE_NOT_FOUND' | 'ERROR_CODE_NO_CONTENT' | 'ERROR_CODE_BLOB_LOCATIONS_UNAVAILABLE' | 'ERROR_CODE_INVALID_LOCATION' | 'ERROR_CODE_INVALID_COUNTRY_OR_REGION' | 'ERROR_CODE_INVALID_DEVICE_TYPE' | 'ERROR_CODE_INVALID_FETCH_TYPE' | 'ERROR_CODE_INVALID_CONSENT_REQUEST' | 'ERROR_CODE_HTTP_IF_NONE_MATCHED' | 'ERROR_CODE_SYNC_GROUP' | 'ERROR_CODE_FAILURE' | 'ERROR_CODE_DEFAULT_PURPOSE_STATUS' | 'ERROR_CODE_INVALID_OT_CONSENT_STRING' | 'ERROR_CODE_GENERIC_ERROR' | 'ERROR_CODE_MISSING_REQUIRED_HEADER' | 'ERROR_CODE_NO_ACCESS' | 'ERROR_CODE_INVALID_INTERACTION_TYPE' | 'ERROR_CODE_INVALID_CONTENT_TYPE_HEADER' | 'ERROR_IDENTIFIER_MISMATCH' | 'ERROR_UCP_NOT_CONFIGURED' | 'ERROR_CODE_INVALID_TC_STRING' | 'ERROR_GOOGLE_ADS_DISABLED' | 'ERROR_CODE_CONSENT_LOGGING' | 'ERROR_CODE_INVALID_REQUEST_BODY' | 'ERROR_CODE_UNSUPPORTED_VERSION' | 'ERROR_CODE_INVALID_AGE_RANGE' | 'ERROR_CODE_EMPTY_CONSENT', required
    - `message` 'Not Found' | 'No content' | 'success' | 'Unable to fetch data for the specified Application ID. Please check your configurations.' | 'Invalid location' | 'Invalid country code or region code. If you want to skip validation, please set the header 'OT-Geolocation-Skip-Validation' to true.' | 'Invalid Device Type' | 'Invalid Fetch type' | 'Missing either or all of TenantId or Identifier or Authorization' | 'If-None-Match' | 'syncGroup' | 'failure' | 'NO_CONSENT' | 'Invalid OT consent string' | 'Something went wrong' | 'No access to this resource' | 'Invalid Interaction Type' | 'Content-Type header should be application/json' | 'Input Identifier does not match with one in consent string' | 'The UC Purposes API call was successful, but no data is available for display.' | 'UC Purposes is disabled.' | 'Error decoding TC string, default consent is returned.' | 'Google Ads is disabled.' | 'Consent Logging has failed, please retry in sometime and if issue still persists please reach out to support team.' | 'Error parsing request body' | 'The published version is not supported. Please publish a newer version.' | 'The upper bound of the age range must be greater than lower bound.' | 'At least one purpose consent is required.', required
  - `warnings` object[]
    - `code` 'WARNING_CODE_PUBLISHED_VERSION_MISMATCH', required
    - `message` 'Requested data for the OT-SDK-Version does not match the published version on the OneTrust server. The latest published version will be returned instead.', required
  - `appConfig` object, required
    - `showBanner` boolean, required
    - `bannerReason` 'Geo rule Banner is not enabled.' | 'Geo rule Banner is enabled and is first launch.' | 'Sdk's Automatic reconsent has expired.' | 'Reconsent triggered for an authenticated user.' | 'The TC String has expired.' | 'Hundred percent sync is not completed for cross device sync enabled scenario.' | 'The template type is updated to IAB.' | 'Sdk has been published with reconsent.' | 'Banner will not be shown as consent validity holds true.' | 'Banner will not be shown as cross device sync is hundred percent complete.', required
    - `templateType` 'GDPR' | 'CCPA' | 'IAB2' | 'IAB2V2' | 'GENERIC' | 'LGPD' | 'GENERIC_PROMPT' | 'CPRA' | 'CDPA' | 'USNATIONAL' | 'CUSTOM' | 'COLORADO' | 'CTDPA' | 'UCPA' | 'OREGON' | 'FLORIDA' | 'DELAWARE' | 'IOWA' | 'MONTANA' | 'NEBRASKA' | 'TENNESSEE' | 'TEXAS' | 'NEW_JERSEY' | 'NEW_HAMPSHIRE', required
    - `bannerReasonCode` 101 | 102 | 103 | 104 | 105 | 107 | 109 | 150 | 151 | 152, required
    - `multiProfileConsent` object
      - `downloadDataAfterSwitch` boolean, required
      - `maxProfilesLimit` number, required
    - `gcmInfo` object
      - `userConsented` boolean, required
      - `gcmConsents` object, required
        - `adPersonalization` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
        - `adStorage` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
        - `adUserData` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
        - `analyticsStorage` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
        - `functionalityStorage` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
        - `personalizationStorage` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
        - `securityStorage` 'UNASSIGNED' | 'UNDEFINED' | 'DENIED' | 'GRANTED', required
    - `countryCode` string
    - `regionCode` string
    - `shouldResetLocalState` boolean — This flag indicates, if any local changes are there at client side, to notify clients to just discard them as we have to collect the consents freshly in certain scenarios like on reconsent triggers etc.
    - `lastReconsentDate` number
    - `rejectAllButtonBehavior` string
  - `receipt` string, required
  - `message` string
  - `storageKeys` object
    - `IABUSPrivacy_String` string
    - `IABTCF_AddtlConsent` string
    - `IABTCF_TCString` string — Full encoded TC string
    - `IABTCF_CmpSdkID` number — The unsigned integer ID of CMP SDK
    - `IABTCF_CmpSdkVersion` number — The unsigned integer version number of CMP SDK
    - `IABTCF_PolicyVersion` number — The unsigned integer representing the version of the TCF that these consents adhere to
    - `IABTCF_gdprApplies` number — 1 - GDPR applies in current context, 0 - GDPR does not apply in current context
    - `IABTCF_PublisherCC` string — Two-letter ISO 3166-1 alpha-2 code - Default: AA (unknown)
    - `IABTCF_PurposeOneTreatment` number — 0 - no special treatment of purpose one, 1 - purpose one not disclosed. Vendors can use this value to determine whether consent for purpose one is required.
    - `IABTCF_UseNonStandardTexts` number — 1 - CMP uses customized stack descriptions and/or modified or supplemented standard Illustrations, 0 - CMP did not use a non-standard stack desc. and/or modified or supplemented Illustrations
    - `IABTCF_UseNonStandardStacks` number
    - `IABTCF_VendorConsents` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the consent status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is consent true for vendor ID 1
    - `IABTCF_VendorLegitimateInterests` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the legitimate interest status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for vendor ID 1
    - `IABTCF_PurposeConsents` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the consent status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1
    - `IABTCF_PurposeLegitimateInterests` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the legitimate interest status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1
    - `IABTCF_SpecialFeaturesOptIns` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the opt-in status for special feature ID n+1; false and true respectively. eg. '1' at index 0 is opt-in true for special feature ID 1
    - `IABTCF_PublisherRestrictions` object — The value at position n - where n's indexing begins at 0 - indicates the publisher restriction type (0-2) for vendor n+1; (see Publisher Restrictions Types). eg. '2' at index 0 is restrictionType 2 for vendor ID 1. {ID} refers to the purpose ID.
    - `IABTCF_PublisherConsent` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose consent status for purpose ID n+1 for the publisher as they correspond to the Global Vendor List Purposes; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1
    - `IABTCF_PublisherLegitimateInterests` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose legitimate interest status for purpose ID n+1 for the publisher as they correspond to the Global Vendor List Purposes; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1
    - `IABTCF_PublisherCustomPurposesConsents` string, nullable — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose consent status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is consent true for custom purpose ID 1
    - `IABTCF_PublisherCustomPurposesLegitimateInterests` string, nullable — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose legitimate interest status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is legitimate interest established true for custom purpose ID 1
    - `IABTCF_EnableAdvertiserConsentMode` number
    - `IABTCF_DisclosedVendors` string
    - `IABGPP_2_String` string
    - `IABGPP_TCFEU2_CmpSdkID` number — The unsigned integer ID of CMP SDK
    - `IABGPP_TCFEU2_CmpSdkVersion` number — The unsigned integer version number of CMP SDK
    - `IABGPP_TCFEU2_PolicyVersion` number — The unsigned integer representing the version of the TCF that these consents adhere to
    - `IABGPP_TCFEU2_gdprApplies` number — 1 - GDPR applies in current context, 0 - GDPR does not apply in current context
    - `IABGPP_TCFEU2_PublisherCC` string — Two-letter ISO 3166-1 alpha-2 code - Default: AA (unknown)
    - `IABGPP_TCFEU2_PurposeOneTreatment` number — 0 - no special treatment of purpose one, 1 - purpose one not disclosed. Vendors can use this value to determine whether consent for purpose one is required.
    - `IABGPP_TCFEU2_UseNonStandardTexts` number — 1 - CMP uses customized stack descriptions and/or modified or supplemented standard Illustrations, 0 - CMP did not use a non-standard stack desc. and/or modified or supplemented Illustrations
    - `IABGPP_TCFEU2_UseNonStandardStacks` number
    - `IABGPP_TCFEU2_VendorConsents` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the consent status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is consent true for vendor ID 1
    - `IABGPP_TCFEU2_VendorLegitimateInterests` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the legitimate interest status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for vendor ID 1
    - `IABGPP_TCFEU2_PurposeConsents` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the consent status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1
    - `IABGPP_TCFEU2_PurposeLegitimateInterests` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the legitimate interest status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1
    - `IABGPP_TCFEU2_SpecialFeaturesOptIns` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the opt-in status for special feature ID n+1; false and true respectively. eg. '1' at index 0 is opt-in true for special feature ID 1
    - `IABGPP_TCFEU2_PublisherRestrictions` object — The value at position n - where n's indexing begins at 0 - indicates the publisher restriction type (0-2) for vendor n+1; (see Publisher Restrictions Types). eg. '2' at index 0 is restrictionType 2 for vendor ID 1. {ID} refers to the purpose ID.
    - `IABGPP_TCFEU2_PublisherConsent` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose consent status for purpose ID n+1 for the publisher as they correspond to the Global Vendor List Purposes; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1
    - `IABGPP_TCFEU2_PublisherLegitimateInterests` string — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose legitimate interest status for purpose ID n+1 for the publisher as they correspond to the Global Vendor List Purposes; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1
    - `IABGPP_TCFEU2_PublisherCustomPurposesConsents` string, nullable — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose consent status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is consent true for custom purpose ID 1
    - `IABGPP_TCFEU2_PublisherCustomPurposesLegitimateInterests` string, nullable — Binary String: The '0' or '1' at position n - where n's indexing begins at 0 - indicates the purpose legitimate interest status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is legitimate interest established true for custom purpose ID 1
    - `IABGPP_TCFEU2_DisclosedVendors` string
    - `OT_GroupConsents` object
    - `OT_GroupLIConsents` object
    - `OT_SdkConsents` object
    - `OT_UCPConsents` object
    - `OT_GeneralVendorsConsents` object
    - `OT_LastConsentedDate` string
    - `OT_Identifier` string — The unique identifier for the data subject.
    - `OT_AlwaysActiveIds` object
      - `groups` string[]
      - `sdks` string[]
    - `OT_AgeGate` object
      - `lastUpdated` number, required
      - `lowerBound` number
      - `upperBound` number
  - `otConsentString` string

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `429` — Too Many Requests. \nFor more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500` — Internal Server Error

---

[API](https://skmtc.net/onetrust/apis/platform-access-management.md) · [All operations](https://skmtc.net/onetrust/apis/platform-access-management/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/onetrust/platform-access-management/revisions/21de3aa0b170/schema)
