Skip to main content

Endpoint

POST /v1/dpdp/consent-notices

Authentication

Requires a developer API key in the Authorization header.

Request Headers

HeaderValue
AuthorizationBearer <api_key>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
noticeIdstringYesA developer-chosen identifier for the notice (e.g., "privacy-notice")
versionstringYesVersion string (e.g., "2.0")
titlestringYesHuman-readable notice title
contentstringYesFull consent notice content (HTML or plain text)
purposesobject[]YesArray of purpose objects ({ code, description })
languagestringNoISO language code (default: "en")
dataFiduciaryContactstringNoContact information for the data fiduciary
grievanceOfficerobjectNoGrievance officer details ({ name, email, phone? })

Example Request

curl -X POST https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/dpdp/consent-notices \
  -H "Authorization: Bearer gx_..." \
  -H "Content-Type: application/json" \
  -d '{
    "noticeId": "privacy-notice",
    "version": "2.0",
    "title": "Data Processing Consent Notice",
    "content": "We collect and process your data for the following purposes...",
    "purposes": [
      { "code": "analytics", "description": "Usage analytics for service improvement" },
      { "code": "personalization", "description": "Personalized recommendations" }
    ],
    "language": "en",
    "grievanceOfficer": {
      "name": "Jane Doe",
      "email": "grievance@acme.com",
      "phone": "+91-9876543210"
    }
  }'

Response — 201 Created

{
  "id": "ntc_01HXYZ...",
  "noticeId": "privacy-notice",
  "version": "2.0",
  "language": "en",
  "contentHash": "a1b2c3d4e5f6...",
  "createdAt": "2026-04-05T12:00:00.000Z"
}

Response Fields

FieldTypeDescription
idstringUnique internal notice ID
noticeIdstringDeveloper-chosen notice identifier
versionstringVersion string
languagestringISO language code
contentHashstringSHA-256 hash of the notice content
createdAtstringISO-8601 creation timestamp

Error Responses

StatusCodeDescription
400BAD_REQUESTMissing required fields (noticeId, version, title, content, purposes)
401UNAUTHORIZEDInvalid or missing API key
409CONFLICTNotice version already exists

SDK Examples

import Grantex from '@grantex/sdk';

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

const notice = await grantex.dpdp.createConsentNotice({
  noticeId: 'privacy-notice',
  version: '2.0',
  title: 'Data Processing Consent Notice',
  content: 'We collect and process your data...',
  purposes: [
    { code: 'analytics', description: 'Usage analytics' },
  ],
  grievanceOfficer: {
    name: 'Jane Doe',
    email: 'grievance@acme.com',
  },
});