Skip to main content

Bulk Erase Data

Endpoint​

POST https://api.verifik.co/v2/data-retention/erase

Initiates an asynchronous bulk erasure operation. Permanently deletes stored DigitalOcean Spaces keys under the target prefix and unsets PII fields in MongoDB.

Headers​

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Request Body​

NameTypeRequiredDescription
scopestringYesTarget scope: "project" or "client"
projectIdstringConditionalRequired when scope is "project"
beforestring (ISO 8601)NoOptional cutoff timestamp. Erases data created prior to this date.
typesarrayNoOptional filter for specific media types (e.g. ["documentImages", "faceImages"])

Request​

const fetch = require("node-fetch");

async function bulkErase() {
const payload = {
scope: "project",
projectId: "6266193db77ccc8111730c90",
before: "2026-01-01T00:00:00.000Z",
types: ["documentImages", "faceImages"]
};

const res = await fetch("https://api.verifik.co/v2/data-retention/erase", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload)
});
console.log(await res.json());
}

bulkErase();

Response​

{
"data": {
"jobId": "erase_6add0c680b29eb28766c82ce",
"status": "QUEUED",
"scope": "project",
"projectId": "6266193db77ccc8111730c90",
"estimatedRecords": 1420
}
}