Skip to main content

Overview

A data subject request (DSR) allows any organisation member to request that all their personal data be permanently deleted from that organisation’s workspaces. The request goes to the organisation’s admins for review before any deletion occurs.

Subject flow

Submitting a request

Members navigate to Settings → Privacy (/settings/privacy). They select the organisation they want data deleted from, optionally add a note, and confirm the request. API:
Requirements:
  • Caller must be a member of the specified organisation.
  • Caller’s JWT must have been issued within the last 10 minutes (fresh auth required). If not, a 403 Fresh authentication required — please sign in again is returned.
  • Returns 409 Conflict if an open request already exists for the same (user, organisation) pair.
After submission:
  • Request is created with status = pending and due_at = now + 30 days. Notifications go to the account’s own email address (a contact_email in the body is ignored); it is cleared after the final email.
  • The account is frozen (users.frozen_at): every sign-in path and API key is refused with a message pointing at the cancel link, refresh tokens are revoked, API keys are deactivated and calendar auto-join is paused. freeze_state records what was switched off so cancelling or a rejection restores exactly that. The UI signs the member out a few seconds after submitting.
  • The member is emailed a cancel link (/data-requests/cancel?token=…, 32 random bytes; only its SHA-256 is stored). Org admins are emailed that a request is waiting.

Cancelling

The emailed link opens /data-requests/cancel. Opening it changes nothing (mail scanners prefetch links); the member presses Cancel my request.
Both are public, token-gated and rate limited. Cancelling only succeeds while the request is pending; it unfreezes the account, logs erasure_cancelled and emails a confirmation.

Viewing requests

Returns all the authenticated user’s requests, most recent first.

Org admin flow

Users with org_admin (or platform admin) role can access the deletion request queue at Settings → Data requests (/settings/data-requests).

Where admins see requests

Org admins see their organisation’s requests in two places, both rendered by the same inbox: Settings → Data requests and, below the access requests, /access-requests. Platform admins see every organisation’s requests at /admin/data-requests. Requests are grouped by type — Deletion (red badge) first, then Export — and sorted by due date within each group, open requests before closed ones. An open request (pending, approved, executing or failed) turns amber within 7 days of its due date and red once overdue, with the days left or overdue shown.

Queue

Requests are ordered: overdue first (due_at in the past), then by created_at descending. Subject name and email are included only for status = pending requests to minimise exposure of PII.

Approving a request

The Approve button opens a confirmation dialog that lists the workspaces in scope and, per workspace, how many sessions the member owns (their content is erased) and how many sessions it holds in total (the member is redacted out of the rest):
Only the organisation’s own workspaces are named. The member’s personal workspaces outside the organisation are covered by the erasure but only counted (personal_workspace_count). The endpoint returns 409 unless the request is a pending erasure. Approve stays disabled until the scope has loaded, and when nothing is in scope (approval would fail). Closed requests (rejected, cancelled, completed) are hidden behind Show closed requests.
  • Caller must not be the subject of the request.
  • Sets status = approved, stamps decided_at and decided_by.
  • Creates a jobs row with job_type = erasure (picked up by the erasure worker).
  • Links execution_job_id on the DSR row.
  • Appends a gdpr_log entry with event_kind = erasure_approved.

Rejecting a request

  • Caller must not be the subject of the request.
  • reason must be non-empty.
  • Sets status = rejected, stamps decided_at, decided_by, decision_reason.
  • Brief 03 will implement account unfreezing and the rejection email to the subject.
  • Appends a gdpr_log entry with event_kind = erasure_rejected.

Platform admin overview

Platform admins can view all DSRs across every organisation at /admin/data-requests.
The subject’s name, email and note are only returned while a request is pending. Ordered: overdue first, then by created_at descending. Approval/rejection is done by an org admin through the org-scoped endpoints. A failed request shows the failure reason and a Retry erasure button:
It resets the erasure job’s attempt budget and republishes it; the worker resumes from the request’s checkpoint. Platform admins are also emailed when an erasure fails.

Timelines

Overdue requests are highlighted in both the org admin queue and the platform admin overview. The API’s data-request notifier (every minute) emails org admins a reminder after 7 and 21 days pending, and at 28 days escalates to platform admins as well (also used when an organisation has no admins). It also sends the subject’s “being deleted” and “deleted” emails as the worker moves the request on. Each email is claimed with a conditional update first, so none is sent twice.

What is deleted vs retained

The erasure worker (erasure consumer in rag-worker, api/crates/rag-worker/src/erasure.rs) acts on the request’s organisation only: the organisation’s workspaces plus any workspace without an organisation that the subject owns or belongs to (personal workspaces from the waitlist, workshop workspaces) — the app already shows those inside whichever organisation the user is in (workspace_matches_current_org), so they’re treated as the organisation’s. At the end, workspaces the subject owns leave their view: one that isn’t in a team organisation (in their Personal organisation, or in none) is deleted even when others were invited to it — personal is personal — cascading its sessions (other members’ included), transcripts, jobs & insights, plus its topic graph projection; a team workspace stays for the people still in it, with no owner. Rule: delete everything that can be deleted; keep only what topic history & pattern analysis need, with the subject removed. Every value the worker blanks out rather than deletes is replaced with the scrub marker [gdpr-scrubbed:<data_request_id>] (JSON columns: {"gdpr_scrubbed": "<data_request_id>"}). Whoever meets it can see why the content is gone: the id is the data_subject_requests row (which names the subject’s user id) and gdpr_log.data_request_id lists what ran. The admin job views show the “Deleted session” badge for it. Each step is checkpointed in data_subject_requests.erasure_checkpoint, so a failed or redelivered job resumes where it stopped (3 attempts, then the request stays failed for review). Workers skip writing results into erased sessions. The erasure job’s own jobs row sits in one of the request’s workspaces and cascades when that workspace is deleted, so everything that can fail and retry (Recall, S3, PostHog …) runs first. The last step is one transaction: delete the non-team workspaces and the Personal membership, log erasure_completed, mark the request completed (unfreezing the account if it lives on) and redact the audit trail. If it fails, nothing is committed and the job retries; once it commits the worker treats the missing job row as done. Requests with scope = 'personal' are refused by the worker. Personal data is erased by a request in the person’s Personal organisation, decided by a platform admin; in that organisation, the subject’s workspaces are deleted outright, shared or not. See Account ownership.

Database schema

Key tables added by migration m20260925_000001_data_subject_requests: Unique constraint: one open (pending, approved or executing) request per subject, kind & organisation.

Export (right to portability)

Users can request a machine-readable archive of their personal data (GDPR Art. 20) or all sessions in a workspace. For which export applies to which organisation kind, and what each includes, see Exports.

Personal export

Body (optional): { "format": "json" | "csv" | "markdown" } — defaults to "json".
  • Requires a JWT issued within the last 10 minutes (fresh auth; API keys and OAuth tokens rejected).
  • Account must not be frozen.
  • Returns 409 Conflict if an export is already in progress.
  • Creates a data_subject_requests row with kind = export, scope = personal, status = executing (self-service; no admin approval step).
  • Enqueues a DataExport job. The rag-worker export consumer builds the ZIP on disk, uploads it to kair-voice/gdpr-exports/<data_request_id>.zip (retries overwrite the same object) and stores only that key in freeze_state["s3_key"] — never a download link.
  • The notifier creates a 24-hour presigned link when it sends “Your data export is ready”. If it can’t (S3 not configured on the API, presigning fails) it logs an error and retries on the next sweep rather than sending an email without a link.
  • Archives are deleted from S3 3 days after the export finished or failed (hourly sweep in rag-worker, EXPORT_RETENTION); the request then records freeze_state["expired_at"].
  • A failed export is marked failed only after its last retry; platform admins then get an “export failed” email with the error.
  • Debug builds only: the worker also copies each archive and its JSON files, unpacked, to api/debug/gdpr-exports/<data_request_id>/ (gitignored, kept across builds & cargo clean — delete it yourself when done) so exports can be inspected locally — debug builds don’t send email.
The ZIP contains:

DPIA: moderator extraction traces in personal exports

Offline evaluation stores full LLM prompts and raw model output in moderator_extraction_traces when moderator_agent.trace_extractions is enabled. Those fields are never included in portability exports. For owned sessions, the export may include parsed_analysis and persisted_analysis JSON from that table. Those structures are built from group discussion transcripts and can name or paraphrase other participants. To reduce third-party leakage, the export worker keeps only pattern and speaker-share rows tied to speaker labels the subject has claimed in that session (via speaker_claims). If the subject has no claim in a session, those analysis fields are omitted. On kept pattern cards, item lists, excerpts, open questions, source context and similar free-text fields are cleared. Divergence/convergence summaries, headlines, and practice outputs are dropped even when claims exist, because they are session-wide. Erasure scrubs or clears trace rows for sessions the subject owns, holds a speaker claim in, or recorded a track in (browser, registered device, or phone capture while their device was linked to that session). Anonymous phone admissions with only a display name and no linked device cannot be attributed to the subject, so their traces are left to the retention sweep. Retention hard-deletes rows older than trace_retention_days (rag-worker sweep).

Workspace export

Body (optional): { "format": "json" | "csv" | "markdown" } — defaults to "json".
  • Requires workspace owner or platform admin, a fresh interactive sign-in (same rule as the personal export) and an account that isn’t frozen; a token limited to another workspace is refused.
  • Returns 409 Conflict if a workspace export is already in progress for the requester.
  • Creates a DSR with kind = export, scope = organisation.
  • The archive holds the workspace’s sessions, transcripts (with segments) and summaries — no audio and no members’ private notes. Same storage, email and expiry as the personal export.

Organisation export

Body (optional): { "format": "json" | "csv" | "markdown" } — defaults to "json".
  • Requires org admin/owner or platform admin, plus a fresh interactive sign-in.
  • Returns 409 Conflict if an org export is already in progress for the requester.
  • Creates a DSR with kind = export, scope = organisation, organisation_id set.
  • The archive aggregates sessions, transcripts, and summaries across all workspaces in the organisation.

Export formats

All formats are delivered as a .zip archive.

GDPR log event kinds