Skip to content
Customer IdentityMarkdown

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.

  • Privilege: RealmViewer in the customer realm to read a customer’s data and trail; RealmOwner to 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.
RequestWhat answers itHow
See my dataTheir record, their consent records, their factors and their audit trailGive a customer their data
What did I agree to?Their consent records: each app, the scopes allowed, firstGranted and lastGrantedProve consent
Withdraw my consent from an appThe customer’s own Authorized Apps pageAuthorized apps
Correct my dataA change to their recordPATCH on their record; see Add and change users
Delete meEnding their access, then deleting the accountDelete a customer’s account

Read each part, and hand the customer the answers:

Terminal window
# Their profile, without their password
curl https://foobar.cvyuh.com/api/v0/am/objects/v1/user/maya \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
# Every app they allowed
curl -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 name
curl "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.

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.

Deleting the account record alone doesn’t end everything the customer holds. Do it in this order:

  1. 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" }'
  2. 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" } } }'
  3. Keep what you must. Read and save their trail and consent records if your own retention rules require them.

  4. Remove their consent records, each by the id the 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: *"
  5. 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: *"
GoesStays
The account and its profileTheir audit trail, under their id
Their group memberships, and every agent’s right to act for themConsent records you didn’t remove in step 4
Their personal secrets, if they kept any in Secrets StoreTheir 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 inactiveAccess 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.

WhatToday
One-call export of a customer’s dataPlanned: see What’s next for lifecycle
A customer deleting their own accountNot offered: your app calls the delete for them
How long the audit trail is keptSee Retention
SymptomCauseFix
DELETE on the account answers 412The If-Match revision is staleSend If-Match: *, or the current revision
A deleted customer’s app still reaches your APIThe API checks tokens on its own, and the token hasn’t expiredTurn the account off and end sessions before deleting, as above; keep access tokens short
The consent list is empty for a customer who allowed appsThe filter names their sign-in name, not their idUse the id from their record

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.