Skip to main content
POST
Add a new face to a collection
The “Add a new face to a collection” section allows users to easily upload and store a new facial image within a specific collection. By utilizing this functionality, users can efficiently manage and organize their facial recognition data by adding new faces to their existing database. This section streamlines the process of expanding collections with additional facial data for enhanced accuracy and efficiency in facial recognition applications.

Request

Headers

string
required
The API key used for authentication and access control. This header parameter is required for authorization to add a new face to a collection.

Body Parameters

string
required
Unique identifier of the collection where the face will be added.
string
required
Name associated with the face being added to the collection.
string
required
Base64-encoded string representation of the face image.

Response

Success Response (200)

string
A success or error message indicating the result of the face submission
string
Unique identifier for the face submission.
string
Unique identifier corresponding to the metadata of the face submission.
object
Additional options and metadata for the face submission.

Error Responses

Bad Request (400)

number
Identifies the specific error for troubleshooting:
  • 6010: CollectionId is required
  • 6011: WorkspaceId is required
  • 6012: Fail to add face
  • 6013: Cannot find collection info
  • 6014: This collection is unavailable
  • 6015: Failed to validate liveness of face
  • 6016: Image size is too large
  • 6017: Unsupported image format
string
Briefly describes the error. Please refer to the error code for details.

Forbidden (403)

number
Identifies the specific error for troubleshooting.
string
Briefly describes the error:
  • API Key is required
  • Access Denied: API Key is unavailable

Authorizations

x-api-key
string
header
required

Body

application/json
collectionId
string
required

Unique identifier of the collection where the face will be added

Example:

"col_123456789"

userName
string
required

Name associated with the face being added to the collection

Example:

"John Doe"

faceImage
string
required

Base64-encoded string representation of the face image

Example:

"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..."

Response

Face successfully added to collection

message
string

Success message

Example:

"Face added successfully"

faceId
string

Unique identifier for the face submission

Example:

"face_123456789"

metaFaceId
string

Unique identifier corresponding to the metadata of the face submission

Example:

"meta_123456789"

option
object

Additional options and metadata for the face submission