Delete a Person
Endpoint
DELETE https://api.verifik.co/v2/face-recognition/persons/{id}
Removes a person (and associated face data) from the system. With optional query collection, the API may remove the person from that collection only instead of deleting the entire record when other collections remain.
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Params
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Person ID in the URL path (/persons/{id}). |
collection | string | No | If set, may detach the person from this collection only (behavior when other collections exist is server-defined). |
Request
- Node.js
- PHP
- Python
- Go
const fetch = require("node-fetch");
async function run() {
const id = "person_123456789";
const res = await fetch(`https://api.verifik.co/v2/face-recognition/persons/${id}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
});
console.log(await res.json());
}
run();
<?php
$id = "person_123456789";
$ch = curl_init("https://api.verifik.co/v2/face-recognition/persons/" . rawurlencode($id));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_TOKEN"),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os, requests
person_id = "person_123456789"
url = f"https://api.verifik.co/v2/face-recognition/persons/{person_id}"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_TOKEN')}",
}
r = requests.delete(url, headers=headers)
print(r.json())
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
id := "person_123456789"
url := "https://api.verifik.co/v2/face-recognition/persons/" + id
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Response
- 200
- 401/403
- 404
- 409
- 500
{
"id": "…",
"data": {
"_id": "person_123456789"
},
"signature": {
"message": "Certified by Verifik.co",
"dateTime": "…"
}
}
{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}
or
{
"message": "token_expired",
"code": "FORBIDDEN"
}
{
"error": "Person not found",
"message": "PERSON_NOT_FOUND"
}
{
"message": "Validation message",
"code": "MissingParameter"
}
{
"message": "internal_error",
"code": "ERROR"
}
Notes
- Permanent deletion: when the full person is removed, face encodings and related enrollment data are deleted; this cannot be undone.
collectionquery: use when you only need to remove membership from one collection; if the person still belongs to others, the record may remain.- 404 if
{id}does not exist or is outside your client scope.