Skip to main content

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).
The DELETE /me endpoint permanently deletes user data and cannot be reversed. Always require explicit user confirmation before calling this endpoint.

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.
GDPR Article 15: The data subject shall have the right to obtain from the controller confirmation as to whether or not personal data concerning him or her are being processed, and access to the personal data. Request:
Response:
Example:

Export User Data (Article 20: Right to Data Portability)

endpoint
Export user data in portable format (JSON or CSV) for transfer to another service.
GDPR Article 20: The data subject shall have the right to receive the personal data concerning him or her in a structured, commonly used and machine-readable format. Query Parameters:
  • format (string, optional): Export format - json or csv. Default: json
Request:
Response: File download with appropriate Content-Type header Response Headers:
Example (JSON):
Example (CSV):

Update User Profile (Article 16: Right to Rectification)

endpoint
Update user profile information to correct inaccurate personal data.
GDPR Article 16: The data subject shall have the right to obtain from the controller without undue delay the rectification of inaccurate personal data concerning him or her. Request Body:
Fields (all optional):
  • name (string): User’s full name (1-100 characters)
  • email (string): User’s email address
  • preferences (object): User preferences and settings
Response:
Example:

Delete User Account (Article 17: Right to Erasure)

endpoint
Permanently delete user account and all associated personal data.
GDPR Article 17: The data subject shall have the right to obtain from the controller the erasure of personal data concerning him or her without undue delay.
This operation is irreversible and permanently deletes all user data including sessions, conversations, preferences, and authorization tuples. Audit logs are anonymized (not deleted) for compliance purposes.
Query Parameters:
  • confirm (boolean, required): Must be true to confirm deletion
Request:
Response:
What gets deleted:
  • User profile and account
  • All sessions
  • All conversations and messages
  • All preferences and settings
  • All authorization tuples (OpenFGA)
  • All consent records
What gets anonymized (retained for compliance):
  • Audit logs (user_id replaced with cryptographic hash)
Example:

Update Consent (Article 21: Right to Object)

endpoint
Grant or revoke consent for specific data processing activities.
GDPR Article 21: The data subject shall have the right to object at any time to processing of personal data concerning him or her. Request Body:
Consent Types:
  • analytics: Analytics and usage tracking
  • marketing: Marketing communications and promotions
  • third_party: Third-party data sharing
  • profiling: Automated profiling and decision-making
Response:
Example:

Get Consent Status (Article 21: Right to Object)

Retrieve current consent status for all data processing activities.
Request:
Response:
Example:

Authentication

All GDPR endpoints require authentication. Include a valid JWT token in the Authorization header:
The authenticated user’s identity is used to determine which data to access, export, or delete. Users can only access their own data. See Authentication API for obtaining tokens.

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:
See GDPR Storage Configuration for detailed setup instructions.

Compliance Notes

GDPR Compliant: These endpoints implement EU GDPR requirements for data subject rights (Articles 15-21).
Audit Trail: All GDPR operations are logged with:
  • User ID
  • Timestamp
  • IP address (where applicable)
  • GDPR article reference
Data Retention:
  • 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)
Response Times:
  • 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!