Overview
The GDPR Compliance API provides endpoints that implement data subject rights under the General Data Protection Regulation (GDPR). These endpoints enable users to exercise their privacy rights including access, rectification, erasure, data portability, and consent management.All GDPR endpoints require user authentication and operate on the authenticated user’s data only. These endpoints are designed to meet EU GDPR compliance requirements (Articles 15-21).
Base URL
Endpoints
Get User Data (Article 15: Right to Access)
endpoint
Export all user data in structured JSON format for data subject access requests.
Export User Data (Article 20: Right to Data Portability)
endpoint
Export user data in portable format (JSON or CSV) for transfer to another service.
format(string, optional): Export format -jsonorcsv. Default:json
Update User Profile (Article 16: Right to Rectification)
endpoint
Update user profile information to correct inaccurate personal data.
name(string): User’s full name (1-100 characters)email(string): User’s email addresspreferences(object): User preferences and settings
Delete User Account (Article 17: Right to Erasure)
endpoint
Permanently delete user account and all associated personal data.
confirm(boolean, required): Must betrueto confirm deletion
- User profile and account
- All sessions
- All conversations and messages
- All preferences and settings
- All authorization tuples (OpenFGA)
- All consent records
- Audit logs (user_id replaced with cryptographic hash)
Update Consent (Article 21: Right to Object)
endpoint
Grant or revoke consent for specific data processing activities.
analytics: Analytics and usage trackingmarketing: Marketing communications and promotionsthird_party: Third-party data sharingprofiling: Automated profiling and decision-making
Get Consent Status (Article 21: Right to Object)
endpoint
Retrieve current consent status for all data processing activities.
Authentication
All GDPR endpoints require authentication. Include a valid JWT token in theAuthorization header:
Error Responses
GDPR endpoints return standard HTTP status codes:Bad Request
Invalid request format, missing required fields, or missing confirmation.
Unauthorized
Missing or invalid authentication token.
Forbidden
Insufficient permissions to access resource.
Unprocessable Entity
Invalid consent type or validation error.
Internal Server Error
Server error during data deletion or export.
SDK Examples
Python
JavaScript/TypeScript
cURL
Storage Backend Configuration
GDPR compliance data is stored in PostgreSQL for production deployments. Configure the storage backend in your environment:Compliance Notes
GDPR Compliant: These endpoints implement EU GDPR requirements for data subject rights (Articles 15-21).
- User ID
- Timestamp
- IP address (where applicable)
- GDPR article reference
- Consent records: Retained indefinitely (append-only audit trail)
- Deletion records: Retained for 7 years for compliance
- Anonymized audit logs: Retained for compliance (user IDs hashed)
- Right to Access: Immediate (real-time API response)
- Right to Erasure: Immediate (synchronous deletion)
- Data Export: Immediate for JSON, may take longer for large CSV exports
Next Steps
GDPR Storage Setup
Configure PostgreSQL storage for GDPR compliance
Authentication
Get authentication tokens
GDPR Compliance Guide
Complete GDPR compliance implementation guide
Architecture Decision
ADR-0041: PostgreSQL GDPR Storage
Privacy First: Empower users with full control over their personal data!