---
title: How consents are collected
description: How user consent is collected through consent records created with the Consent API, using localization content to build the approval prompt shown to users.
component: pingdirectory
version: 10.2
page_id: pingdirectory:consent_solution_guide:pd_cs_how_consents_collected
canonical_url: https://docs.pingidentity.com/pingdirectory/11.1/consent_solution_guide/pd_cs_how_consents_collected.html
llms_txt: https://docs.pingidentity.com/pingdirectory/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: 2023-09-13T00:00:00Z
superseded_by: https://docs.pingidentity.com/pingdirectory/11.1/consent_solution_guide/pd_cs_how_consents_collected.html
---

# How consents are collected

The Consent API allows the user to make the decision about sharing their data with other applications through a consent record.

User consent is collected by creating a consent record through the Consent API. In most cases, the Consent API client uses the consent localization data to construct an approval prompt that displays to the user. This prompt should include text describing what data is collected and for what purpose, allowing the user to make an informed decision about the value of sharing his or her data.

For example, a web application needing to collect consent for a user's browsing behavior uses the Consent API to look up the localizations for the `browsing-behavior` consent definition. It selects the localization appropriate for the user and use data from the localization resource to construct a consent prompt for display to the user. After the user is prompted and makes a decision, the client stores the decision by creating a new consent record through the Consent API.
