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.
Sections
- Quickstart — First sealed consent in under 10 minutes: four steps, real request bodies, curl and Go.
- Choices setup asks for — Consent or legitimate use, how long to keep data, who to name as grievance contact, and where the 90-day deadline comes from.
- API reference — Every integrator-facing endpoint — 43 across 11 groups — with parameters, examples and status codes, rendered from the OpenAPI document.
- SDK guide — The banner's script tag, every SDK method and event, naming a signed-in user, and letting visitors change or withdraw their choices on your site.
- Webhooks — Signed, retried events for consent, rights requests, erasure and breaches — setup, the event reference, signature checks in seven languages, and delivery.
- Children and guardian consent — Purposes a child can never agree to, the three guardian verification methods, and the errors you will see.
- Self-hosting — One Go binary, PostgreSQL and object storage, with liveness and readiness probes.
The shape of the product
ClearDP runs as a single Go binary. It exposes three surfaces, and the reference covers all three:
/v1— the REST API your backend and your banner call: notices, purposes, consent capture and withdrawal, artifacts, chain verification, guardian verification, portal links./portal— the principal portal API behind the hosted privacy page: sign in by one-time link or email OTP, then read consents and history, export data, withdraw, file a rights request or a grievance./cm/v1— the Consent-Manager interoperability surface for DPDP Rule 4: a client-credentials token, then record and read consent for principals a Consent Manager identifies by pairwise id.
The administrative surface (/admin) is deliberately outside the public reference — it is the console's own API, not an integration point.
Groups in the reference
- Consent 4 endpoints — Capture and withdraw consent decisions as append-only, hash-chained artifacts, and read a principal's materialized consent state, and link an anonymous banner visitor to the account they sign in to.
- Notices & purposes 5 endpoints — Everything the banner needs: the active published notice, its rendered HTML snapshot, the property's ACTIVE purpose catalogue, theme tokens, and impression beacons.
- Artifacts & verification 2 endpoints — Read an individual hash-chained consent artifact and verify a range of the property's chain.
- Principal portal 15 endpoints — The hosted data-principal portal: sign-in by one-time link or email OTP, then read consents/history, export data, withdraw, and file rights requests or grievances.
- Consent Manager interop 3 endpoints — DPDP Rule 4 interop: a registered Consent Manager takes an OAuth client-credentials token, then records and reads consent for principals it identifies by pairwise id.
- Guardian & children 4 endpoints — Verifiable parental consent for child principals: start a guardian verification, poll its status, complete a COLLECT-style method, and list the children a portal guardian may act for.
- Erasure 1 endpoints — Delegate callback for webhook connectors reporting the async result of an erasure task item.
- Portal links 1 endpoints — Mint the one-time signed link (and portal token) that a fiduciary backend hands to a Data Principal or to the browser SDK.
- System 3 endpoints — Unauthenticated liveness and readiness probes, plus an API-key smoke test that echoes the authenticated property.
- Rights requests 4 endpoints — Log a rights request a person made through another channel, and read where requests stand.
- Breach incidents 1 endpoints — The people a breach affects, so you can notify them through your own channels.
Keys and authentication
API keys are property-scoped bearer tokens. A secret key is sent as Authorization: Bearer sk_live_… (or sk_test_… against test mode) and every read and write is confined to that key's property — an artifact belonging to another property is a 404, not a 403.
Browser code never carries a secret key. Publishable keys (pk_…) are accepted only on the browser-safe routes the banner needs: reading the notice, purposes and theme, reading an anonymous visitor's own consent, sending impressions, and recording or withdrawing consent. Naming a signed-in user there needs a portalToken minted server-side by POST /v1/portal-links, and that minting route refuses a publishable key with 403, so the browser cannot escalate itself. The SDK guide lists every route.
The principal portal authenticates with a short-lived session cookie instead of a key, and the Consent-Manager surface authenticates with a pinned client certificate or an OAuth 2.0 client-credentials token. The auth section of the reference states each scheme exactly as the API document defines it.
Errors
Every error response is application/problem+json under RFC 9457. The problem type is the machine-readable discriminator, so client code branches on it rather than parsing prose — for example portal_token_required when a publishable key names a principal without a portal token, or guardian-verification-required when a child's consent is attempted before verifiable parental consent exists. Related child-consent types: child-purpose-blocked (422) when a child's consent grants a purpose that is not allowed for children, which is checked first and cannot be cleared by verifying a guardian, and guardian-method-unavailable (422) when a guardian verification asks for a method this deployment has not configured. Guardian verification is started with POST /v1/guardian-links and one of three methods: DIGILOCKER (a redirect to a provider that answers only whether the person is an adult), VIRTUAL_TOKEN (a token from an authorized entity, checked server-side) or MANUAL_DECLARATION (a checkbox and a typed name, the weakest, allowed only when the organization enables it). Denying and withdrawing are never gated.
Success codes are not uniform, and the reference states each one: consent capture and withdrawal return 201, impression beacons and the erasure callback return 202, portal logout returns 204, and portal-link minting returns 200.
Conventions worth knowing before you start
- Base URL:
https://app.cleardp.infor the managed service, or your own host when self-hosted. Idempotency-Keyis scoped to the property with a 24-hour TTL. The same key with the same body replays the stored response; the same key with a different body is a 409.seq, the chain position of an artifact, is a bigint serialised as a string —"1042", not1042.- Consent decisions on
/v1use uppercase actions (GRANT,DENY,WITHDRAW); the Consent-Manager surface uses lowercase (granted,denied,withdrawn).
Start with the quickstart, or read the API reference end to end. You can also verify a receipt without an account.