DPDP Consent Management API
Stores a user's consent for specific purposes against a notice version and returns a consent ID, status and hash. You can check or withdraw it later.
- Source
- Consent records you send from your own app or website
- Turnaround
- Instant
- Endpoint
- POST /v1/consent/record
- Who can use it
- Any business processing personal data in India.
Overview
Under the DPDP Act, 2023 you need to show that a user agreed to a specific notice, for specific purposes, and you need to stop processing when they withdraw. This API stores each consent with the notice version, purposes, language and channel, gives it an ID and a hash, and lets you check or withdraw it later. It's the record you'll want when someone asks 'when did I agree to this?'.
Good to know
It records consent; it doesn't write your privacy notice or decide your legal basis. You still need a notice and a process for user requests.
What you get
- Purpose-level consentStore exactly which purposes the user agreed to, not one blanket tick box.
- Notice versioningEach consent points to the notice version and language the user actually saw.
- Withdrawal and expiryWithdraw consent by API and check status before you process data again.
- Tamper-evident recordsA hash of each consent record helps show it wasn't changed afterwards.
Request
POST https://api.ampletrails.com/v1/consent/record
| Field | Type | Status | Description |
|---|---|---|---|
user_id | string | Required | Your identifier for the data principal |
purposes | array | Required | Purposes the user agreed to |
notice_version | string | Required | Version of the notice shown to the user |
language | string | Optional | Language the notice was shown in |
channel | string | Optional | Where consent was captured (web, app, whatsapp) |
Response
Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.
| Field | Meaning | Example |
|---|---|---|
consent_id | Unique consent artefact ID | cn_8e21d4 |
status | active, withdrawn or expired | active |
purposes | Purposes covered | ["kyc_verification","credit_assessment"] |
captured_at | Timestamp of consent | 2026-12-04T10:15:22+05:30 |
artefact_hash | Tamper-evident hash of the consent record | sha256:9b1c… |
Example
curl -X POST https://api.ampletrails.com/v1/consent/record \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"user_id": "user_102938", "purposes": "[\"kyc_verification\",\"credit_assessment\"]", "notice_version": "2026-11-v3", "language": "en", "channel": "app"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/consent/record",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"user_id": "user_102938",
"purposes": "[\"kyc_verification\",\"credit_assessment\"]",
"notice_version": "2026-11-v3",
"language": "en",
"channel": "app"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/consent/record", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"user_id": "user_102938",
"purposes": "[\"kyc_verification\",\"credit_assessment\"]",
"notice_version": "2026-11-v3",
"language": "en",
"channel": "app"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/consent/record");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["user_id" => "user_102938", "purposes" => "[\"kyc_verification\",\"credit_assessment\"]", "notice_version" => "2026-11-v3", "language" => "en", "channel" => "app"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"consent_id": "cn_8e21d4",
"status": "active",
"purposes": "[\"kyc_verification\",\"credit_assessment\"]",
"captured_at": "2026-12-04T10:15:22+05:30",
"artefact_hash": "sha256:9b1c…"
}
}Example data. The exact field list for your account comes with your sandbox documentation.
Use cases
KYC and credit flows
Record consent for verification and credit checks before calling those APIs.
Marketing permissions
Keep marketing consent separate from service consent, as the Act expects.
Responding to user requests
Look up a user's consents quickly when they ask what they agreed to or want to withdraw.
Questions about this API
Is this a Consent Manager under the DPDP Act?
No. Consent Managers are a separate registered category under the Act. This is a tool to record and manage consent inside your own business.
When do the DPDP obligations apply?
The DPDP Rules, 2025 were notified in November 2025 with a phased commencement. Most obligations apply after the transition period, so now is the time to build the records.
Can we import consents we already have?
Yes, as long as you know what notice and purposes they were given for. We'll mark them as imported.
Where is the data stored?
In India. Store your own user ID rather than names or phone numbers where you can.
Try the DPDP Consent Management API
Sandbox keys, the full field reference and a Postman collection, usually within a working day.