Create Collection (POST)

The Create Collection API allows you to create a new collection for managing facial data. Collections are used to organize and store sets of facial images or data for various purposes.

To create a new collection, make a POST request to the provided endpoint with the required request body parameters, including the name of the collection. Optionally, you can provide a description for the collection.

The API will respond with information about the newly created collection, including its unique identifier, name, description, and timestamps. You can use this information to manage and organize facial data within the collection as needed for your application.

collection_id

For the service to function correctly, you must provide a parameter called collection_id. This parameter is obtained when creating a new collection with the name code. Here is an example of a collection creation response:

{
  "data": {
    "__v": 0,
    "_id": "65175da13e81e4fabc12345",
    "code": "dac2c81b-96a6-4f19-ab54-d1a72d55b64b",
    "name": "Test2",
    "client": "65175da13e81e4fabc12345",
    "deleted": false,
    "createdAt": "2023-09-29T23:28:33.894Z",
    "updatedAt": "2023-09-29T23:28:33.894Z",
    "description": "Test Collection"
  }
}

While all the previous parameters are useful, the one we are currently seeking is code. This parameter will be the one we will use from now on when requested, and it will be associated with the name collection_id.

{
    "code": "dac2c81b-96a6-4f19-ab54-d1a72d55b64b"
}

Implementation

Request

import axios from 'axios';

const options = {
  method: 'POST',
  url: '<https://api.verifik.co/v2/face-recognition/collections>',
  params: {
  },
  headers: {
    Accept: 'application/json',
    Authorization: 'jwt <tu_token>'
  },
    data: {name: 'string', description: 'string'}
};

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

Response 200 - (Successful Request)

{
  "data": {
    "__v": 0,
    "_id": "65175da13e81e4fabc12345",
    "code": "dac2c81b-96a6-4f19-ab54-d1a72d55b64b",
    "name": "Test2",
    "client": "65175da13e81e4fabc12345",
    "deleted": false,
    "createdAt": "2023-09-29T23:28:33.894Z",
    "updatedAt": "2023-09-29T23:28:33.894Z",
    "description": "Test Collection"
  }
}

Get Collections (GET)

The Collections API allows you to manage collections of facial data. Collections are used to organize and store sets of facial images or data for various purposes, such as training facial recognition models or managing user profiles.

This API is typically used for managing collections of facial data. You can use it to retrieve information about existing collections, create new collections, update collection details, and delete collections if needed.