Customer data and privacy requests
Answer a customer who asks to see their data, to prove they consented, or to be deleted, with the calls that do each today and what each leaves behind.
Available, with limitsAPI
Privacy laws such as the GDPR and the CCPA give your customers the right to see what you hold about them, to know what they agreed to, and to have their account deleted. The realm holds the evidence for each request: the customer’s profile, a record of every app they allowed and when, and an audit trail of what was done in their name. This page maps each request to the calls that answer it today. One-call export is planned, and customers can’t yet delete their own account; you do both for them.
Before you begin
Section titled “Before you begin”- Privilege:
RealmViewerin the customer realm to read a customer’s data and trail;RealmOwnerto change or delete their account. Give the people who handle privacy requests a group with only what they need; see Delegated administration. - Where: the API. Call the API shows how to get
$CVYUH_SESSION. - The customer’s sign-in name, here
maya, and their id, which their record carries. - Check it’s them by your own means before you act on a request.
How it works
Section titled “How it works”| Request | What answers it | How |
|---|---|---|
| See my data | Their record, their consent records, their factors and their audit trail | Give a customer their data |
| What did I agree to? | Their consent records: each app, the scopes allowed, firstGranted and lastGranted | Prove consent |
| Withdraw my consent from an app | The customer’s own Authorized Apps page | Authorized apps |
| Correct my data | A change to their record | PATCH on their record; see Add and change users |
| Delete me | Ending their access, then deleting the account | Delete a customer’s account |
Give a customer their data
Section titled “Give a customer their data”Read each part, and hand the customer the answers:
# Their profile, without their passwordcurl https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
# Every app they allowedcurl -G https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Consent \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ --data-urlencode 'filter={"filter":{"field":"subjectId","op":"=","value":"<maya'\''s id>"}}'
# What was done by them and in their namecurl "https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?person=<maya's id>&pageSize=100" \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"A customer can read most of it themselves, with their own session: their profile (POST /whoami/v1), their factors
(GET /devices/v1), the apps they allowed (GET /me/v1/oauth2/apps) and their own trail (GET /audit/v1/trail/me).
See Self-service and Read a user’s or agent’s trail.
Prove consent
Section titled “Prove consent”Each oauth2Consent record names the customer (subjectId), the app (clientId), every scope they allowed it, when
they first allowed it anything (firstGranted) and when they last allowed it more (lastGranted):
{ "subjectId": "<maya's id>", "clientId": "example-app", "scopes": ["email", "openid", "profile"], "firstGranted": "<RFC 3339 time>", "lastGranted": "<RFC 3339 time>" }A record exists only while the consent stands: taking an app back removes it, and leaves an APP_TAKEN_BACK record
on the customer’s trail with the time. Keep your own copy of a record if you need proof after it’s withdrawn.
Consent here is to apps and scopes. Acceptance of your terms or privacy policy isn’t recorded by the realm; record it in your own app.
Delete a customer’s account
Section titled “Delete a customer’s account”Deleting the account record alone doesn’t end everything the customer holds. Do it in this order:
-
Stop their access. Turn the account off, so sign-in and new tokens stop at once:
Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "status": "inactive" }' -
End their sessions:
Terminal window curl https://foobar.cvyuh.com/api/v0/am/sessions/v1/end \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "qbe": { "filter": { "field": "user", "op": "=", "value": "maya" } } }' -
Keep what you must. Read and save their trail and consent records if your own retention rules require them.
-
Remove their consent records, each by the
idthe list above returns:Terminal window curl -X DELETE https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Consent/<record id> \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "If-Match: *" -
Delete the account:
Terminal window curl -X DELETE https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "If-Match: *"
What goes with the account
Section titled “What goes with the account”| Goes | Stays |
|---|---|
| The account and its profile | Their audit trail, under their id |
| Their group memberships, and every agent’s right to act for them | Consent records you didn’t remove in step 4 |
| Their personal secrets, if they kept any in Secrets Store | Their passkey and authenticator-app records, which no one can use, since no account holds them |
| New tokens and refreshes: the realm refuses them, and introspection answers inactive | Access tokens an API checks on its own, without introspection, until they expire |
A deleted account can’t be brought back. If the customer might return, leave the account inactive instead.
Limits and defaults
Section titled “Limits and defaults”| What | Today |
|---|---|
| One-call export of a customer’s data | Planned: see What’s next for lifecycle |
| A customer deleting their own account | Not offered: your app calls the delete for them |
| How long the audit trail is kept | See Retention |
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
DELETE on the account answers 412 | The If-Match revision is stale | Send If-Match: *, or the current revision |
| A deleted customer’s app still reaches your API | The API checks tokens on its own, and the token hasn’t expired | Turn the account off and end sessions before deleting, as above; keep access tokens short |
| The consent list is empty for a customer who allowed apps | The filter names their sign-in name, not their id | Use the id from their record |
Audit records
Section titled “Audit records”Each change is on the trail: the account turned off and deleted (PATCHED, DELETED, with the record before the
change), and each consent record removed (DELETED). Read them in
Change history and on the customer’s trail.
Related
Section titled “Related”- Authorized apps: customers withdraw consent from an app themselves.
- The consent page: how consent is given.
- Turn access off and on: what
statusstops. - Retention: how long the realm keeps data.