API Use Cases & Best Practices

This document provides essential guidance for using OneTrust Universal Consent & Preference Management APIs effectively, offering a breakdown of common use cases, recommended actions, and practices to avoid. Use this guide as a starting point to ensure optimal performance and efficiency when implementing Universal Consent & Preference Management APIs. Dive into the detailed use cases in the table below to get started!

📘

Please, review the following documentation before proceeding with the implementation:

Business Use CaseDoDon’tWhyDetails
Bulk ImportUse the Stream Consent Receipts bulk import template.Do not repeatedly call consent receipts.Stream Consent Receipts processes faster with no message throttling and a dedicated lane.Using the Stream Consent Receipts Import Template
User Login / UIUse the v2/preferences API.Do not use the V1, V2, V3, or V4 Data Subject APIs.- The v1/preferences API offers a performance of <=100ms and supports up to 3k calls per minute without degrading performance.

- New data is available from v2/ preferences in up to 4 seconds 99% of the time.

ℹ️ Important
The Real-Time Consent feature is available to purchase. With this add-on, new data will be available from this API in up to 4 seconds. Without this add-on, new data will be available from this API in up to 30 seconds. To purchase this feature, please contact your account representative or OneTrust Sales.
- v1/preferences

- v2/preferences
Sending a user's consent through the Create Consent Receipts APIUse the v1/consentreceipts API. Validate your inputs before passing them into the API.Do not send unvalidated data elements.This is the entry point to consent and is designed to be quick. Subsequent updates to data subjects as a result of the receipt are asynchronous. Validations of data types are not handled in the API itself and should be validated before calling the API as requests will be accepted. However, if it is an invalid format, the update will not flow to the data subject.Create Consent Receipts API
On-demand Integrations / Ad-hoc / Point ReadingUse the Data Subject APIs. Continue to use v1/datasubjects if you have not migrated to v4/datasubjects.Do not use v3/datasubjects if you have not migrated yet.The Data Subject APIs allow on-demand fetching of data subject details. Response times may vary.- v1/datasubjects
- v2/datasubjects
- v3/datasubjects
- v4/datasubjects
Large Queries, List Queries, and Integrations (File-based)Use Bulk Export.Do not recursively call the V1, V2, V3, or V4 Data Subject APIs.Bulk Export is designed for large queries, supporting multiple filters and file-based integrations.Create Bulk Export API
Bulk Export Demo Videos

For more information on OneTrust’s Universal Consent & Preference Management, visit our Knowledge Base. We recommend reviewing the following articles: