Account and personal data
Profile, onboarding, export, notifications, and transactional erasure.
Every operation derives the account id from the current Better Auth session. No request field can select another person.
| Operation | Purpose |
|---|---|
GET /api/account/summary | Account identity and profile consent state. |
GET /api/account/onboarding | Profile, preferences, and available categories. |
POST /api/account/onboarding | Save validated profile, consent, and category choices. |
GET /api/me/export | Download the actor's canonical JSON export with private no-store caching. |
DELETE /api/account | Transactionally erase or anonymise actor-owned records. |
POST /api/account/notifications/open | Return actor-owned notifications and mark only those rows read. |
GET /api/account/push | Read push capability and the signed-in user's registered devices. |
POST /api/account/push | Register or update one browser push subscription for the current account. |
DELETE /api/account/push | Remove one browser push subscription owned by the current account. |
Since API 5.1.0 the profile carries an optional ageRange: one of under_18,
18_24, 25_34, 35_44, 45_54 or 55_plus, or null. On
POST /api/account/onboarding, omit ageRange to keep the saved answer and send
null to clear it. The export includes age_range and age_range_at, the time
the range was last changed. birthDate and gender are still accepted and
returned for older clients, but no first-party screen asks for them any more.
The legacy application route adds content-disposition: attachment; the direct
canonical API route returns the same JSON without promising that download
header. Both are private and no-store. See Account export for
the complete relation-level payload.
Missing authentication returns 401. Mutations require an exact configured
Origin; successful direct Nest POST operations return 201.
Push registration is available only when all three VAPID values are configured
(public key, private key, and subject). The browser must obtain explicit
notification permission before saving a subscription. Delivery is a generic
event update alert; the in-app inbox remains the durable record. iOS visitors
must add the web app to the Home Screen for web push support. This local
candidate has no verified external provider delivery yet.
Account erasure
DELETE /api/account runs one serializable transaction. It refuses the only owner of an
organisation, then calls public.erase_account and deletes the Better Auth user, its sessions,
linked accounts and push subscriptions. The response is { ok: true } or { error }; it did not
change in migration 0033.
- Deleted: profile, interests, points, giveaway entries, notifications, listing and stall claims, crew applications, platform administrator rights and appointment memberships.
- Soft-deleted or revoked: team and stall memberships, scanner grants, zone assignments and event staff rows, so history and the last-owner check stay intact.
- Kept without personal details (0033): attendee rows and booking snapshots (name, phone,
email, company and job title removed; visit purpose and free-text answers become
[erased]; choice answers, country, nationality, visitor kind and booking terms kept), ticket email outbox rows (recipient and name removed, unsent email suppressed), pass offers and invitations (address replaced, pending ones revoked or expired), exhibitor leads (notes emptied, sharing withdrawn), door and conference survey answers (free text replaced, choices and numbers kept) and exhibitor survey responses (respondent identity removed, the company's answers kept). - Matched by the verified sign-in email: sign-in codes and magic links (deleted), the
emailkey in audit metadata, and event briefs, organiser enquiries and workforce interest sent with that address. - Kept as they were: registrations, tickets, check-ins, zone visits, orders, payment intents and ledger entries, which carry no name, phone or email and point at an anonymous id.
Erasure is idempotent. The booking snapshot guard rejects every other change, including from the API's database role.
Erased visitors in organiser reports
A person who deletes their account keeps counting in every organiser total, as an anonymous
number: the MATRADE report figures, the exhibition summary, entrance and crew scan counts, event
statistics, analytics, and survey and spin results. Breakdowns by the kept fields (country,
nationality, visitor kind, participant category, choice answers) include them. Migration 0034
gives all of the account's attendee rows one random erased_person_id, so someone who booked with
two phone numbers is still counted once. Lists of people leave them out: MATRADE registration
evidence and the foreign trade visitor list, event people, form responses and their CSV,
attendee search, the operations attendee and VIP admission lists, visitor and conference survey
responses and their CSV, and spin entries and their CSV. Exhibitor survey responses are the
company's and stay listed; when the person who answered deleted their account, the exhibiting
company's name is shown as the respondent, with no email or job title. Pass offers and team,
crew and exhibitor invitations that erasure readdressed (revoked, expired or already used) are
left out of the organiser lists; counts such as pending exhibitor invitations are unchanged. The
erasure placeholder address is never returned. Loyalty points are deleted with the account, so "points issued" in
analytics drops by that person's points. Response shapes did not change.
Native push (3.0 target)
GET /api/account/native-pushreturns feature availability and this session's registered tokens.POST /api/account/native-pushbinds an Expo token to the current account and live session, requiring matchingexpectedUserId.DELETE /api/account/native-pushremoves this account's token.
Native delivery is disabled unless EXPO_PUSH_ENABLED is configured on the API. Provider acceptance and successful provider receipts are recorded separately; neither proves a person read a notification. Expired sessions and account erasure stop future sends. Native tokens are never browser push endpoints. Permission, APNs/FCM credentials and installed-device delivery require separate acceptance checks.

