Skip to content

Privacy Settings

Grant provides built-in privacy controls for GDPR compliance: data export, account deletion with configurable retention, and automated cleanup.

Data Export

Users can download all their personal data as a structured JSON file.

Included:

  • User profile (ID, name, email, timestamps)
  • Accounts owned (personal and organization)
  • Authentication methods (providers, verification status)
  • Sessions (device info, IP, expiry)
  • Organization and project memberships with roles
  • Export metadata (timestamp)

Excluded (for security):

  • Hashed passwords, tokens, internal system fields, other users' data

Endpoints:

bash
# REST (file download)
GET /api/me/export
Authorization: Bearer <token>
graphql
# GraphQL
query {
  myUserDataExport {
    user {
      id
      name
      email
    }
    accounts {
      id
      name
    }
    exportedAt
  }
}

Users can only export their own data — the authenticated user's identity determines the export scope.

Account Deletion

Process

  1. User confirms intent by entering their user ID (works for all auth methods, including OAuth)
  2. All accounts owned by the user are soft-deleted (deletedAt timestamp set)
  3. All sessions are invalidated
  4. After the retention period, the cleanup job permanently deletes the data

Deletion Types

TypeBehaviorReversible
Soft delete (default)Marks with deletedAt, retains for retention periodYes — within retention window
Hard deleteImmediate permanent removalNo

Endpoints:

graphql
mutation {
  deleteAccounts(input: { userId: "user-uuid", hardDelete: false }) {
    id
    deletedAt
  }
}
bash
DELETE /api/me
Authorization: Bearer <token>
Content-Type: application/json
{ "userId": "user-uuid", "hardDelete": false }

Data Retention

SettingEnv VariableDefault
Account deletion retentionPRIVACY_ACCOUNT_DELETION_RETENTION_DAYS30 days
Backup retentionPRIVACY_BACKUP_RETENTION_DAYS90 days
Cleanup scheduleJOBS_DATA_RETENTION_SCHEDULE0 2 * * * (daily 2 AM)

The data retention cleanup job runs on the configured schedule and:

  1. Finds accounts soft-deleted longer ago than the retention period
  2. Permanently deletes the associated users (cascading to relationships)
  3. Permanently deletes the accounts

See Job Scheduling for details on the cleanup job.

GDPR Coverage

RightImplementation
Data portabilityJSON export via GET /api/me/export
Right to erasureAccount deletion with DELETE /api/me
Data retentionConfigurable periods with automated cleanup
TransparencyExport shows all stored personal data
Audit trailAll deletions logged — see Audit Logging

Related:

Released under the MIT License.