Consent and privacy
Consent purposes and how each is enforced, user data export, account deletion across modules, and how long AppCore keeps each kind of data.
On this page
AppCore stores a consent ledger for each user, gives users a self-service export and account deletion, and applies fixed retention windows to the data it holds. You are still the controller of your users' data. AppCore gives you the mechanisms, but which purposes need opt-in, what your privacy notice says and which policy_version applies are your decisions.
Consent purposes
| Purpose | What it gates | Default when the user never chose |
|---|---|---|
optional_analytics | Client product telemetry (POST /v1/analytics/events) | Accepted. Only an explicit withdrawn blocks intake. |
marketing_push | Engagement (campaign) push and in-app messages | Not withdrawn, but engagement messages also need the user's notification preference engagement_enabled, which is off by default. |
marketing_whatsapp | Engagement over WhatsApp | Blocked. It requires an explicit granted. |
marketing_email | Marketing email | Recorded only. Marketing email is not sent by AppCore at all (transactional email only). |
personalization | Recorded, and available as a segment filter | No module changes behavior on it today. |
Security and transactional messages (OTP codes, receipts, account notices) are not consent-gated. They are a separate category, and campaigns can never use it.
Recording consent
POST /v1/privacy/consent (consumer session):
{ "purpose": "marketing_push", "status": "granted", "policy_version": "privacy-2026-11" }- The ledger is append-only. Every change is a new record with purpose, status,
policy_version, time, source and an evidence reference. The latest record per purpose wins. - Each change emits
identity.consent.changed.v1. Messaging, engagement and analytics update their own copies, and the newestrecorded_atwins even if events arrive out of order. - Signing in never creates marketing consent.
- Consent given on a device as a guest is not carried over when the guest signs in to an account. Ask again, or record it again after sign-in.
Warning
Not yet enabled: reading consent back from the server. The contract has no consent read endpoint, so the SDK keeps a local display cache of the last choice made on that device, while the server ledger stays authoritative.
If your users must opt in to analytics (for example under GDPR or similar rules), gate telemetry in the app: do not send product events until the user agrees. The server treats "no record" as allowed for optional_analytics, including for guest installations that never recorded a choice.
Data export
POST /v1/privacy/exportrequires a recent sign-in on this session (otherwise401 REAUTHENTICATION_REQUIRED). It returns202with aJob. While a job is open, repeating the call returns the same job.- The export is produced by the runtime's scheduled maintenance, up to 20 privacy jobs per tick.
GET /v1/privacy/export/{job_id}/downloadstreams a JSON attachment. It also requires recent sign-in on this session and is only for the owner. It answers404until the export is ready and410 EXPORT_EXPIREDafter 24 hours. Every download is audited. There is no public file URL.
The export contains the user profile (ID, display name, status, created time), linked sign-in methods without secrets or raw contact values, the full consent history, and retention notes.
Warning
Not yet enabled: exporting data held by other modules (purchases, entitlements and credit history, inbox, devices, analytics). The export covers identity data only. A user-facing job status endpoint (GET /v1/jobs/{job_id} in the contract) is also not served yet. Poll the download URL instead.
Account deletion
DELETE /v1/privacy/account requires recent sign-in on this session and returns 202 with a Job. Repeating it returns the same open job.
flowchart LR
D["DELETE /v1/privacy/account"] --> I["Immediately: status = deleting,<br/>all sessions revoked"]
I --> E["identity.user.deletion_requested.v1"]
E --> M["Messaging: unbind devices, purge inbox<br/>and preferences, cancel pending sends"]
E --> G["Engagement: suppress pending campaign sends,<br/>never re-target"]
E --> A["Analytics: suppress, delete raw event objects<br/>and per-user rows; keep anonymous aggregates"]
I --> C["Identity cleanup (resumable steps):<br/>sessions → methods → devices → consents<br/>→ exports → profile tombstone"]- From the first request, the user can no longer sign in, even with a session that still exists, and no new events are accepted for them (
subject_erased). - Identity keeps a tombstone with the immutable
user_id, so retained records elsewhere still resolve. Personal fields are removed. - Financial records are kept in minimized form (purchases, refunds, journal entries), because tax and store obligations require them.
- Store subscriptions are not cancelled. Apple or Google keeps billing until the user cancels in the store. Tell users this in your deletion screen and link to the store's subscription settings.
- Analytics reports a user as
physically_erasedonly once no raw object remains. Until then it reportssuppressed. - Monthly active-user counts for already closed months are not lowered by a deletion.
Retention
| Data | Kept for |
|---|---|
| OTP challenge | Valid 5 minutes. The raw destination is cleared once the challenge ends. Only a keyed hash of the code is stored. |
| Session | 30 days, or until logout, revocation, block or deletion |
| Rate-limit counters | About 2 days |
| Idempotency records | 7 days by default |
| User export file | 24 hours |
| Raw client events (object storage) | 30 days |
| Event de-duplication keys | 30 days |
| Daily per-user activity rows | 90 days, folded into anonymous aggregates first |
| Monthly per-user activity rows | 400 days |
| Analytics report exports | 24 hours |
| Anonymous aggregates (no subject reference) | Kept |
| Push device token | Dropped after 90 days without the device being seen (configurable 7–730). Revoked, unbound device rows are deleted after 30 days. |
| Purchases, refunds, finance journal | Kept (financial evidence) |
| Audit records | Kept |
Warning
Not yet enabled: automatic expiry of delivery-attempt history and inbox items. No purge job exists for them yet, so they stay until account deletion.
Every privacy job records the retention policy version it ran under.
What this means for your app
- Ask for consent in your own UI, then record it with
POST /v1/privacy/consent, passing your current privacy-notice version aspolicy_version. - Gate analytics locally if your users must opt in. Withdrawal always works server-side.
- Put "Export my data" and "Delete my account" in settings. Both need a fresh sign-in, so prompt for it first. The SDK can do the step-up.
- On deletion, warn that store subscriptions continue until the user cancels them with Apple or Google.
- Keep personal data out of event properties and template parameters. The server rejects it, and it would then fall outside the deletion flow.