Skip to content

Consent Rail

Privacy consent management, GDPR/CCPA compliance.

The Consent Rail provides endpoints for managing customer consents, privacy preferences, and regulatory compliance (GDPR, CCPA).

/api/v1/consent
POST /api/v1/consent/consents

Record a customer consent.

Request Body:

{
"subjectId": "cust_123",
"subjectType": "CUSTOMER",
"purpose": "MARKETING",
"channel": "EMAIL",
"granted": true,
"source": "WEB_FORM",
"ipAddress": "192.168.1.1",
"userAgent": "Mozilla/5.0...",
"policyVersion": "1.2.0",
"expiresAt": "2026-01-15"
}

Response:

{
"data": {
"consentId": "con_abc123",
"subjectId": "cust_123",
"purpose": "MARKETING",
"granted": true,
"recordedAt": "2025-01-15T10:00:00Z",
"expiresAt": "2026-01-15T00:00:00Z"
}
}
GET /api/v1/consent/subjects/:subjectId

Get all consents for a subject.

Response:

{
"data": {
"subjectId": "cust_123",
"consents": [
{
"purpose": "MARKETING",
"channel": "EMAIL",
"granted": true,
"recordedAt": "2025-01-15T10:00:00Z"
},
{
"purpose": "ANALYTICS",
"granted": false,
"recordedAt": "2025-01-14T10:00:00Z"
}
]
}
}
GET /api/v1/consent/check

Check if consent is granted for a specific purpose.

Query Parameters:

ParameterTypeDescription
subjectIdstringSubject identifier
purposestringConsent purpose
channelstringOptional channel

Response:

{
"data": {
"granted": true,
"purpose": "MARKETING",
"recordedAt": "2025-01-15T10:00:00Z",
"expiresAt": "2026-01-15T00:00:00Z"
}
}
POST /api/v1/consent/withdraw

Withdraw a consent.

Request Body:

{
"subjectId": "cust_123",
"purpose": "MARKETING",
"channel": "EMAIL",
"reason": "User request"
}
GET /api/v1/consent/subjects/:subjectId/history

Get consent change history.

POST /api/v1/consent/dsr

Submit a data subject request (GDPR/CCPA).

Request Body:

{
"subjectId": "cust_123",
"requestType": "ACCESS",
"email": "customer@example.com",
"verificationMethod": "EMAIL"
}

Response:

{
"data": {
"requestId": "dsr_abc123",
"type": "ACCESS",
"status": "PENDING_VERIFICATION",
"deadline": "2025-02-14T10:00:00Z"
}
}
GET /api/v1/consent/dsr/:requestId

Get data subject request status.

GET /api/v1/consent/dsr/:requestId/export

Download exported data (for ACCESS requests).

POST /api/v1/consent/dsr/:requestId/execute

Execute erasure request.

PurposeDescription
MARKETINGMarketing communications
ANALYTICSUsage analytics
PERSONALIZATIONPersonalized experiences
THIRD_PARTYThird-party sharing
ESSENTIALEssential services (cannot withdraw)
PROFILINGAutomated profiling
TypeDescriptionGDPR Article
ACCESSData access requestArt. 15
RECTIFICATIONData correctionArt. 16
ERASURERight to be forgottenArt. 17
PORTABILITYData portabilityArt. 20
RESTRICTIONRestrict processingArt. 18
OBJECTIONObject to processingArt. 21
EventDescription
consent.grantedConsent granted
consent.withdrawnConsent withdrawn
consent.expiredConsent expired
dsr.submittedDSR submitted
dsr.completedDSR completed