Remove a reader’s publication profile and related data
Remove a reader from a publication
DELETE /api/v1/admin/users/{user_id}/data
Remove the reader’s publication relationship and attempt related cleanup. This is destructive and can affect local and external data.
Cleanup can remove shared local payment-customer/card associations across publications and attempt Firebase user/Firestore document deletion. A local rollback cannot restore external Firebase deletions. Review the affected shared records and provider identities before removal.
The global account and historical records can remain. This is not complete erasure, a legal-compliance result or safely repeatable removal.
Before you call
Use an admin token, inherited by partner, or root. readonly, manager and support alone cannot remove readers. Service accounts cannot, including those with full_access. Keep the call in trusted server code.
The intended account and its publication relationship must exist. Confirm the reader against your audience records. The caller must be active; their current publication relationship, when present, must not be locked or suspended.
Review shared-payment and external-identity effects through your existing operator process. Payment cleanup can affect other publications. Use a field-specific operation for a field edit. Removing one membership also has its own cleanup consequences; read that operation before choosing it.
What can be removed, changed or retained
Removal can affect these local and external areas. External deletion may occur even when the local request later fails:
| Area | Intended effect and limits |
|---|---|
| Firebase authentication | Attempts to delete the configured provider user when a Firebase identity is present and not found on another publication relationship. A successful response does not confirm that every provider deletion completed. No provider setup is part of this request. |
| Firestore | Attempts to delete the configured user document under the same shared-identity precaution. A successful response does not confirm removal of every external document or historical copy. |
| Publication memberships | Selects the reader’s memberships through Plans in this publication, records membership history and deletes the selected relationship rows. When configured, membership deletion can also clear this reader’s stored content-view records across publications. This is not a purge of all membership history or all-publication memberships. |
| Current publication sessions | Deletes selected current session rows, but session records can be copied to an archive. It does not guarantee all historical session/credential data is erased. No archive-access workflow is provided here. |
| Grouped extra data | Removes the reader/publication’s stored group/field rows. The publication relationship’s own extra/settings go with that relationship. No global-extra or all-history cleanse is promised. |
| Shared local payment records | Removes associated local payment-customer records and can also remove their shared card/publication associations elsewhere. It does not call Stripe to delete the provider customer/card in this cleanup path. |
| Publication audience relationship | Attempts to delete the selected reader/publication relationship. Inspect the remaining audience records after an uncertain result. |
| Global account when no other publication relationship remains | Retains the account row, rewrites its email to a deletion placeholder, deactivates it and clears selected names/contact/location/social identifiers. It does not hard-delete the account or guarantee every remaining field is erased. |
| Other history and records | No complete purge of mail, transaction, access, tag, team or archived records is established by this operation. Retention and shared-data effects must be understood in your application context. |
No count or per-area result is returned. A caught local failure attempts rollback, but external deletions can remain and later failures can follow saved local cleanup. Inspect actual state after an uncertain result before relying on the removal or considering another request.
Request
Send the path and headers without a body. There are no dry-run, per-area or other cleanup options.
| Input | Location / type | Meaning |
|---|---|---|
| resource | Required header, publication public-key string | Selects the publication relationship and related local data. Shared payment records can also change across publications. Not a numeric ID or secret. |
| token | Required header, existing eligible token string | ADMIN_TOKEN in examples. |
| user_id | Required digits-only path value | Global account ID for the intended reader; not a membership, customer or Firebase ID. |
Response
Nominal HTTP 200 returns one operation field:
| Field | Type / meaning |
|---|---|
| status | String success. Completion marker, not confirmation of every external/local deletion or a per-area report. |
A deletion event may follow local cleanup; it does not confirm downstream processing, mail delivery or provider cleanup. Repeating can encounter the now-missing relationship or changed state. There is no harmless repeated-delete guarantee.
Example: Remove the intended publication profile
Examples use fictional reader 1002 and illustrative responses. Requests use cURL, Node.js 18+ fetch in an ES module (.mjs), and Python 3 urllib. Set WALLKIT_API_BASE to scheme and host only, plus existing RESOURCE_KEY and ADMIN_TOKEN.
Assume the intended reader/publication relationship exists and the shared cleanup and retention effects have been reviewed. The example is a destructive removal; shared records and external identities can be affected as described above.
curl "${WALLKIT_API_BASE}/api/v1/admin/users/1002/data" \
-X DELETE \
-H "resource: ${RESOURCE_KEY}" \
-H "token: ${ADMIN_TOKEN}"
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/users/1002/data`);
const response = await fetch(url, {
method: "DELETE",
headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN}
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError
url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/users/1002/data"
request = Request(
url,
headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]},
method="DELETE"
)
try:
with urlopen(request) as response:
print(response.status, json.load(response))
except HTTPError as error:
print(error.code, json.load(error))
Nominal HTTP 200 response:
{
"status": "success"
}
This marker does not confirm complete Firebase deletion, purged archives or preservation of other-publication payment records.
A cleanup failure can return HTTP 404
HTTP 404 example from the generic caught-exception branch:
{
"error": "delete_user_error",
"error_description": "Delete user profile has been failed",
"req_guid": "example-request"
}
The same code can mean a missing publication relationship or failed cleanup after destructive changes. It does not necessarily mean the global account is missing. Inspect current state with your operator before any further action; do not blindly repeat deletion.
Recovery
| HTTP status | API code / response shape | Cause | Next action |
|---|---|---|---|
| 404 | user_not_exists | Global account lookup fails; description is User not found. | Check the intended reader ID against existing records. |
| 404 | resource_not_found | Required publication context is unavailable. | Check the known publication public key and existing integration context. |
| 404 | delete_user_error | Selected relationship is missing or another caught cleanup/post-cleanup exception occurs. | Provide req_guid to the integration operator and inspect known local/external effects before considering another action. Do not infer unchanged state. |
| 200 | status success | Cleanup reported completion; some local or external changes may not have completed. | Handle the result as a completion marker; use your existing operator process to inspect intended effects and retained/shared data where needed. |
| Varies / no guaranteed JSON | Other PHP/transport failure | Not every failure is normalized or covered by a complete rollback. | Retain any request reference and inspect current state before another destructive request. |
See shared errors. Reconcile cleanup with your existing account/retention process. An error, retained archive or retained account alone cannot confirm which steps succeeded.