创建人脸库

创建人脸库

创建命名集合以分组已注册人员。

menu_bookAPI 参考:创建人脸库expand_more

官方文档: docs.verifik.co/resources/create-a-collection

基础 URL 为 https://api.verifik.co。发送包含显示名称与可选描述的 JSON 正文。

POST /v2/face-recognition/collections

创建命名集合,用于在基于 Verifik 的数据库中对已注册人员进行分组、检索与核验。

字段
Content-Typeapplication/json
AuthorizationBearer <token>
参数必填说明
name人脸库显示名称
description可选描述
await fetch("https://api.verifik.co/v2/face-recognition/collections", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${accessToken}`,
  },
  body: JSON.stringify({
    name: "My collection",
    description: "Optional notes",
  }),
});
// 200 OK — example shape
{
  "data": {
    "_id": "…",
    "code": "…",
    "name": "My collection",
    "description": "Optional notes",
    "client": "…",
    "createdAt": "…",
    "updatedAt": "…",
    "__v": 0
  }
}
  • 本演示使用 @humanauthn/api-client 的 createCollection 及您的会话令牌。
  • 部分环境可能在响应中附加 id 或签名字段;上方结构展示核心数据载荷。
menu_book

docs.verifik.co 官方指南