> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grantex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Consent Record

> Retrieve a single DPDP consent record by ID. A developer read has no side effects.

## Endpoint

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

## Authentication

Requires a developer API key in the `Authorization` header.

## Request Headers

| Header | Value |
| - | - |
| `Authorization` | `Bearer <api_key>` |

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `recordId` | `string` | Yes | The consent record ID |

## Example Request

```bash theme={null}
curl https://api.grantex.dev/v1/dpdp/consent-records/crec_01HXYZ... \
  -H "Authorization: Bearer gx_..."
```

## Response -- 200 OK

```json theme={null}
{
  "recordId": "crec_01HXYZ...",
  "grantId": "grnt_01HXYZ...",
  "dataPrincipalId": "user_abc123",
  "dataFiduciaryName": "Example Retail Ltd",
  "purposes": [
    { "code": "analytics", "description": "Usage analytics for service improvement" }
  ],
  "scopes": ["calendar:read", "email:send"],
  "consentNoticeId": "notice_v2",
  "consentNoticeVersion": "2.0",
  "consentNoticeLanguage": "en",
  "noticeHash": "9f8e7d6c5b4a...",
  "status": "active",
  "consentGivenAt": "2026-04-05T12:00:00.000Z",
  "processingExpiresAt": "2027-01-01T00:00:00.000Z",
  "retentionUntil": "2027-01-31T00:00:00.000Z",
  "accessCount": 0,
  "lastAccessedAt": null,
  "withdrawnAt": null,
  "withdrawnReason": null,
  "erasedAt": null,
  "createdAt": "2026-04-05T12:00:00.000Z"
}
```

## Response Fields

| Field | Type | Description |
| - | - | - |
| `recordId` | `string` | Unique consent record ID |
| `grantId` | `string` | The associated grant ID |
| `dataPrincipalId` | `string` | The data principal who gave consent |
| `dataFiduciaryName` | `string` | Name of the data fiduciary (developer) |
| `purposes` | `object[]` | Array of purpose objects (`{ code, description }`) |
| `scopes` | `string[]` | Scopes from the associated grant |
| `consentNoticeId` | `string` | ID of the consent notice |
| `consentNoticeVersion` | `string \| null` | The notice version the record was given against (`null` for an older record whose version could not be recovered) |
| `consentNoticeLanguage` | `string \| null` | The language of that notice (`null` when not known for an older record) |
| `noticeHash` | `string \| null` | The notice hash of that notice, also signed into the proof ([Consent Notice Content](/api-reference/dpdp/consent-notice-content#the-notice-hash)); `null` for records created before it was kept |
| `status` | `string` | Record status: `active`, `withdrawn`, `expired`, or `erased` |
| `consentGivenAt` | `string` | ISO-8601 timestamp of original consent |
| `processingExpiresAt` | `string` | ISO-8601 processing expiry timestamp |
| `retentionUntil` | `string` | ISO-8601 data retention limit |
| `accessCount` | `number` | The stored access count. Developer reads through this API do not change it |
| `lastAccessedAt` | `string \| null` | The stored last-access timestamp, `null` if never set. Developer reads do not change it |
| `withdrawnAt` | `string \| null` | ISO-8601 timestamp of withdrawal (if withdrawn) |
| `withdrawnReason` | `string \| null` | Reason for withdrawal (if withdrawn) |
| `erasedAt` | `string \| null` | ISO-8601 timestamp of erasure (if erased) |
| `createdAt` | `string` | ISO-8601 creation timestamp |

This is a developer read: it has no side effects. It used to increment
`accessCount` and set `lastAccessedAt` on every call.

## Error Responses

| Status | Code | Description |
| - | - | - |
| 401 | `UNAUTHORIZED` | Invalid or missing API key |
| 404 | `NOT_FOUND` | Consent record not found |

## SDK Examples

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Grantex } from '@grantex/sdk';

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

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

  ```python Python theme={null}
  from grantex import Grantex

  grantex = Grantex(api_key="gx_...")

  record = grantex.dpdp.get_consent_record("crec_01HXYZ...")
  ```
</CodeGroup>

## Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: [sanjeev@orchestrum.in](mailto:sanjeev@orchestrum.in) or [mishra.sanjeev@gmail.com](mailto:mishra.sanjeev@gmail.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.