Consent Docs

Record consent taken in a branch, by phone or on paper

Seal how consent was taken outside your website, with the channel, how the person confirmed and your reference to the evidence.

How-to2 min readFor web, backend and mobile developers

When your staff take consent at a branch, on a call or on a paper form, send how it was taken with the record. The service seals it with that write. Your branch, call-centre or CRM system sends it through the API. The console has no screen for entering consent.

Before you start#

  • A secret key, and a published form whose notice is the wording your staff read out or print.
  • The reference your system keeps for the confirmation: the OTP transaction id, the recording id, the eSign id or the document id.
  • To match staff and site hashes later, your subject fingerprint key. See Match events to your users.
  1. Record the answers as in Record consent from your server, and add capture.

    Node.jsJavaScript
    const record = await client.recordConsent({
      formKey: 'kaveri-loan-updates',
      subjectId: 'CIF-30087741',
      subjectType: 'USER_ID',
      countryCode: 'IN',
      decisions: [
        { purposeKey: 'loan-offers-by-sms', granted: true },
        { purposeKey: 'loan-offers-by-call', granted: false },
      ],
      capture: {
        channel: 'BRANCH',
        method: 'OTP',
        agentRef: 'EMP-40213',
        locationRef: 'BLR-JAYANAGAR-014',
        methodReference: 'otp_7Q2K9D4M',
      },
      idempotencyKey: 'branch-CIF-30087741-20261003',
    });
    Python
    from piedap_consent import Capture, Decision
    
    consent = client.record_consent(
        form_key="kaveri-loan-updates",
        subject_id="CIF-30087741",
        subject_type="USER_ID",
        country_code="IN",
        decisions=[
            Decision("loan-offers-by-sms", True),
            Decision("loan-offers-by-call", False),
        ],
        capture=Capture(
            channel="BRANCH",
            method="OTP",
            agent_ref="EMP-40213",
            location_ref="BLR-JAYANAGAR-014",
            method_reference="otp_7Q2K9D4M",
        ),
        idempotency_key="branch-CIF-30087741-20261003",
    )
    cURLShell
    curl -X POST https://console.dpconsent.com/consent/sdk/v1/consent \
      -H "Authorization: Bearer $PIEDAP_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: branch-CIF-30087741-20261003" \
      -d '{
        "formKey": "kaveri-loan-updates",
        "subjectId": "CIF-30087741",
        "subjectType": "USER_ID",
        "countryCode": "IN",
        "decisions": [
          { "purposeKey": "loan-offers-by-sms", "granted": true },
          { "purposeKey": "loan-offers-by-call", "granted": false }
        ],
        "capture": {
          "channel": "BRANCH",
          "method": "OTP",
          "agentRef": "EMP-40213",
          "locationRef": "BLR-JAYANAGAR-014",
          "methodReference": "otp_7Q2K9D4M"
        }
      }'
  2. For a paper form, send the SHA-256 of the scan as documentSha256. Keep the scan in your own document system.

    Shell
    sha256sum KF-2209-scan.pdf | cut -d' ' -f1
  3. Read captureContext in the response. The staff and site references come back as keyed hashes.

Choose the method#

method The person Also send
OTP Entered or read back a one-time password your system sent methodReference: the transaction id, never the code
SIGNED_DECLARATION Signed a declaration, on paper or by eSign documentSha256 or methodReference
RECORDED_CALL Agreed on a call you recorded methodReference: the recording id
PAPER_FORM Filled in and signed a paper form documentSha256 or methodReference
LINK_CONFIRMED Confirmed on their own phone through a link you sent methodReference: your confirmation id
AGENT_ATTESTED Did not confirm. A member of your staff says they agreed agentRef

channel is BRANCH, CALL_CENTRE, IVR, KIOSK, FIELD_AGENT or PAPER. Consent lists the limits of each field.

Staff attestation and new answers#

A record sent with AGENT_ATTESTED carries "attestedByStaffOnly": true in responses, webhooks and receipts. The console marks it Attested by staff. The consent check adds the note ATTESTED_BY_STAFF_ONLY when every grant behind a granted answer rests on such an attestation. If the person confirms later, send the same answers again with the new method:

JavaScript
await client.updateConsent(consentId, sameDecisions, {
  capture: {
    channel: 'BRANCH',
    method: 'LINK_CONFIRMED',
    methodReference: 'cnf_20261004_118',
  },
});

A person who withdrew and later signs a new paper form gives a new answer. Send it as a live write, without collectedAt: an earlier answer never replaces a withdrawal. Keep the date on the paper in methodReference, such as KF-2209/2026-09-30, or in metadata.

What is checked and what is not#

  • The capture is sealed with this write only. A later answer from the banner, a withdrawal or an expiry does not carry it. The earlier event keeps it. Linking another identifier keeps it.
  • The service records the method and reference your system sends. It does not check the one-time password, the signature, the recording or the document.
  • Send no personal data in methodReference. Receipts carry it, and sealed events keep it after erasure. A value that looks like a phone number is refused.
  • Do not keep this context in metadata. That field is not sealed, and a later write replaces it.

↑↓ to move, Enter to open