Passer au contenu

Data Erasure API

Ce contenu n'est pas encore disponible dans votre langue.

The Data Erasure API is the self-serve way to erase a subject’s personal data from Pushwoosh (GDPR right to erasure). Erasure is irreversible: use it to mirror the Control Panel’s Data requests page and the Erase personal data action on a subscriber’s card from your own systems.

https://rpc-api.svc-nue.pushwoosh.com

All endpoints are served over HTTPS. Requests and responses use application/json, except Upload, which takes multipart/form-data.

Authentication

Anchor link to

Every request must include an Authorization header with your Server API token:

Authorization: Api YOUR_API_TOKEN

The token must have modify access to every application named in application_codes. That’s the same access a token needs to write device data on those applications.

Conventions

Anchor link to
  • Field naming: request bodies accept lowerCamelCase (for example, applicationCodes, identifierType). Responses are marshaled using the proto field names, in snake_case (task_id, identifier_hash, and so on). The examples and object references below use that casing.
  • Identifiers: a subject is addressed by identifier_type (SUBJECT_IDENTIFIER_USER_ID, SUBJECT_IDENTIFIER_HWID, or SUBJECT_IDENTIFIER_EMAIL) plus a list of identifiers of that one type. An email identifier is matched case-insensitively.
  • Dry run first, then quote it: Create with dry_run: true only counts what would be erased and writes nothing. Quoting that dry run’s task_id as confirmation_dry_run_task_id on the real call is optional, but if you quote one, it must match that dry run’s own applications and identifiers exactly, and be called within 15 minutes of it finishing. Otherwise the call is refused.
  • Reports never carry the identifier in the clear. Both GetTaskReport and GetJournalReport report each identifier as its sha256 hash (identifier_hash), and the report body is CSV encoded as base64 inside the JSON response.

Error responses

Anchor link to
HTTP statusMeaning
400 Bad RequestInvalid argument, such as an empty identifier_type, identifiers, or application_codes, more than 10,000 identifiers, more than 50 applications, identifiers × applications over 50,000, an empty identifier string, or (Upload only) a missing/unreadable CSV file. Also returned as FailedPrecondition on the wire when a quoted confirmation_dry_run_task_id doesn’t match the finished dry run it names, is too old (over 15 minutes), or isn’t a finished dry run at all.
401 UnauthorizedMissing or invalid Authorization header.
403 ForbiddenThe token has no modify/device-data right on one of the requested applications, or the caller may not read the requested task/report.
404 Not FoundThe task was not found, or doesn’t belong to the caller’s account.
413 Payload Too Large(Upload only) the uploaded file is over 5 MB.
429 Too Many RequestsThe account already started 20 data erasure tasks (dry runs included) in the last 24 hours.
MethodPathDescription
POST/api/data_erasure/tasksCreate an erasure (or dry-run) task
POST/api/data_erasure/uploadCreate an erasure task from an uploaded CSV of identifiers
GET/api/data_erasure/tasksList the account’s erasure tasks
GET/api/data_erasure/tasks/{task_id}Get one erasure task
GET/api/data_erasure/tasks/{task_id}/rowsList one task’s per-identifier results
GET/api/data_erasure/tasks/{task_id}/reportDownload one task’s report as CSV
GET/api/data_erasure/reportDownload every task of a period as one CSV

Starts erasing the personal data of the listed subjects in the listed applications. With dry_run: true the task only counts what would be erased.

POST /api/data_erasure/tasks

Request body

Anchor link to
ParameterTypeRequiredDescription
identifierTypestringYesSUBJECT_IDENTIFIER_USER_ID, SUBJECT_IDENTIFIER_HWID, or SUBJECT_IDENTIFIER_EMAIL.
identifiersarray of stringsYesSubject identifiers of that one type, up to 10,000 per task, no empty values.
applicationCodesarray of stringsYesApplication codes to erase from, up to 50. There’s no way to erase from every application of the account in one call, so name each one explicitly. identifiers.length × applicationCodes.length must not exceed 50,000, because the report holds one row per identifier per application.
dryRunbooleanNoCounts what would be erased and writes nothing. Defaults to false.
confirmationDryRunTaskIdintegerNotask_id of a finished dry run that measured this exact erase. See Conventions.
Request example
Anchor link to
{
"identifierType": "SUBJECT_IDENTIFIER_EMAIL",
"identifiers": ["subject@example.com"],
"applicationCodes": ["XXXXX-XXXXX"],
"dryRun": true
}
FieldTypeDescription
task_idintegerId of the created task. Use it with every other endpoint on this page.

Creates the same kind of task as Create, but the identifiers come from an uploaded CSV instead of a JSON array. Use this for a bulk subject list.

POST /api/data_erasure/upload

Request (multipart/form-data)

Anchor link to
FieldRequiredDescription
fileYesCSV file, up to 5 MB, one identifier per row, in the single column. The first row may name the column (user_id, userid, user id, hwid, email, identifier, or subject, case-insensitively) instead of holding an identifier. That row is then skipped as a header, not counted. Blank rows are skipped and counted separately. Duplicate identifiers (case-insensitively, for email) are collapsed to one and counted separately.
identifier_typeYesuser_id, hwid, or email, lowercase, a different casing from the JSON identifierType enum values used elsewhere on this page. One type applies to the whole file.
application_codesYesComma-separated application codes.
dry_runNotrue/false.
confirmation_dry_run_task_idNoSame as Create.
{
"task_id": 123,
"identifier_count": 480,
"duplicate_count": 3,
"skipped_rows": 1
}

Lists the erasures of the account, newest first: the audit journal of who erased what and when. Dry runs are left out unless includeDryRuns is set.

GET /api/data_erasure/tasks

Query parameters

Anchor link to
ParameterTypeDescription
limit / offsetintegerPaging.
includeDryRunsbooleanInclude dry-run (measurement-only) tasks.
from / tostring (RFC 3339)Keep tasks started in [from, to).
applicationCodestringKeep tasks that cover this application.
initiatorUserIdintegerKeep tasks started by this Control Panel user. 0 (default) keeps every initiator.
initiatorTokenIdintegerKeep tasks started by this API token. 0 (default) keeps every initiator.
initiatorEmailstringKeep tasks started by this Control Panel user, matched by email, case-insensitively.
FieldTypeDescription
tasksarray of Data erasure task objectsMatching tasks.

Returns one erasure task with its status and counters. Use it to follow a task started by Create or Upload.

GET /api/data_erasure/tasks/{task_id}

FieldTypeDescription
taskData erasure task objectThe requested task.

ListTaskRows

Anchor link to

Returns the per-identifier outcome of one task: what was deleted, not found, skipped, or failed. Identifiers are reported as their sha256 hash.

GET /api/data_erasure/tasks/{task_id}/rows

Query parameters

Anchor link to
ParameterTypeDescription
limit / offsetintegerPaging.
FieldTypeDescription
rowsarray of Data erasure task row objectsThis page of results.

GetTaskReport

Anchor link to

Returns the whole report of one task as a CSV file: one row per identifier per application, with its outcome. ListTaskRows shows the same rows page by page instead.

GET /api/data_erasure/tasks/{task_id}/report

FieldTypeDescription
filenamestringSuggested file name, for example data-erasure-task-42.csv.
content_typestringtext/csv.
contentstring (base64)The CSV file. Columns: task_id, created, identifier_type, identifier_hash, application_code, result, detail.

GetJournalReport

Anchor link to

Returns every erasure of a period as one CSV file: a row per identifier per application, with the task and its initiator on each row. This is what an account hands to an auditor.

GET /api/data_erasure/report

Query parameters

Anchor link to
ParameterTypeRequiredDescription
fromstring (RFC 3339)YesStart of the period.
tostring (RFC 3339)NoEnd of the period. Defaults to now.
includeDryRunsbooleanNoInclude dry-run tasks.
FieldTypeDescription
filenamestringSuggested file name, for example data-erasure-2026-01-01-2026-04-01.csv.
content_typestringtext/csv.
contentstring (base64)The CSV file. Columns: task_id, task_created, initiator_user_id, initiator_email, initiator_token_id, dry_run, identifier_type, identifier_hash, application_code, result, detail, row_created.

Data erasure task object

Anchor link to
FieldTypeDescription
task_idintegerTask id.
identifier_typestringSUBJECT_IDENTIFIER_USER_ID, SUBJECT_IDENTIFIER_HWID, or SUBJECT_IDENTIFIER_EMAIL.
application_codesarray of stringsApplications the task covers.
dry_runbooleanWhether this task only measured a volume.
statusstringERASURE_TASK_STATUS_PENDING, _IN_PROGRESS, _DONE, or _FAILED.
total_countintegerIdentifiers × applications this task covers.
deleted_countintegerHow many were erased (or, for a dry run, would be).
not_found_countintegerHow many matched nothing.
failed_countintegerHow many failed. See ListTaskRows or the report for why.
fail_reasonstringSet when status is ERASURE_TASK_STATUS_FAILED.
initiator_user_idintegerControl Panel user who started the task. 0 when an API token did.
initiator_token_idintegerAPI token that started the task. 0 when a Control Panel user did.
initiator_emailstringAddress of the Control Panel user who started the task. Empty for an API token.
createdstring (RFC 3339)When the task was created.
started_atstring (RFC 3339)When erasure work began.
finished_atstring (RFC 3339)When the task reached a final status.

Data erasure task row object

Anchor link to
FieldTypeDescription
identifier_hashstringsha256 of the identifier. The report never stores or returns the identifier itself.
application_codestringApplication this row’s outcome applies to.
resultstringERASURE_ROW_RESULT_DELETED, _NOT_FOUND, _SKIPPED, or _FAILED.
detailstringTechnical detail, mainly set on failure.
createdstring (RFC 3339)When this row was written.