Skip to main content

Delete a Collection

Endpointโ€‹

DELETE https://api.verifik.co/v2/face-recognition/collections/{id}

Deletes a collection owned by your client. The {id} path parameter is the collectionโ€™s unique _id.

The server removes the collection document and runs cleanup so it is no longer linked to projects or persons. This is a hard delete of the collection record (not a soft flag).

Headersโ€‹

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Paramsโ€‹

NameTypeRequiredDescription
idstring (path)YesUnique identifier of the collection to delete (_id in responses)

There is no request body.

Requestโ€‹

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

const collectionId = "65b9592267cc4f096dbe743d";

async function run() {
const res = await fetch(
`https://api.verifik.co/v2/face-recognition/collections/${collectionId}`,
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
}
);
console.log(await res.json());
}

run();

Responseโ€‹

On success the API returns HTTP 200. The JSON body is { "data": <collection> }, where data is the collection document that was just deleted (snapshot of the record, typically including _id, code, name, client, description, timestamps, and related fieldsโ€”same shape as retrieve a collection). The document is no longer stored in the database after this response.

{
"data": {
"_id": "65b9592267cc4f096dbe743d",
"deleted": false,
"name": "Ejemplo Ene 30",
"project": "65b955fe0577440932c77481",
"description": "default collection for project 65b955fe0577440932c77481",
"client": "6158e492dd0767a2b8b3f829",
"code": "d96db430-27d2-4f43-bcff-c4b239ac6d2e",
"updatedAt": "2024-01-30T20:16:34.841Z",
"createdAt": "2024-01-30T20:16:34.841Z",
"__v": 0
}
}

Notesโ€‹

  • Irreversible: Deletion removes the collection record and unlinks it from projects and persons.
  • No body: Only the path id is required; do not send a JSON body.
  • Response: data contains the deleted collection object (for audit or UI confirmation). It is not persisted after deletion.