Update a Person
Endpoint
PUT https://api.verifik.co/v2/face-recognition/persons/{id}
Updates an existing person. Send only the fields you want to change (name, images, gender, date_of_birth, nationality, collections, notes). Omit fields to leave them unchanged.
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}). |
name | string | No | Full name (digits may be stripped server-side). |
images | string[] | No | Base64-encoded face images (raw base64, not data: URLs). |
gender | string | No | M or F. |
date_of_birth | string | No | ISO 8601 date (e.g. 1990-01-15). |
nationality | string | No | Nationality or country code. |
collections | string[] | No | Collection IDs to associate with the person. |
notes | string | No | Free-form notes. |
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: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
name: "John Doe Updated",
gender: "M",
notes: "Updated VIP customer",
}),
});
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, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer " . getenv("VERIFIK_TOKEN"),
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"name" => "John Doe Updated",
"gender" => "M",
"notes" => "Updated VIP customer",
]));
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')}",
}
payload = {
"name": "John Doe Updated",
"gender": "M",
"notes": "Updated VIP customer",
}
r = requests.put(url, json=payload, headers=headers)
print(r.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
id := "person_123456789"
payload, _ := json.Marshal(map[string]interface{}{
"name": "John Doe Updated",
"gender": "M",
"notes": "Updated VIP customer",
})
url := "https://api.verifik.co/v2/face-recognition/persons/" + id
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(payload))
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()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
Response
- 200
- 401/403
- 404
- 409
- 412
- 500
{
"id": "…",
"data": {
"_id": "person_123456789",
"name": "John Doe Updated",
"gender": "M",
"date_of_birth": { "year": 1990, "month": 1, "day": 15 },
"nationality": "US",
"images": ["<base64>", "<base64>"],
"collections": ["collection_123456789"],
"notes": "Updated VIP customer",
"client": "client_123456789",
"status": "active",
"faceEncodings": ["…", "…"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-16T14:20:00.000Z"
},
"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 or missing field",
"code": "MissingParameter"
}
{
"message": "only_images_in_base64",
"code": "ERROR"
}
{
"message": "internal_error",
"code": "ERROR"
}
Notes
- Partial updates are supported: include only body fields you want to change.
- If you send
images, use raw base64 strings; invalid or tiny payloads may return 412only_images_in_base64. - 404 means the
{id}does not exist or is not visible for your client. - Updated records follow The Person Object; field shapes may vary with API version.