Skip to main content

Endpoint

GET /v1/dpdp/consent-records/:recordId

Authentication

Requires a developer API key in the Authorization header.

Request Headers

HeaderValue
AuthorizationBearer <api_key>

Path Parameters

ParameterTypeRequiredDescription
recordIdstringYesThe consent record ID

Example Request

curl https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/dpdp/consent-records/cr_01HXYZ... \
  -H "Authorization: Bearer gx_..."

Response — 200 OK

{
  "recordId": "cr_01HXYZ...",
  "grantId": "grnt_01HXYZ...",
  "dataPrincipalId": "user_abc123",
  "dataFiduciaryName": "Acme Corp",
  "purposes": [
    { "code": "analytics", "description": "Usage analytics for service improvement" }
  ],
  "scopes": ["calendar:read", "email:send"],
  "consentNoticeId": "notice_v2",
  "status": "active",
  "consentGivenAt": "2026-04-05T12:00:00.000Z",
  "processingExpiresAt": "2027-01-01T00:00:00.000Z",
  "retentionUntil": "2027-01-31T00:00:00.000Z",
  "accessCount": 3,
  "lastAccessedAt": "2026-04-05T14:00:00.000Z",
  "withdrawnAt": null,
  "withdrawnReason": null,
  "createdAt": "2026-04-05T12:00:00.000Z"
}

Response Fields

FieldTypeDescription
recordIdstringUnique consent record ID
grantIdstringThe associated grant ID
dataPrincipalIdstringThe data principal who gave consent
dataFiduciaryNamestringName of the data fiduciary (developer)
purposesobject[]Array of purpose objects ({ code, description })
scopesstring[]Scopes from the associated grant
consentNoticeIdstringID of the consent notice
statusstringRecord status: active, withdrawn, expired, or erased
consentGivenAtstringISO-8601 timestamp of original consent
processingExpiresAtstringISO-8601 processing expiry timestamp
retentionUntilstringISO-8601 data retention limit
accessCountnumberNumber of times this record has been accessed
lastAccessedAtstring | nullISO-8601 timestamp of last access
withdrawnAtstring | nullISO-8601 timestamp of withdrawal (if withdrawn)
withdrawnReasonstring | nullReason for withdrawal (if withdrawn)
createdAtstringISO-8601 creation timestamp

Error Responses

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing API key
404NOT_FOUNDConsent record not found

SDK Examples

import Grantex from '@grantex/sdk';

const grantex = new Grantex({ apiKey: 'gx_...' });

const record = await grantex.dpdp.getConsentRecord('cr_01HXYZ...');