Guides
Data requests
Erase, export and suppress an end user's data (GDPR, CCPA) with a server API key.
You are the controller of your end users' data; Tug processes it for you (see the DPA). When a person asks to see or delete their data, do it with a server API key, or with Delete an end user on the project page.
Erase an end user#
DELETE /users/{distinctId}?project=<project id>deletes the person's events, identity and traits, cohort memberships and decision log rows in that project, and returns a receipt with the counts. Percent-encode the ID (encodeURIComponent).
curl -X DELETE "https://tughq.com/api/v1/users/user_123?project=$TUG_PROJECT_ID" \
-H "Authorization: Bearer $TUG_API_KEY"- Safe on large tables. Rows go in bounded batches. One request works for up to 20 seconds; if there is more, you get
202withstatus: "in_progress". Send the same request again to continue the same receipt, or leave it and a daily job finishes it. - Idempotent. Erasing someone twice is harmless; the second receipt reports zeros.
- Not covered:aggregate counts that no longer identify anyone, and copies in our database provider's backups, which expire on its schedule.
Suppression#
Before deleting, the ID goes on the project's suppression list. Anything your product keeps sending for it (events, identify, PostHog forwarding and imports) is dropped and counted under suppressed, instead of quietly recreating the person. GET /decisions returns null for them. Only a SHA-256 hash of the ID is kept.
To lift it, for example when the person signs up again and agrees to tracking, call DELETE /suppressions/{distinctId}?project=….
Export an end user#
GET /users/{distinctId}/export?project=… returns everything stored about the person in that project: identity and traits, cohort memberships, decision log rows and events.
Events are paged oldest first, up to 10,000 per page. Follow nextCursor while hasMore is true. Full reference: Data subject requests.
Keep personal data out#
- Don't put personal data in event properties. Cohort rules work on behavior and rarely need it.
- Traits can hold what you need for targeting (plan, company size). Tug sends trait names, never values, to its AI provider.
- Data is stored in the United States. See the privacy policy for subprocessors and retention.