Skip to main content

Create a Collection

Endpoint

POST https://api.verifik.co/v2/face-recognition/collections

Create a new collection for storing faces generated using Verifik's Life Detection services. Collections are required for the majority of biometric services.

Headers

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Params

NameTypeRequiredDescription
namestringYesDisplay name for the collection
descriptionstringNoOptional description

Request

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

async function run() {
const res = await fetch("https://api.verifik.co/v2/face-recognition/collections", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`,
},
body: JSON.stringify({
name: "Test Example",
description: "Example on how to create a collection",
}),
});
console.log(await res.json());
}

run();

Response

{
"data": {
"__v": 0,
"_id": "65175da13e81e4fabc12345",
"code": "dac2c81b-96a6-4f19-ab54-d1a72d55b64b",
"name": "Test Example",
"client": "65175da13e81e4fabc12345",
"deleted": false,
"createdAt": "2023-09-29T23:28:33.894Z",
"updatedAt": "2023-09-29T23:28:33.894Z",
"description": "Example on how to create a collection"
}
}

Notes

  • Authentication: Send a valid bearer token; the new collection is associated with your client.
  • Name: name is required; description is optional but recommended for organization.
  • Errors: 409 / MissingParameter typically indicates missing or invalid body fields per API validation.