Skip to main content

Keep the data map and run a personal data export

DEVELOPER GUIDE

Register your collections in the data map, find the ones you missed, and request, check and download a personal data export.

Who this guide is for

Developers and superusers who add collections to Claviger and answer requests for a person's data.

Why it matters

Export, retention and erasure all read the data map. A collection that holds personal data and is not on the map is left out of all three.

What you will do, in one sentence

Map every collection, keep the unmapped list empty, then request the export and download the ZIP once.

Screens are captured from a seeded test system. Every name, address and number on the screens is invented. Prepared 15 November 2026.

1. What the data map is​

The data map lists every collection and what it holds about people. It lives in the _dataMap system collection. Only superusers can see it. There is one row per collection.

FieldMeaning
collectionThe collection name.
treatmentWhat happens to the rows when a person is erased.
subjectPathsThe fields that link a row to the person it is about, such as user.
personalFieldsThe fields that hold personal data.
retainReasonWhy the rows are kept. Required for retain.
noteFree text.

The treatments are erase, anonymize, retain, export and none. Every treatment except none is included in an export. none means reviewed and holds no personal data. It is not the same as forgotten.

Collections that ship with Claviger already have a built-in entry. Even a superuser cannot change or delete them.

2. Map your own collections​

Register an app collection as a normal record of _dataMap. The server checks it:

  • The collection must exist.
  • retain needs a reason.
  • Any treatment except none needs a subject path.

To see what is still missing:

curl -H "Authorization: $TOKEN" https://auth.example.org/api/data-map/unmapped
{"totalItems": 1, "items": [{"name": "prayers", "type": "base", "system": false}]}
Keep the unmapped list empty

A collection that is not on the map is not exported, not retained and not erased. Check this route after every schema change.

3. What an export contains​

An export is one ZIP file.

FileContent
manifest.jsonWhen it was made, who it is about, row counts, skipped collections and why, errors, and files left out.
README.txtA short explanation for the person.
data/<collection>.jsonThe rows about the person.
files/<collection>/<record>/<file>Files the person uploaded.

Built-in collections use a fixed list of columns. Secrets, such as password hashes and passkey keys, are never exported. For your own collections, the export writes every field except password fields, token keys and fields whose name looks like a secret. Only the person's own rows are included.

Encrypted fields are exported decrypted. The key never leaves the server.

Files are included up to 100 MB each and 1 GB in total. A file over the limit is listed in the manifest and the request ends as partial. Request logs are not part of the export. The logs.maxDays setting removes them.

A person's pastoral notes are held back for review. See the pastoral notes guide.

4. Request an export​

WhoRoute
A signed-in person, for themselvesPOST /api/me/export
A superuser, for anyonePOST /api/gdpr/subjects/{id}/export

A person needs proof that they are present. With a passkey, a fresh passkey assertion is needed. The response is 403 with code passkey_step_up_required until then. Without a passkey, the body carries the password: {"password": "..."}. A person with neither must ask an administrator. API keys cannot use these routes.

curl -X POST https://auth.example.org/api/gdpr/subjects/USER_ID/export \
-H "Authorization: $TOKEN"

The answer is 202 with the request, its state and a dueAt date 30 days away. A person has one export at a time, and a second request gets 409. Self-service is limited to 3 requests an hour.

5. Check and download​

RouteUse
GET /api/gdpr/exports/{id}State and counts.
GET /api/me/exportsThe person's own requests.
GET /api/gdpr/exportsSuperuser: all requests. Add ?subject=<id>.
GET /api/gdpr/exports/{id}/downloadThe ZIP.
DELETE /api/gdpr/exports/{id}Cancel a queued request, or discard a finished file.

States are queued, running, done, partial, failed, cancelled and expired.

The download link works once

After the ZIP is sent in full, the server deletes the file. A download that breaks halfway does not use it up. A finished export expires after 7 days by default. When a superuser makes the export for someone else, the superuser downloads it and passes it on. The person cannot fetch it through the API.

Limits live in Settings, then Data export, or in PATCH /api/settings under dataExport: maxFileMB, maxTotalMB, retentionDays, selfRequestsPerHour and adminRequestsPerHour.

Each step writes an audit entry: gdpr_export_request, gdpr_export and gdpr_export_download. They hold ids and counts, never content.

6. Quick reference card​

Add a collection​

  1. Add a _dataMap row with treatment and subject path.
  2. GET /api/data-map/unmapped must be empty.

Export for a person​

  1. POST /api/gdpr/subjects/{id}/export.
  2. Poll GET /api/gdpr/exports/{id}.
  3. Download once, within 7 days.

How long to keep and whether to give a person certain records are questions for your lawyer.