Record a consent decision. Returns the immutable decision record with its ledger position.
| Field | Type | Description |
|---|---|---|
| subjectrequired | string | Your identifier for the person. Opaque to Consentry. |
| purposerequired | string | A purpose defined in your policy. Unknown purposes are rejected. |
| statusrequired | enum | granted · revoked · pending |
| basisoptional | string | Ground for the decision under your DPDP notice. Defaults to consent. |
| sourceoptional | string | Where the decision was captured: a form ID, banner version, or document reference. Strongly recommended: it's what auditors ask about first. |
| expires_atoptional | timestamp | Automatic transition to expired; emits a webhook. |
| commitmentoptional | string | HMAC-SHA256 identity commitment, sealed into the hash chain at write time. See Identity & binding. |
| captured_atoptional | timestamp | When consent was actually captured, for batch imports and offline flows. Client-asserted: always labelled as such in evidence, and shown alongside the sealed recorded_at. A large or recurring gap between the two is surfaced as an audit flag, not hidden. |
{
"id": "dec_01J8ZKQ4T…",
"subject": "usr_8492",
"purpose": "marketing",
"status": "granted",
"basis": "consent",
"ledger_index": 1482231,
"recorded_at": "2026-07-19T14:02:11Z", // sealed by the chain
"receipt": { // keep this - it's your independent proof
"chain_hash": "9f2c41ab…",
"signature": "MEUCIQDx…"
}
}