Launching soon. Sign-ups are not open yet. Join the waitlist and we will write to you when they are.

Quickstart

First sealed consent in 9 minutes

Four steps: keys, notice, one consent, one verification. Every path, body and status code below comes from the same OpenAPI document that generates the server, so you can paste these calls as they stand.

Base URL https://app.cleardp.in for the managed service, or your own host when self-hosted. Set API_KEY to a test key before you start.

Launching soon

The managed service is not open yet: https://app.cleardp.in does not accept requests and accounts cannot be created. These pages describe the API as it ships. Join the waitlist to hear when it opens.

Step 1 · Create a property and keys (2 minutes)

A property is one consented surface — a website, an app, a brand. Every key, notice, purpose and artifact belongs to exactly one property, and the 21-day trial includes one.

This step is console work rather than an API call: property and key management live on the administrative surface, which is not part of the public reference. Accounts open at launch (join the waitlist). Once you have one, the console's setup guide walks you through the property, its purposes and its notice. Keys are created in two places, and each is shown once, so copy it when it appears:

  • Publishable key: setup step 6, Add the consent banner to your site, creates it and puts it in the install code.
  • Secret key: the optional A secret key for your server block at the end of the same step, or at any time under SDK & keys in the console sidebar (also Settings → API keys), which lists, rotates and revokes both kinds.

Creating, rotating and revoking keys needs the Admin role or above; the account that signs up is the Owner. Verify your email first: until you do, the console shows only a verification screen, and no key can be created. You come away with two credentials:

  • a secret key, sk_test_… in test mode or sk_live_… in live mode, for your backend only;
  • a publishable key, pk_…, safe to ship to a browser because it is accepted on browser-safe routes only.

Confirm the secret key resolves to the property you expect, and to the mode you expect, with GET /v1/ping — the cheapest call in the API:

# does this key work, and which property and mode does it resolve to?
curl -sS https://app.cleardp.in/v1/ping \
  -H "Authorization: Bearer $API_KEY"
# 200 application/json
{
  "ok": true,
  "propertyId": "prop_01h455vb4pex5vsknk084sn02q",
  "mode": "LIVE"
}

mode is LIVE or TEST, resolved from the key itself, and propertyId is the property every subsequent call will read and write. Check both before your first write — a key you thought was a test key is the one mistake this call exists to catch.

Step 2 · Render the notice (2 minutes)

One call gives your banner everything it needs: the active published notice version, its title and statutory sections, the purposes to toggle, and the languages it exists in.

# the active notice, in the principal's preferred language
curl -sS "https://app.cleardp.in/v1/notice?lang=hi" \
  -H "Authorization: Bearer $API_KEY"
# 200 application/json
{
  "noticeVersionId": "ntv_01h455vb4pex5vsknk084sn02q",
  "servedLanguage": "hi",
  "availableLanguages": [
    "en",
    "hi",
    "ta"
  ],
  "title": "गोपनीयता सूचना",
  "bodyHtmlUrl": "/v1/notices/ntv_01h455vb4pex5vsknk084sn02q/body?lang=hi",
  "sections": {
    "withdrawalHowTo": "आप किसी भी समय अपनी सहमति वापस ले सकते हैं — privacy@example.in पर लिखें या अपने खाते के गोपनीयता पृष्ठ पर जाएँ।",
    "rightsHowTo": "You may request access, correction, erasure or nominate another person from your privacy dashboard.",
    "grievanceContact": "Data Protection Officer, Example Retail Pvt Ltd, Bengaluru — dpo@example.in",
    "boardComplaintInfo": "If unsatisfied, you may complain to the Data Protection Board of India."
  },
  "purposes": [
    {
      "key": "marketing_email",
      "version": 3,
      "name": "Marketing emails",
      "text": "हम आपको ऑफ़र और नए उत्पादों के बारे में ईमेल भेजेंगे।",
      "legalBasis": "CONSENT",
      "allowedForChildren": false,
      "requiredToggle": false
    },
    {
      "key": "analytics_basic",
      "version": 2,
      "name": "Product analytics",
      "text": "हम यह समझने के लिए उपयोग डेटा एकत्र करते हैं कि ऐप का उपयोग कैसे किया जाता है।",
      "legalBasis": "CONSENT",
      "allowedForChildren": true,
      "requiredToggle": false
    }
  ]
}

Four things to read carefully in that response. Language resolution is requested lang → property default → en, and servedLanguage tells you which was used, so never assume you got what you asked for. availableLanguages is what your language switcher should offer. noticeVersionId is the value you must send back on capture — it is what pins the consent to the exact words shown. requiredToggle is always false, because consent under the DPDP Act is never a required toggle.

Only legalBasis: CONSENT purposes are choices: render them as toggles and send them as decisions. Purposes with legalBasis: LEGITIMATE_USE are in the notice too, so it is complete, but a person cannot grant or refuse them. The ClearDP banner lists them in its preferences panel as switches that are on and locked, labelled "Processed under legitimate use", and never sends them as decisions. In a banner of your own, do the same or show them as plain text.

bodyHtmlUrl points at GET /v1/notices/{noticeVersionId}/body, which streams the sanitised HTML snapshot as text/html — use it for a "read the full notice" view.

If you are building a preference centre rather than a banner, GET /v1/purposes returns the active version of every purpose key for the property, unpaginated. Note the field naming difference: this route carries description, while the notice carries text, the per-language consent wording.

# 200 /v1/purposes
{
  "purposes": [
    {
      "key": "marketing_email",
      "version": 3,
      "name": "Marketing emails",
      "description": "Send offers and product news to your email address.",
      "legalBasis": "CONSENT",
      "dataCategories": [
        "contact",
        "behavioural"
      ],
      "allowedForChildren": false
    },
    {
      "key": "analytics_basic",
      "version": 2,
      "name": "Product analytics",
      "description": "Understand how the app is used so we can improve it.",
      "legalBasis": "CONSENT",
      "dataCategories": [
        "device",
        "usage"
      ],
      "allowedForChildren": true
    }
  ]
}

Step 3 · Record a consent (3 minutes)

One POST records the whole banner interaction — grants and refusals together — as append-only, hash-chained artifacts. Send the batch exactly once per interaction and give it an Idempotency-Key.

curl -sS -X POST https://app.cleardp.in/v1/consents \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 8f2b1c40-6a3d-4c1e-9b77-2d4e5f6a7b8c" \
  --data-binary @consent.json
# consent.json — the request body
{
  "principal": {
    "externalId": "user_98214",
    "email": "priya.sharma@example.in"
  },
  "noticeVersionId": "ntv_01h455vb4pex5vsknk084sn02q",
  "language": "hi",
  "method": "BANNER",
  "decisions": [
    {
      "purposeKey": "marketing_email",
      "action": "GRANT"
    },
    {
      "purposeKey": "analytics_basic",
      "action": "DENY"
    }
  ]
}

principal needs at least one of externalId or anonymousId; the server enforces that. noticeVersionId and language come straight from step 2, and the language must be one the notice version was published in. method accepts only BANNER, PORTAL and API here — IMPORT, SYSTEM and CM are server-recorded provenance and are rejected with 400. Each entry in decisions is a purposeKey plus an action of GRANT or DENY.

# 201 Created — application/json
{
  "principalId": "prn_01h455vb4pex5vsknk084sn02q",
  "artifacts": [
    {
      "id": "art_01h455vb4pex5vsknk084sn02q",
      "purposeKey": "marketing_email",
      "action": "GRANT",
      "seq": "1042",
      "hash": "3f1c9a7d5e2b48c06a1f9d3b7c5e2a8049f6b1d3c7e5a2049f6b1d3c7e5a2049"
    },
    {
      "id": "art_01h455vb4pex5vsknk084sn02r",
      "purposeKey": "analytics_basic",
      "action": "DENY",
      "seq": "1043",
      "hash": "7c5e2a8049f6b1d3c7e5a2049f6b1d3c3f1c9a7d5e2b48c06a1f9d3b7c5e2a80"
    }
  ],
  "state": [
    {
      "purposeKey": "marketing_email",
      "purposeVersion": 3,
      "status": "GRANTED",
      "stale": false,
      "grantedAt": "2026-07-30T09:15:04Z",
      "expiresAt": null,
      "updatedAt": "2026-07-30T09:15:04Z",
      "lastArtifactId": "art_01h455vb4pex5vsknk084sn02q"
    },
    {
      "purposeKey": "analytics_basic",
      "purposeVersion": 2,
      "status": "DENIED",
      "stale": false,
      "grantedAt": null,
      "expiresAt": null,
      "updatedAt": "2026-07-30T09:15:04Z",
      "lastArtifactId": "art_01h455vb4pex5vsknk084sn02r"
    }
  ]
}

The response is the receipt. artifacts[] is what was written to the chain: one artifact per decision, each with its id, purposeKey, action, chain position seq and SHA-256 hash. Store at least the id and seq against your own user record — that is your pointer into the evidence. state[] is the materialised current position per purpose, which is what your product logic should read.

Two things a first integration usually gets wrong

seq is a bigint serialised as a string. It arrives as "1042", not 1042. Decode it into a string or an int64 — a JavaScript number will silently lose precision eventually, and a strict decoder that expects a number will fail on the first receipt.

Idempotency-Key is scoped to the property, with a 24-hour TTL. The same key with the same body replays the stored response, which is what makes a retry after a timeout safe. The same key with a different body is a 409 — so generate a fresh key per interaction rather than reusing one per user or per day. The same header works on POST /v1/consents/withdraw, POST /v1/guardian-links and POST /v1/portal-links.

The same call in Go

// fragment — imports: bytes, context, encoding/json, fmt, net/http, os

type artifact struct {
  ID         string `json:"id"`
  PurposeKey string `json:"purposeKey"`
  Action     string `json:"action"`
  Seq        string `json:"seq"`   // bigint on the wire
  Hash       string `json:"hash"`
}

type receipt struct {
  PrincipalID string     `json:"principalId"`
  Artifacts   []artifact `json:"artifacts"`
}

// capture posts one banner interaction. idemKey must be fresh per interaction:
// the same key with a different body is a 409.
func capture(ctx context.Context, idemKey string, body []byte) (*receipt, error) {
  req, err := http.NewRequestWithContext(ctx, "POST",
    "https://app.cleardp.in/v1/consents", bytes.NewReader(body))
  if err != nil {
    return nil, err
  }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("API_KEY"))
  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("Idempotency-Key", idemKey)

  res, err := http.DefaultClient.Do(req)
  if err != nil {
    return nil, err
  }
  defer res.Body.Close()
  if res.StatusCode != http.StatusCreated { // 201, not 200
    // the body here is application/problem+json (RFC 9457)
    return nil, fmt.Errorf("consent capture: %s", res.Status)
  }
  var out receipt
  return &out, json.NewDecoder(res.Body).Decode(&out)
}

Withdrawal is the mirror image and must stay as easy as granting: POST /v1/consents/withdraw takes a flat purposeKeys array with no noticeVersionId and no language, because the server reuses the notice version and language already recorded for each purpose. It returns 201 with the same receipt shape.

Step 4 · Verify what you just wrote (2 minutes)

Read one artifact back. chainOk is computed per request: it is true when the stored hash matches the recomputed canonical hash and prevHash matches its predecessor, or the genesis anchor at seq 1.

curl -sS https://app.cleardp.in/v1/artifacts/art_01h455vb4pex5vsknk084sn02q \
  -H "Authorization: Bearer $API_KEY"
# 200 application/json
{
  "id": "art_01h455vb4pex5vsknk084sn02q",
  "propertyId": "prop_01h455vb4pex5vsknk084sn02q",
  "principalId": "prn_01h455vb4pex5vsknk084sn02q",
  "purposeKey": "marketing_email",
  "purposeVersion": 3,
  "noticeVersionId": "ntv_01h455vb4pex5vsknk084sn02q",
  "action": "GRANT",
  "method": "BANNER",
  "language": "hi",
  "occurredAt": "2026-07-30T09:15:04Z",
  "seq": "1042",
  "prevHash": "0a4f8e1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7",
  "hash": "3f1c9a7d5e2b48c06a1f9d3b7c5e2a8049f6b1d3c7e5a2049f6b1d3c7e5a2049",
  "chainOk": true,
  "sessionId": null
}

Then verify a range of the property's chain rather than a single link. The request seqs are int64 numbers, toSeq must be at least fromSeq and at most fromSeq + 10000, and the response brokenAtSeq is a nullable string.

curl -sS -X POST https://app.cleardp.in/v1/chain/verify \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fromSeq": 1, "toSeq": 1042}'
# 200 application/json
{
  "valid": true,
  "checked": 1042,
  "brokenAtSeq": null
}

checked is how many artifacts were examined. When valid is false, brokenAtSeq names the exact position where the chain stops reconciling. You can watch that happen on a tampered chain, in your own browser, on the public verification page — no account, no key.

What you have now

  • a property in test mode, and a key you have proved resolves to it;
  • the notice version id, served language and purpose list your banner renders from;
  • two artifacts sealed into the property's chain, each with a seq and a hash;
  • a materialised consent state per purpose that your product logic can read;
  • a chain-verification result over the range you wrote, reproducible by anyone holding the artifacts.

That is the whole capture loop. What it does not yet include: children (POST /v1/guardian-links must reach VERIFIED before a child's GRANT is accepted — a refusal or withdrawal is never gated), the principal portal, and Consent-Manager interop.

Emails ClearDP sends to your users

ClearDP emails people directly, to the address you gave in principal, so you do not have to send these yourself. Nothing is sent to a person with no email on record.

Emails sent to people
EmailSent whenCan you turn it off?
Consent receiptA person grants consent. One email covers every purpose in the same request.Yes, per property.
Withdrawal confirmationA person withdraws consent.Yes, per property.
Rights request or grievanceOne is logged for them, in the privacy portal or by your team; and again when it is completed, resolved or rejected, with your team's note.No.
Breach noticeYour team notifies the people affected by a breach. Sent in English.No.
Sign-in codeA person signs in to the privacy portal with their email.No.
  • Who it comes from. On the managed service, from no-reply@cleardp.in. The message is headed with your property's name, because the person knows your site, not ClearDP.
  • Language. English or Hindi. Any other language is sent in English.
  • Turning receipts and confirmations off. An administrator clears Email a receipt when consent is granted and Email a confirmation when consent is withdrawn under Settings → Organization → Email notifications. They apply to the property selected at the top of the console. Both are on until you change them.
  • Sending from your own address. An administrator sets the From name and From address for the selected property under Enterprise settings → Branding → Sender identity, and adds and verifies the domain's DKIM key in the same card (Sender domain). Mail goes out from that address only while a verified DKIM key exists for its domain; until then the default sender is used. This needs the Enterprise platform entitlement.
  • Self-hosting. The default sender is CLEARDP_EMAIL_FROM, and the mail server is set with the CLEARDP_SMTP_* variables.

If you already email people when they consent, switch your own receipt off or turn this one off, so they do not get two. Webhooks are unaffected: you receive the same events either way.

Next

  • API reference — every endpoint, parameter and status code.
  • SDK guide — the banner on your site, signed-in users, and withdrawal.
  • Webhooks — react to withdrawals, rights requests and erasure the moment they happen.
  • Self-hosting — the single binary, PostgreSQL and object storage.
  • Verify a receipt — the check an auditor runs, in the browser.

ClearDP is a Data Processor under the DPDP Act. The obligation to obtain valid consent remains the Data Fiduciary's — this API is how you evidence it.

Start with proof, not promises

Accounts open soon: join the waitlist and we will write to you when yours can be created. The trial is 21 days, no card, starting on Growth. Or answer 8 questions and see your top-3 DPDP risks in 2 minutes.