Update a Person
Update an existing person record in the facial recognition system. You can modify person information including name, images, gender, date of birth, nationality, collections, and notes.
Endpoint
PUT https://api.verifik.co/v2/face-recognition/persons/{id}
Headers
| Name | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <token> |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The unique identifier of the person to update |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | No | Full name of the person |
images | array | No | Base64-encoded images for recognition |
gender | string | No | Gender of the person (M or F) |
date_of_birth | string | No | Date of birth of the person (ISO8601) |
nationality | string | No | Nationality of the person |
collections | array | No | Array of collection IDs related to this person |
notes | string | No | Additional notes about the person |
Request
- Node.js
- Python
import axios from 'axios';
const personId = "person_123456789";
const options = {
method: 'PUT',
url: `https://api.verifik.co/v2/face-recognition/persons/${personId}`,
data: {
name: "John Doe Updated",
gender: "M",
notes: "Updated VIP customer"
},
headers: {
Accept: 'application/json',
Authorization: 'Bearer <your_token>'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
import http.client
import json
conn = http.client.HTTPSConnection("api.verifik.co")
person_id = "person_123456789"
payload = json.dumps({
"name": "John Doe Updated",
"gender": "M",
"notes": "Updated VIP customer"
})
headers = {
'Accept': "application/json",
'Authorization': "Bearer <your_token>",
'Content-Type': 'application/json'
}
conn.request("PUT", f"/v2/face-recognition/persons/{person_id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response
- 200
- 404
- 401
{
"success": true,
"data": {
"_id": "person_123456789",
"name": "John Doe Updated",
"gender": "M",
"date_of_birth": {
"year": 1990,
"month": 1,
"day": 15
},
"nationality": "US",
"images": [
"base64_encoded_image_1",
"base64_encoded_image_2"
],
"collections": ["collection_123456789"],
"notes": "Updated VIP customer",
"client": "client_123456789",
"status": "active",
"faceEncodings": [
"face_encoding_1",
"face_encoding_2"
],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-16T14:20:00Z"
}
}
{
"error": "Person not found",
"message": "PERSON_NOT_FOUND"
}
{
"error": "Unauthorized",
"message": "UNAUTHORIZED"
}
Features
- Person Updates: Update existing person records with new information
- Partial Updates: Update only the fields you need to change
- Image Updates: Add or replace images for face recognition
- Collection Management: Update collection assignments
- Structured Response: Organized data format for easy integration
- Multiple Programming Languages: Support for JavaScript, Python, PHP, and Swift
- Error Handling: Comprehensive error responses for various scenarios