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​

Content-Type​

Type: String
Required: Yes

application/json

Authorization​

Type: String
Required: Yes

Bearer <token>

Parameters​

name​

Type: String
Required: Yes

Name of the collection.

description​

Type: String
Required: Yes

Brief description of what the collection will be used for.

Request​

import axios from 'axios';

const options = {
method: 'POST',
url: 'https://api.verifik.co/v2/face-recognition/collections',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your_token>'
},
data: {
name: 'Test Example',
description: 'Example on how to create a collection'
}
};

try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}

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"
}
}