Skip to main content

Endpoint

POST /v1/dpdp/exports

Authentication

Requires a developer API key in the Authorization header.

Request Headers

HeaderValue
AuthorizationBearer <api_key>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
typestringYesExport type: dpdp-audit, gdpr-article-15, or eu-ai-act-conformance
dateFromstringYesISO-8601 start date for the export window
dateTostringYesISO-8601 end date for the export window
formatstringNoOutput format (default: "json")
includeActionLogbooleanNoInclude audit log entries (default: true)
includeConsentRecordsbooleanNoInclude consent records (default: true)
dataPrincipalIdstringNoFilter export to a specific data principal

Example Request

curl -X POST https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/dpdp/exports \
  -H "Authorization: Bearer gx_..." \
  -H "Content-Type: application/json" \
  -d '{
    "type": "dpdp-audit",
    "dateFrom": "2026-01-01T00:00:00.000Z",
    "dateTo": "2026-04-01T00:00:00.000Z",
    "includeActionLog": true,
    "includeConsentRecords": true
  }'

Response — 201 Created

{
  "exportId": "exp_01HXYZ...",
  "type": "dpdp-audit",
  "format": "json",
  "recordCount": 42,
  "data": {
    "exportType": "dpdp-audit",
    "dateRange": {
      "from": "2026-01-01T00:00:00.000Z",
      "to": "2026-04-01T00:00:00.000Z"
    },
    "generatedAt": "2026-04-05T14:00:00.000Z",
    "developerId": "dev_01HXYZ...",
    "consentRecords": [...],
    "auditLog": [...],
    "grievances": [...]
  },
  "expiresAt": "2026-04-12T14:00:00.000Z",
  "createdAt": "2026-04-05T14:00:00.000Z"
}

Response Fields

FieldTypeDescription
exportIdstringUnique export ID
typestringExport type
formatstringOutput format
recordCountnumberTotal number of records in the export
dataobjectThe export data payload (see below)
expiresAtstringISO-8601 expiry timestamp (7 days from creation)
createdAtstringISO-8601 creation timestamp

Export Data Object

FieldTypeDescription
exportTypestringThe export type
dateRangeobject{ from, to } ISO-8601 timestamps
generatedAtstringISO-8601 generation timestamp
developerIdstringDeveloper who generated the export
consentRecordsobject[]Consent records in the date range (if includeConsentRecords)
auditLogobject[]Audit log entries in the date range (if includeActionLog, max 1000)
grievancesobject[]Grievances in the date range (only for dpdp-audit type)

Export Types

TypeDescriptionIncludes Grievances
dpdp-auditIndia DPDP Act compliance auditYes
gdpr-article-15GDPR right of access (Article 15) reportNo
eu-ai-act-conformanceEU AI Act conformance assessmentNo

Error Responses

StatusCodeDescription
400BAD_REQUESTMissing required fields or invalid type
401UNAUTHORIZEDInvalid or missing API key

SDK Examples

import Grantex from '@grantex/sdk';

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

const report = await grantex.dpdp.createExport({
  type: 'dpdp-audit',
  dateFrom: '2026-01-01T00:00:00.000Z',
  dateTo: '2026-04-01T00:00:00.000Z',
});
// report.recordCount → 42
// report.data.consentRecords → [...]